diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 86ea5a6a6dbca..7ad19553c3a85 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -7,7 +7,6 @@ authorized_users: - Croydon - Johnnyxy - solvingj -- ericLemanissier - tru - sztomi - theodelrieu @@ -967,7 +966,7 @@ authorized_users: - kletoz - agilemapper - ZXfkSIE -- RubenRBS +- AbrilRBS - Alex-PLACET - antekone - ambroff @@ -1313,3 +1312,73 @@ authorized_users: - Ruwei-Liu - msparapa - pzheltov +- igadmg +- eljonny +- VladimirShaleev +- phwissmann +- ybogo +- ujos +- nclindroos +- es20490446e +- victimsnino +- dmpriso +- darakelian +- sivachandran +- oteffahi +- Ruwei +- TibiIius +- MattBelanger321 +- X1aomu +- datalogics-rgailiunas +- yhsng +- omdxp +- pierricgimmig +- laci-aura +- BenBudr +- PLeVasseur +- datalogics-staylor +- soroosh-sdi +- TheHugeManatee +- FannoFlow1 +- nayakche +- psi-func +- deniskovalchuk +- zarvox +- ErniGH +- culhatsker +- lubomirjurukov +- jmdaly +- inPhraZ +- nikolay-pv +- Julianiolo +- ErikHons +- enzo-pellegrini +- BLumia +- ydcpp +- tttapa +- zeeshancs07 +- jll63 +- Jie-Cheng +- jjardina +- soonick +- Mercotui +- sunbubble +- praetorian20 +- phbasler +- gsantner +- qihao727 +- qmfrederik +- NukeBird +- vijaiaeroastro +- xoorath +- mike919192 +- ScarletEmanu +- josephbirkner +- glywk +- aniederl +- SvenRoederer +- MridulS +- leemaguire +- RobinQu +- MatthewRasa +- jan-kelemen diff --git a/.c3i/conan_v2_ready_references.yml b/.c3i/conan_v2_ready_references.yml index aced003f38780..20665bebe59ae 100644 --- a/.c3i/conan_v2_ready_references.yml +++ b/.c3i/conan_v2_ready_references.yml @@ -23,6 +23,7 @@ required_for_references: - andreasbuhr-cppcoro - android-ndk - angelscript +- annoy - antlr4 - antlr4-cppruntime - any-lite @@ -56,11 +57,13 @@ required_for_references: - async_simple - asyncly - asyncplusplus +- asyncpp - audiofile - autoconf - autoconf-archive - automake - avahi +- avcpp - avir - aws-c-auth - aws-c-cal @@ -86,10 +89,12 @@ required_for_references: - baical-p7 - bandit - base64 +- basu - bazel - bdwgc - bear - beauty +- behaviortree.cpp - benchmark - bertrand - bezier @@ -106,6 +111,7 @@ required_for_references: - blaze - blend2d - bliss +- bmx - boolean-lite - boolinq - boost @@ -115,6 +121,7 @@ required_for_references: - botan - box2d - breakpad +- bredis - brigand - brotli - brunsli @@ -135,6 +142,7 @@ required_for_references: - c-dbg-macro - c4core - caf +- cairo - cairomm - cajun-jsonapi - calceph @@ -149,6 +157,7 @@ required_for_references: - ccache - cccl - ccfits +- cctag - cctz - cd3-boost-unit-definitions - celero @@ -208,6 +217,8 @@ required_for_references: - cose-c - cotila - coz +- cpp-channel +- cpp-dump - cpp-httplib - cpp-ipc - cpp-jwt @@ -216,6 +227,7 @@ required_for_references: - cpp-peglib - cpp-sort - cpp-validator +- cpp-yyjson - cpp_project_framework - cppbenchmark - cppcheck @@ -236,7 +248,10 @@ required_for_references: - cprocessing - cpu_features - cpuinfo +- cpython - cqrlib +- cr +- crashpad - crc32c - crc_cpp - crcpp @@ -263,6 +278,7 @@ required_for_references: - cute_headers - cvplot - cwalk +- cxxgraph - cxxopts - cyclonedds - cyclonedds-cxx @@ -280,6 +296,7 @@ required_for_references: - dbg-macro - dbus - dcmtk +- dd-opentracing-cpp - debug_assert - decimal_for_cpp - deco @@ -289,13 +306,16 @@ required_for_references: - dfp - di - dice-template-library +- diligent-core - dime - directshowbaseclasses - directx-headers - dirent - discount +- dispenso - djinni-generator - djinni-support-lib +- djvulibre - dlib - dlpack - dnet @@ -338,6 +358,7 @@ required_for_references: - embag - embedded_ringbuf_cpp - embree3 +- emhash - emio - emsdk - enchant @@ -350,6 +371,7 @@ required_for_references: - entityx - entt - enum-flags +- enumbitmask - erikzenker-hsm - erkir - etc2comp @@ -368,6 +390,7 @@ required_for_references: - ezc3d - faac - fakeit +- faker-cxx - farmhash - fast-cdr - fast-cpp-csv-parser @@ -431,6 +454,7 @@ required_for_references: - gainput - gamenetworkingsockets - gamma +- gcc - gcem - gdal - gdbm @@ -468,6 +492,7 @@ required_for_references: - glu - gm2calc - gmp +- gn - gnu-config - gnulib - gnutls @@ -489,6 +514,7 @@ required_for_references: - gtest - gtk - gtk-doc-stub +- gtlab-logging - gtsam - guetzli - gumbo-parser @@ -533,6 +559,7 @@ required_for_references: - id3v2lib - idna - ignition-cmake +- iguana - iir1 - im95able-rea - imagl @@ -555,6 +582,7 @@ required_for_references: - intx - inversify-cpp - iowow +- ipaddress - iqa - irrxml - isa-l @@ -572,6 +600,7 @@ required_for_references: - jerryscript - jfalcou-eve - jinja2cpp +- jnk0le_ringbuffer - joltphysics - jom - jpcre2 @@ -583,6 +612,7 @@ required_for_references: - json_dto - jsoncons - jsoncpp +- jsonifier - jsonnet - jthread-lite - jungle @@ -592,16 +622,20 @@ required_for_references: - kainjow-mustache - kaitai_struct_cpp_stl_runtime - kangaru +- kcov - kcp - kdbindings +- kealib - keychain - khrplatform - kickcat - kissfft - kitten - kmod +- krb5 - ktx - kuba-zip +- kuliya - lager - laslib - laszip @@ -611,6 +645,7 @@ required_for_references: - lefticus-tools - lely-core - lemon +- leopard - leptonica - lerc - lest @@ -625,10 +660,12 @@ required_for_references: - libatomic_ops - libattr - libavif +- libavrocpp - libb2 - libbacktrace - libbasisu - libbigwig +- libboxes - libbpf - libbsd - libcap @@ -644,6 +681,7 @@ required_for_references: - libcpuid - libcuckoo - libcurl +- libcvd - libdaemon - libdb - libdc1394 @@ -670,14 +708,17 @@ required_for_references: - libexif - libfdk_aac - libffi +- libfork - libfreenect - libfreenect2 - libftdi +- libftp - libfuse - libgcrypt - libgd - libgeotiff - libgettext +- libgit2 - libglvnd - libgpg-error - libgphoto2 @@ -690,6 +731,10 @@ required_for_references: - libiberty - libiconv - libid3tag +- libidn +- libidn2 +- libigl +- libinput - libinterpolate - libipt - libjpeg @@ -703,6 +748,7 @@ required_for_references: - libmagic - libmaxminddb - libmbus +- libmd - libmediainfo - libmemcached - libmetalink @@ -738,13 +784,16 @@ required_for_references: - libpq - libpqxx - libproperties +- libprotobuf-mutator - libpsl +- libqasm - libqrencode - librasterlite - libraw - librdkafka - librealsense - libressl +- librhash - librttopo - libsafec - libsamplerate @@ -767,6 +816,7 @@ required_for_references: - libspng - libsquish - libsrtp +- libssh - libssh2 - libsvm - libsvtav1 @@ -810,11 +860,13 @@ required_for_references: - libxshmfence - libxslt - libyaml +- libyang - libyuv - libzen - libzip - libzippp - lief +- lielab - lightgbm - lightpcapng - linmath.h @@ -830,6 +882,7 @@ required_for_references: - log.c - log4cplus - log4cxx +- logfault - logr - loguru - ls-qpack @@ -847,16 +900,19 @@ required_for_references: - lzma_sdk - lzo - m4 +- macdylibbundler - maddy - magic_enum - mailio - make +- makefile-project-workspace-creator - mapbox-geometry - mapbox-variant - mapbox-wagyu - mariadb-connector-c - marisa - matchit +- materialx - mathfu - mathter - matio @@ -892,7 +948,9 @@ required_for_references: - mimalloc - mingw-builds - mingw-w64 +- mini - miniaudio +- minicoro - minimp3 - minisat - miniscript @@ -902,7 +960,9 @@ required_for_references: - minizip - minizip-ng - mio +- mlpack - mm_file +- mocknetworkaccessmanager - modern-cpp-kafka - mold - moltenvk @@ -918,6 +978,7 @@ required_for_references: - mpdecimal - mpfr - mpg123 +- mpir - mpmcqueue - mppp - ms-gsl @@ -925,6 +986,7 @@ required_for_references: - msdfgen - msgpack-c - msgpack-cxx +- msix - msys2 - mtdev - mujs @@ -950,6 +1012,7 @@ required_for_references: - nextsilicon-cpp-subprocess - nfrechette-acl - nghttp3 +- nifti_clib - ninja - nlohmann_json - nlopt @@ -970,6 +1033,7 @@ required_for_references: - numcpp - nuraft - nv-codec-headers +- nvcloth - nvtx - oatpp - oatpp-libressl @@ -989,6 +1053,7 @@ required_for_references: - ogdf - ogg - ohnet +- ohpipeline - ois - onedpl - onetbb @@ -1023,15 +1088,19 @@ required_for_references: - openimageio - openjdk - openjpeg +- openldap - openmesh - openmvg - openpam +- openscenegraph +- openssh - openssl - opensubdiv - opentdf-client - opentelemetry-cpp - opentelemetry-proto - opentracing-cpp +- openvdb - openvino - openvr - openxlsx @@ -1042,11 +1111,13 @@ required_for_references: - orcania - osmanip - osqp +- ouster_sdk - out_ptr - outcome - ozz-animation - p-ranav-glob - p7zip +- pagmo2 - paho-mqtt-c - paho-mqtt-cpp - pango @@ -1056,6 +1127,7 @@ required_for_references: - parson - patchelf - pathie-cpp +- pbc - pbtools - pcapplusplus - pcg-cpp @@ -1090,6 +1162,7 @@ required_for_references: - platform.exceptions - platform.hashing - platform.interfaces +- platformfolders - playrho - plf_colony - plf_indiesort @@ -1102,10 +1175,12 @@ required_for_references: - plutovg - pngpp - poco +- podofo - poly2tri - polylabel - polylineencoder - polymorphic_value +- popl - poppler-data - popt - portable-file-dialogs @@ -1115,6 +1190,7 @@ required_for_references: - premake - pretty-name - primesieve +- pro-mdnsd - procxx-boost-ext-simd - proj - prometheus-cpp @@ -1123,6 +1199,7 @@ required_for_references: - protobuf-c - protopuf - protozero +- proxy - psimd - psyinf-gmtl - ptex @@ -1143,14 +1220,18 @@ required_for_references: - qr-code-generator - qt - qtawesome +- qtxlsxwriter - quantlib - quaternions - quazip +- quickcpplib +- quickfast - quickfix - quickjs - quill - quirc - qwt +- qxmpp - r8brain-free-src - rabbitmq-c - ragel @@ -1183,6 +1264,7 @@ required_for_references: - refl-cpp - reflect-cpp - replxx +- resiprocate - resource_pool - restbed - restinio @@ -1192,6 +1274,7 @@ required_for_references: - rmm - roaring - robin-hood-hashing +- rocket - rocksdb - rotor - rpclib @@ -1205,6 +1288,7 @@ required_for_references: - rvo2 - rxcpp - s2geometry +- s2let - s2n - safe - safeint @@ -1213,6 +1297,7 @@ required_for_references: - sassc - sbepp - sbp +- scc - scdoc - scip - scippp @@ -1241,17 +1326,20 @@ required_for_references: - serial - sfl - sfml +- shaderc - shapelib - shield - si - signals-light - sigslot +- simd - simde - simdjson - simdutf - simfil - simple-websocket-server - simple-yaml +- sioclient - sjson-cpp - skyr-url - sleef @@ -1274,6 +1362,7 @@ required_for_references: - span-lite - spdlog - spectra +- speedb - spirv-cross - spirv-headers - spirv-tools @@ -1281,6 +1370,7 @@ required_for_references: - spy - sqlcipher - sqlite3 +- sqlite3mc - sqlite_orm - sqlitecpp - sqlpp11 @@ -1297,8 +1387,10 @@ required_for_references: - stc - stdgpu - stduuid +- stella-cv-fbow - stlab - strawberryperl +- streaming-percentiles - streamvbyte - string-view-lite - stringtoolbox @@ -1342,9 +1434,11 @@ required_for_references: - tgbot - tgc - thelink2012-any +- thorvg - threadpool - thrift - thrust +- tidwall-neco - tidy-html5 - timsort - tinkerforge-bindings @@ -1355,6 +1449,7 @@ required_for_references: - tiny-utf8 - tinyalsa - tinycbor +- tinycolormap - tinycthread - tinycthreadpool - tinydir @@ -1380,6 +1475,7 @@ required_for_references: - tng - toml11 - tomlplusplus +- toon - tqdm-cpp - tracy - transwarp @@ -1415,12 +1511,14 @@ required_for_references: - units - unity - univalue +- unleash-client-cpp - unordered_dense - unqlite - upx - urdfdom - urdfdom_headers - uriparser +- userspace-rcu - usockets - usrsctp - utf8.h @@ -1442,6 +1540,7 @@ required_for_references: - velodyne_decoder - veque - very-simple-smtps +- vigra - vincentlaucsb-csv-parser - vir-simd - visit_struct @@ -1474,7 +1573,9 @@ required_for_references: - whisper-cpp - wide-integer - wil +- wildcards - wildmidi +- wineditline - winflexbison - winmd - winreg @@ -1520,12 +1621,15 @@ required_for_references: - yandex-ozo - yas - yasm +- ydcpp-tcpcat - yder - yoga +- yomm2 - yyjson - z3 - zbar - zeromq +- zeus_expected - zfp - zimg - zint diff --git a/.c3i/config_v1.yml b/.c3i/config_v1.yml index a7779831e1660..117f1105d056f 100644 --- a/.c3i/config_v1.yml +++ b/.c3i/config_v1.yml @@ -3,7 +3,7 @@ id: 'conan-io/conan-center-index' conan: - version: 1.62.0 + version: 1.64.1 artifactory: url: "https://c3i.jfrog.io/c3i" @@ -36,8 +36,6 @@ tasks: # Requirements to merge a given pull-request: # * check_runs refers to notifications from GH actions # * status_checks refers to notifications coming from external tools (Jenkins, CLA,...) - check_runs: - - name: "Lint changed files (YAML files)" status_checks: - name: "license/cla" - name: "continuous-integration/jenkins/pr-merge" @@ -54,7 +52,7 @@ tasks: cci: conan_v2_run_export: false write_comments: true - detailed_status_checks: true + detailed_status_checks: false update_labels: true build_bump_deps_pr: false description_bump_deps_pr: ":vertical_traffic_light: Thank for your Bump dependencies PR. The build service will be triggered soon by a Conan team member." @@ -163,6 +161,7 @@ pod_size: large: - "duckdb" - "ceres-solver" + - "simd" xlarge: - "llvm" - "opengv" diff --git a/.c3i/config_v2.yml b/.c3i/config_v2.yml index ce873ee6cf673..7866aab966417 100644 --- a/.c3i/config_v2.yml +++ b/.c3i/config_v2.yml @@ -3,7 +3,7 @@ id: 'conan-io/conan-center-index' conan: - version: 2.0.16 + version: 2.5.0 backup_sources: upload_url: "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/" download_url: "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/" @@ -46,7 +46,7 @@ tasks: parallel_strategy: unlimited cci: conan_v2_run_export: false - detailed_status_checks: false + detailed_status_checks: true write_comments: false update_labels: false build_bump_deps_pr: false @@ -56,10 +56,12 @@ tasks: regression: "> **Regression**: Conan v2 builds are mandatory and they are required for the PR to be merged, because this recipe worked with Conan v2 previously." text_on_failure: "The v2 pipeline failed. Please, review the errors and note this is required for pull requests to be merged. In case this recipe is still not ported to Conan 2.x, please, ping `@conan-io/barbarians` on the PR and we will help you." collapse_on_success: false - collapse_on_failure: true + collapse_on_failure: false list_packages: update_yaml_list_path: ".c3i/conan_v2_ready_references" update_yaml_list_key: "required_for_references" + promote_packages: + additional_repo_target: "conan-center-v2-only" scheduled_export_check: report_issue_url: https://github.com/conan-io/conan-center-index/issues/15557 report_issue_append: false diff --git a/.c3i/reviewers.yml b/.c3i/reviewers.yml index a5e7a155eee13..e877828a1a9a3 100644 --- a/.c3i/reviewers.yml +++ b/.c3i/reviewers.yml @@ -9,21 +9,45 @@ reviewers: - user: "lasote" type: "team" request_reviews: false - - user: "jgsogo" - type: "community" - request_reviews: false - user: "czoido" type: "team" request_reviews: false - user: "memsharded" type: "team" request_reviews: false - - user: "SSE4" - type: "community" - request_reviews: false - user: "uilianries" type: "team" request_reviews: true + - user: "jcar87" + type: "team" + request_reviews: true + - user: "franramirez688" + type: "team" + request_reviews: true + - user: "AbrilRBS" + type: "team" + request_reviews: true + - user: "davidsanfal" + type: "team" + request_reviews: false + - user: "juansblanco" + type: "team" + request_reviews: false + - user: "perseoGI" + type: "team" + request_reviews: false + - user: "ErniGH" + type: "team" + request_reviews: false + ######## + ### Begin community reviewers + ######## + - user: "jgsogo" + type: "community" + request_reviews: false + - user: "SSE4" + type: "community" + request_reviews: false - user: "madebr" type: "community" request_reviews: false @@ -33,9 +57,6 @@ reviewers: - user: "theirix" type: "community" request_reviews: false - - user: "ericLemanissier" - type: "community" - request_reviews: false - user: "prince-chrismc" type: "community" request_reviews: false @@ -57,21 +78,12 @@ reviewers: - user: "MartinDelille" type: "community" request_reviews: false - - user: "jcar87" - type: "team" - request_reviews: true - - user: "franramirez688" - type: "team" - request_reviews: true - user: "paulocoutinhox" type: "community" request_reviews: false - user: "jwillikers" type: "community" request_reviews: false - - user: "RubenRBS" - type: "team" - request_reviews: true - user: "System-Arch" type: "community" request_reviews: false @@ -81,12 +93,6 @@ reviewers: - user: "StellaSmith" type: "community" request_reviews: false - - user: "davidsanfal" - type: "team" - request_reviews: false - - user: "juansblanco" - type: "team" - request_reviews: false - user: "valgur" type: "community" request_reviews: false diff --git a/.c3i/waitlist_users.yml b/.c3i/waitlist_users.yml index ead4b94c37882..0a820a622ea67 100644 --- a/.c3i/waitlist_users.yml +++ b/.c3i/waitlist_users.yml @@ -2,3 +2,5 @@ waitlist_users: - Mike-Solar - retroandchill - refactorTractor +- jjbel +- synaptics-lspintzyk diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 3f6e08d2479e9..80d0ac7cd4153 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,10 +1,15 @@ -Specify library name and version: **lib/1.0** - +### Summary +Changes to recipe: **lib/[version]** +#### Motivation + + +#### Details + ---- -- [ ] I've read the [contributing guidelines](https://github.com/conan-io/conan-center-index/blob/master/CONTRIBUTING.md). -- [ ] I've used a [recent](https://github.com/conan-io/conan/releases/latest) Conan client version close to the [currently deployed](https://github.com/conan-io/conan-center-index/blob/master/.c3i/config_v1.yml#L6). -- [ ] I've tried at least one configuration locally with the [conan-center hook](https://github.com/conan-io/hooks.git) activated. +--- +- [ ] Read the [contributing guidelines](https://github.com/conan-io/conan-center-index/blob/master/CONTRIBUTING.md) +- [ ] Checked that this PR is not a duplicate: [list of PRs by recipe](https://github.com/conan-io/conan-center-index/discussions/24240) +- [ ] Tested locally with at least one configuration using a recent version of Conan diff --git a/.github/actions/alert-community/action.yml b/.github/actions/alert-community/action.yml deleted file mode 100644 index ca390cd38b4e7..0000000000000 --- a/.github/actions/alert-community/action.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: "Alert Community" -description: "Comment on pull request if certain files changes" -author: "prince-chrismc" -inputs: - files: - description: "Check for changes using only this list of files (Defaults to the entire repo)" - required: true - default: "" - reviewers: - description: "List of users to mention (make sure to include the @)" - required: true - default: "" - -runs: - using: "composite" - steps: - # Assume the repo checked out the code since this is running - - uses: ./.github/actions/pr_changed_files - id: changed_files - with: - files: ${{ inputs.files }} - - if: always() && steps.changed_files.outputs.any_changed == 'true' - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `:robot: **Beep Boop**! This pull request is making changes to '${{ inputs.files }}'.\n\n:wave: ${{ inputs.reviewers }} you might be interested. :wink:` - }) diff --git a/.github/workflows/alert-community.yml b/.github/workflows/alert-community.yml deleted file mode 100644 index a12c503bcd8f0..0000000000000 --- a/.github/workflows/alert-community.yml +++ /dev/null @@ -1,462 +0,0 @@ -name: "[service] Alert Community" - -on: - pull_request_target: - types: [opened] - -env: - PYVER: "3.10" - -jobs: - comment: - if: github.repository == 'conan-io/conan-center-index' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: master - - - uses: ./.github/actions/alert-community - with: - files: "docs/*/*" - reviewers: "@prince-chrismc @MartinDelille @Croydon" - - - uses: ./.github/actions/alert-community - with: - files: ".github/*/*" - reviewers: "@ericLemanissier @Croydon" - - - uses: ./.github/actions/alert-community - with: - files: "linter/*/*" - reviewers: "@ericLemanissier @Croydon" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/aaf/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/abseil/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/armadillo/*/*" - reviewers: "@samuel-emrys" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/avahi/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/b2/*/*" - reviewers: "@grafikrobot" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/bandit/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/benchmark/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/boost/*/*" - reviewers: "@grafikrobot @Hopobcn @jwillikers @paulharris" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/boost-ext-ut/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/bzip2/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/cereal/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/cmake/*/*" - reviewers: "@Croydon" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/cppcheck/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/create-dmg/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/dbus/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/double-conversion/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/eigen/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/elfio/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/ffmpeg/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/fmt/*/*" - reviewers: "@Hopobcn @jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/folly/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/foxi/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/fp16/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/g3log/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/gcc/*/*" - reviewers: "@samuel-emrys" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/geotrans/*/*" - reviewers: "@samuel-emrys" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/gflags/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/glew/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/glfw/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/glog/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/gtest/*/*" - reviewers: "@Hopobcn @jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/imath/*/*" - reviewers: "@irieger" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/imgui/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/implot/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/jemalloc/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libalsa/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libarchive/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libbacktrace/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libcap/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libcurl/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libdwarf/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libelf/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libevent/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libffi/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libiberty/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libiconv/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libltc/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libpng/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libraw/*/*" - reviewers: "@irieger" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libsodium/*/*" - reviewers: "@Hopobcn @paulharris" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libspatialite/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libunwind/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libuuid/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libxml2/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/llvm-core/*/*" - reviewers: "@Hopobcn @paulharris" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/lyra/*/*" - reviewers: "@grafikrobot" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/lz4/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/ms-gsl/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/nlohmann_json/*/*" - reviewers: "@Hopobcn @jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/onnx/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/openapi-generator/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/opencolorio/*/*" - reviewers: "@irieger" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/openexr/*/*" - reviewers: "@irieger" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/opengl/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/opengl-registry/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/openimageio/*/*" - reviewers: "@irieger" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/openssl/*/*" - reviewers: "@Hopobcn @Croydon" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/protobuf/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/psimd/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/qt/*/*" - reviewers: "@ericLemanissier @jwillikers @MartinDelille @paulharris" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/quazip/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/rtmidi/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/sentry-*/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/shapelib/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - 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/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/wayland/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/wayland-protocols/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/xkbcommon/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/xorg/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/yaml-cpp/*/*" - reviewers: "@jwillikers @MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/xz_utils/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/zlib/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/zstd/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libhal/*/*" - reviewers: "@kammce" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e24832e93e98..e947909b42988 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ To contribute follow the next steps: got everything working or even if you need help. Add the text to the issue body (besides other comments): "fixes #IssueNumber" in the body of the PR, referring to the issue of step 1. -The Conan Community works hard to review all the pull requests and provided assistance where need. +The Conan Community works hard to review all the pull requests and provide assistance where need. The [Review Process](docs/review_process.md) is partially automated with the help of @conan-center-index-bot :rocket: ## Issues diff --git a/README.md b/README.md index 3206926309aed..61da8cef3d1e9 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ You can open issues in the [issue tracker](https://github.com/conan-io/conan-cen - Specify the name and version (`zlib/1.2.11`) and any relevant details about the fail configuration: Applied profile, building machine... * :bulb: Request a **new library** to be added: - - Use the `[request]` label to search the library in the issue tracker in case the it was already requested. + - Use the `[request]` label to search the library in the issue tracker in case it was already requested. - If not, use the same `[request]` tag in the title of the issue to help identifying them. - Indicate the name and the version of the library you would like to have in the repository. Also links to the project's website, source download/repository and in general any relevant information that helps creating a recipe for it. diff --git a/docs/adding_packages/dependencies.md b/docs/adding_packages/dependencies.md index 80a83e5335fbf..f10a35809ada3 100644 --- a/docs/adding_packages/dependencies.md +++ b/docs/adding_packages/dependencies.md @@ -178,14 +178,20 @@ for consumer, we do impose some limits on Conan features to provide a smoother f Version ranges are a useful Conan feature, [documentation here](https://docs.conan.io/2/tutorial/versioning/version_ranges.html). With the introduction of Conan 2.0, we are currently working to allow the use of version ranges and are allowing this for a handful of dependencies. -Currently, these are: +Currently, these are (except if the recipe needs a newer lower/upper version bound for specific reasons): * OpenSSL: `[>=1.1 <4]` for libraries known to be compatible with OpenSSL 1.x and 3.x * CMake: `[>3.XX <4]`, where `3.XX` is the minimum version of CMake required by the relevant build scripts. Note that CCI recipes assume 3.15 is installed in the system, so add this version range only when a requirement for a newer version is needed. -* Libcurl: `[>=X.YY <9]`, where `X.YY` is the minimum version of Libcurl required, starting from `7.78` -* Zlib: `[>=1.2.11 <2]` expect if the recipe needs a newer lower version for specific reasons -* Libpng: `[>=1.6 <2]` expect if the recipe needs a newer lower version for specific reasons +* Libcurl: `[>=7.78 <9]` +* Zlib: `[>=1.2.11 <2]` +* Libpng: `[>=1.6 <2]` +* Expat: `[>=2.6.2 <3]` +* Libxml2: `[>=2.12.5 <3]` +* Libuv: `[>=1 <2]` +* qt5: `[~5.15]`, if your library depends on qt5, only the 5.15 minor version is allowed +* qt6: `[>=6.x <7]`, where 6.x is the lower bound of your needed qt6 version +* c-ares: `[>=1.27 <2]` > **Warning**: With Conan 1.x, [version ranges](https://docs.conan.io/1/versioning/version_ranges.html) adhere to a much more strict sematic version spec, > OpenSSL 1.1.x does not follow this so the client will not resolve to that range and will pick a 3.x version. In order to select a lower version you diff --git a/docs/changelog.md b/docs/changelog.md index 2e9e9d20de17f..97b4bcc886c5c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,20 @@ # Changelog +### 10-Jul-2024 - 13:22 CEST + +- [feature] Add support for Conan 2.5.0 in the CI +- [fix] Invalid configuration from tool requirement in Conan 1.x + +### 22-May-2024 - 12:04 CEST + +- [feature] Add support for Conan 2.3.1 in the CI +- [feature] Add support for Conan 1.64.1 in the CI + +### 03-April-2024 - 13:53 CEST + +- [feature] Add support for Conan 2.2.2 in the CI +- [feature] Add support for Conan 1.63.0 in the CI + ### 20-March-2024 - 11:13 CET - [fix] Changing Version Ranges in dependencies is now bump dependencies diff --git a/docs/community_resources.md b/docs/community_resources.md index 06aa0558a52f3..4600ca89ac451 100644 --- a/docs/community_resources.md +++ b/docs/community_resources.md @@ -19,19 +19,12 @@ If you are looking to stay up to date with the last Conan news, follow us on Twi - [Updatable Recipes](https://github.com/qchateau/conan-center-bot): Automatically scans available recipes and checked for new upstream releases and tests one configuration - The results can be found here: https://qchateau.github.io/conan-center-bot/#/updatable -- [Conflicting Pull Requests](https://github.com/ericLemanissier/conan-center-conflicting-prs): Checks all the open pull requests for those which edit the same -recipe files and posts a message. - - The results can be found here: https://ericlemanissier.github.io/conan-center-conflicting-prs/ - [Pending Review](https://github.com/prince-chrismc/conan-center-index-pending-review) - The results can be found here: https://prince-chrismc.github.io/conan-center-index-pending-review/ -- [Pull Request In Progress Status](https://ericlemanissier.github.io/conan-center-pr-status/in_progress_jobs) - [System Package Checks](https://github.com/bincrafters/system-packages-checks): Builds automatically all `system` versions of recipes merged on CCI and being pull requested on a selection of Linux distributions and FreeBSD - The results can be found here: https://bincrafters.github.io/system-packages-checks/ ## Tools -- [FreeBSD Testing](https://github.com/ericLemanissier/conan-center-index/tree/freebsd): Detects pull requests with `FreeBSD` in the description and runs a test for -one configuration on that platform - - The results can be found here: https://github.com/ericLemanissier/conan-center-index/actions?query=workflow%3ACI - [Bincrafters Conventions](https://github.com/bincrafters/bincrafters-conventions): Automatically updates Conan recipes to the latest conventions and rules diff --git a/docs/consuming_recipes.md b/docs/consuming_recipes.md index a777e97d08e79..c7f4c917b6788 100644 --- a/docs/consuming_recipes.md +++ b/docs/consuming_recipes.md @@ -51,7 +51,7 @@ Using your own ArtifactoryCE instance is easy. You can [deploy it on-premise](ht [use only this remote](https://docs.conan.io/1/reference/commands/misc/remote.html?highlight=add%20new) and new recipe revisions are only pushed to your Artifactory after they have been validated in your project. -The minimum solution, if still choosing to rely on ConanCenter directly, involves small changes to your client configuration by pinning the revision of every reference you consume in your project using using: +The minimum solution, if still choosing to rely on ConanCenter directly, involves small changes to your client configuration by pinning the revision of every reference you consume in your project using the following: - [recipe revision (RREV)](https://docs.conan.io/1/versioning/revisions.html) can be added to each requirement. Instead of `fmt/9.1.0` you can add a pound (or hashtag) to the end followed by the revision `fmt/9.1.0#c93359fba9fd21359d8db6f875d8a233`. diff --git a/docs/developing_recipes_locally.md b/docs/developing_recipes_locally.md index 2d101facc3b5e..6a82d992574ed 100644 --- a/docs/developing_recipes_locally.md +++ b/docs/developing_recipes_locally.md @@ -76,12 +76,12 @@ We recommend working from the `recipes/project` folder itself. You can learn abo > **Note**: You can only change one recipe per pull request, and working from the [_recipe folder_](adding_packages/README.md#the-recipe-folder-conanfilepy) will help prevent making a few mistakes. The default for this folder is `all`, follow the link above to learn more. -The [entire workflow of a recipe](https://docs.conan.io/1/developing_packages/package_dev_flow.html) can be execute with the [`conan create`](https://docs.conan.io/1/reference/commands/creator/create.html). This should look like: +The [entire workflow of a recipe](https://docs.conan.io/1/developing_packages/package_dev_flow.html) can be executed with the [`conan create`](https://docs.conan.io/1/reference/commands/creator/create.html). This should look like: * `conan create all/conanfile.py 0.0.0@ -pr:b=default -pr:h=default` ConanCenter also has a few [support settings and options](supported_platforms_and_configurations.md) which highly recommend to test. For example -`conan create all/conanfile.py 0.0.0@ -o project:shared=True -s build_type=Debug` is a easy way to test more configurations ensuring the package is correct. +`conan create all/conanfile.py 0.0.0@ -o project:shared=True -s build_type=Debug` is an easy way to test more configurations ensuring the package is correct. ### Try it yourself @@ -165,7 +165,7 @@ schema validation. There's are to encourage the best possible quality of recipes ### Yamlschema * (Recommended) Use a dedicated Python virtualenv. -* Ensure you have required tools installed: `strictyaml` and `argparse` (better to uses fixed versions) +* Ensure you have required tools installed: `strictyaml` and `argparse` (better to use fixed versions) ```sh pip install strictyaml==1.16 argparse==1.4 diff --git a/docs/faqs.md b/docs/faqs.md index b463fc96e8c9b..a1714a7a2b37b 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -453,6 +453,8 @@ and does not install libraries with the boost prefix. Yes, but make sure it does not have Boost in the name. Use the [`author-name` convention](https://github.com/conan-io/conan-center-index/blob/master/docs/faqs.md#what-is-the-policy-on-recipe-name-collisions) so there are no conflicts. In addition to follow the rules outlined above. +**NOTE**: In case you have no intention to submit to Boost, then you can use the project name as is (e.g `boost-foobar`). + ## Can I add options that do not affect `package_id` or the package contents Generally no, these sorts of options can most likely be set from a profile or downstream recipes. However if the project supports this option from its build script diff --git a/docs/package_templates/autotools_package/all/conanfile.py b/docs/package_templates/autotools_package/all/conanfile.py index 0d8464ec8e6f0..2bd1c8b1bd5e9 100644 --- a/docs/package_templates/autotools_package/all/conanfile.py +++ b/docs/package_templates/autotools_package/all/conanfile.py @@ -132,7 +132,7 @@ def generate(self): # --enable/disable-shared is automatically managed when 'shared' option is declared tc = AutotoolsToolchain(self) # autotools usually uses 'yes' and 'no' to enable/disable options - yes_no = lambda v: "yes" if v else "no" + def yes_no(v): return "yes" if v else "no" tc.configure_args.extend([ f"--with-foobar={yes_no(self.options.with_foobar)}", "--enable-tools=no", diff --git a/docs/supported_platforms_and_configurations.md b/docs/supported_platforms_and_configurations.md index 156a1c5f868d7..6b1a32e9557cc 100644 --- a/docs/supported_platforms_and_configurations.md +++ b/docs/supported_platforms_and_configurations.md @@ -58,8 +58,8 @@ For more information see [conan-io/conan-docker-tools](https://github.com/conan- ## Linux -- Python: 3.7.13 -- CMake: 3.15.7, 3.18.2 (same version expected after all use [new docker images](https://github.com/conan-io/conan-docker-tools/tree/master/modern)) +- Python: 3.7.17 +- CMake: 3.15.7, 3.18.6 (same version expected after all use [new docker images](https://github.com/conan-io/conan-docker-tools/tree/master/modern)) - Compilers: - GCC versions: 5, 7, 9, 11 - Clang versions: 13 diff --git a/linter/conandata_yaml_linter.py b/linter/conandata_yaml_linter.py index 51d27b850beec..a946b4b5f2ecd 100644 --- a/linter/conandata_yaml_linter.py +++ b/linter/conandata_yaml_linter.py @@ -1,7 +1,7 @@ import argparse from strictyaml import ( - load, - Map, + dirty_load, + MapCombined, Str, YAMLValidationError, MapPattern, @@ -28,30 +28,34 @@ def main(): ) args = parser.parse_args() - patch_fields = Map( + patch_fields = MapCombined( { "patch_file": Str(), "patch_description": Str(), - "patch_type": Enum( + Optional("patch_type"): Enum( ["official", "conan", "portability", "bugfix", "vulnerability"] ), Optional("patch_source"): Str(), # No longer required for v2 recipes with layouts Optional("base_path"): Str(), - } + }, + Str(), + Any() ) - schema = Map( + schema = MapCombined( { "sources": MapPattern(Str(), Any(), minimum_keys=1), Optional("patches"): MapPattern(Str(), Seq(Any()), minimum_keys=1), - } + }, + Str(), + Any(), ) with open(args.path, encoding="utf-8") as f: content = f.read() try: - parsed = load(content, schema) + parsed = dirty_load(content, schema, allow_flow_style=True) except YAMLValidationError as error: pretty_print_yaml_validate_error(args, error) # Error when "source" is missing or when "patches" has no versions return @@ -78,19 +82,6 @@ def main(): pretty_print_yaml_validate_warning(args, error) # Warning when patch fields are not followed continue - # Make sure `patch_source` exists where it's encouraged - type = parsed["patches"][version][i]["patch_type"] - if ( - type in ["official", "bugfix", "vulnerability"] - and not "patch_source" in patch - ): - print( - f"::warning file={args.path},line={type.start_line},endline={type.end_line}," - f"title=conandata.yml schema warning" - f"::'patch_type' should have 'patch_source' as per {CONANDATA_YAML_URL}#patch_type" - " it is expected to have a source (e.g. a URL) to where it originates from to help with" - " reviewing and consumers to evaluate patches" - ) def pretty_print_yaml_validate_error(args, error): diff --git a/linter/yamllint_rules.yml b/linter/yamllint_rules.yml index 7c0ce102ddc36..73ceb7e5ad923 100644 --- a/linter/yamllint_rules.yml +++ b/linter/yamllint_rules.yml @@ -1,25 +1,22 @@ extends: default rules: + colons: disable document-start: level: error present: false document-end: level: error present: false + empty-lines: disable empty-values: forbid-in-block-mappings: true forbid-in-flow-mappings: true line-length: disable - indentation: - level: error - new-line-at-end-of-file: - level: error - trailing-spaces: - level: error - comments: - level: error - comments-indentation: - level: error + indentation: disable + new-line-at-end-of-file: disable + trailing-spaces: disable + comments: disable + comments-indentation: disable new-lines: type: unix key-duplicates: diff --git a/recipes/7bitdi/all/conandata.yml b/recipes/7bitdi/all/conandata.yml index 22d7e84c10e0a..46ec1df1a2623 100644 --- a/recipes/7bitdi/all/conandata.yml +++ b/recipes/7bitdi/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "3.3.0": + url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.3.0.tar.gz" + sha256: "b9ddb2fc263c79cb414544e97d44dcc8cd1e1a91b38129d96b7051728a4583b9" + "3.2.0": + url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.2.0.tar.gz" + sha256: "4549b651a28b309a31cb3b879b7f31069cbca041cfb9ffad82ccc26f78b8e5e0" + "3.1.0": + url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.1.0.tar.gz" + sha256: "345bf91e2a33cfe98628cac98c75488ddd55232b8c4bcfeba9b5001fec8d4f7c" + "3.0.0": + url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.0.0.tar.gz" + sha256: "aabb8e907c0cafb8e4b7c8367ed5dbb3cba2d83af090bdef9a7f855c0778c8f3" "2.1.0": url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v2.1.0.tar.gz" sha256: "54edceb4f90bf652126310ca0b78150d05a02d7081cef3c9ccaba5f4dd112935" diff --git a/recipes/7bitdi/all/conanfile.py b/recipes/7bitdi/all/conanfile.py index 3bdbdc03629c3..9a614d07b3d74 100644 --- a/recipes/7bitdi/all/conanfile.py +++ b/recipes/7bitdi/all/conanfile.py @@ -8,14 +8,13 @@ required_conan_version = ">=1.53.0" - class SevenBitDIConan(ConanFile): name = "7bitdi" + description = "a simple C++ dependency injection library." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/7bitcoder/7bitDI" - description = "7bitDI is a simple C++ dependency injection library." topics = ("cpp17", "dependency-injector", "injector", "header-only") - url = "https://github.com/conan-io/conan-center-index" - license = "MIT" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -29,6 +28,10 @@ class SevenBitDIConan(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return 17 + @property def _minimum_compilers_version(self): return { @@ -61,12 +64,11 @@ def validate(self): compiler_name = str(compiler) if compiler.get_safe("cppstd"): - check_min_cppstd(self, 17) - + check_min_cppstd(self, self._min_cppstd) minimum_version = self._minimum_compilers_version.get(compiler_name, False) if minimum_version and Version(compiler.version) < minimum_version: raise ConanInvalidConfiguration( - f"Requires compiler {compiler_name} minimum version: {minimum_version} with C++17 support." + f"{self.ref} requires compiler {compiler_name} minimum version: {minimum_version} with C++{self._min_cppstd} support." ) def source(self): diff --git a/recipes/7bitdi/config.yml b/recipes/7bitdi/config.yml index 4a1d176d1dc7e..37a63b9d3b41b 100644 --- a/recipes/7bitdi/config.yml +++ b/recipes/7bitdi/config.yml @@ -1,4 +1,12 @@ versions: + "3.3.0": + folder: all + "3.2.0": + folder: all + "3.1.0": + folder: all + "3.0.0": + folder: all "2.1.0": folder: all "2.0.0": diff --git a/recipes/7zip/19.00/conanfile.py b/recipes/7zip/19.00/conanfile.py deleted file mode 100644 index b1fa099b52650..0000000000000 --- a/recipes/7zip/19.00/conanfile.py +++ /dev/null @@ -1,121 +0,0 @@ -from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.files import copy, chdir, download, get, 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, NMakeToolchain -from conan.tools.scm import Version - -import os - -required_conan_version = ">=1.55.0" - - -class SevenZipConan(ConanFile): - name = "7zip" - url = "https://github.com/conan-io/conan-center-index" - description = "7-Zip is a file archiver with a high compression ratio" - license = ("LGPL-2.1-or-later", "BSD-3-Clause", "Unrar") - homepage = "https://www.7-zip.org" - topics = ("archive", "compression", "decompression", "zip") - package_type = "application" - settings = "os", "arch", "compiler", "build_type" - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - def validate(self): - if self.settings.os != "Windows": - raise ConanInvalidConfiguration("Only Windows supported") - if self.settings.arch not in ("x86", "x86_64"): - raise ConanInvalidConfiguration("Unsupported architecture") - - def layout(self): - basic_layout(self, src_folder="src") - - def build_requirements(self): - if Version(self.version) < "22": - self.build_requires("lzma_sdk/9.20") - - if not is_msvc(self) and self._settings_build.os == "Windows" and "make" not in os.environ.get("CONAN_MAKE_PROGRAM", ""): - self.build_requires("make/4.3") - - def package_id(self): - del self.info.settings.build_type - del self.info.settings.compiler - - def source(self): - if Version(self.version) < "22": - item = self.conan_data["sources"][self.version] - filename = "7z-source.7z" - download(self, **item, filename=filename) - sevenzip = os.path.join(self.dependencies.build["lzma_sdk"].package_folder, "bin", "7zr.exe") - self.run(f"{sevenzip} x {filename}") - os.unlink(filename) - else: - get(self, **self.conan_data["sources"][self.version]) - - def generate(self): - if is_msvc(self): - tc = NMakeToolchain(self) - tc.generate() - else: - tc = AutotoolsToolchain(self) - if self.settings.os == "Windows" and self.settings.compiler == "gcc": - tc.environment().define("IS_MINGW", "1") - tc.generate() - deps = AutotoolsDeps(self) - deps.generate() - - @property - def _msvc_platform(self): - return { - "x86_64": "x64", - "x86": "x86", - }[str(self.settings.arch)] - - def _build_msvc(self): - self.run(f"nmake /f makefile PLATFORM={self._msvc_platform}", cwd=os.path.join(self.source_folder, "CPP", "7zip")) - - def _build_autotools(self): - # TODO: Enable non-Windows methods in configure - autotools = Autotools(self) - with chdir(self, os.path.join(self.source_folder, "CPP", "7zip", "Bundles", "LzmaCon")): - autotools.make(args=["-f", "makefile.gcc"], target="all") - - def _patch_sources(self): - if is_msvc(self): - fn = os.path.join(self.source_folder, "CPP", "Build.mak") - os.chmod(fn, 0o644) - replace_in_file(self, fn, "-MT", f"-{self.settings.compiler.runtime}") - replace_in_file(self, fn, "-MD", f"-{self.settings.compiler.runtime}") - if self.version < Version("23.01"): - replace_in_file(self, fn, "-WX", "") - - pfc = os.path.join(self.source_folder, "CPP", "7zip", "UI", "FileManager", "PanelFolderChange.cpp") - os.chmod(pfc, 0o644) - replace_in_file(self, pfc, r'L"\\"', r'static_cast(L"\\")') - - def build(self): - self._patch_sources() - if is_msvc(self): - self._build_msvc() - else: - self._build_autotools() - - def package(self): - copy(self, "License.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "DOC")) - copy(self, "unRarLicense.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "DOC")) - if self.settings.os == "Windows": - copy(self, "*.exe", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self.source_folder, "CPP", "7zip"), keep_path=False) - copy(self, "*.dll", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self.source_folder, "CPP", "7zip"), keep_path=False) - # TODO: Package the libraries: binaries and headers (add the rest of settings) - - def package_info(self): - bin_path = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {bin_path}") - self.env_info.path.append(bin_path) - - self.cpp_info.includedirs = [] - self.cpp_info.libdirs = [] diff --git a/recipes/7zip/19.00/conandata.yml b/recipes/7zip/all/conandata.yml similarity index 100% rename from recipes/7zip/19.00/conandata.yml rename to recipes/7zip/all/conandata.yml diff --git a/recipes/7zip/all/conanfile.py b/recipes/7zip/all/conanfile.py new file mode 100644 index 0000000000000..91093cc791c52 --- /dev/null +++ b/recipes/7zip/all/conanfile.py @@ -0,0 +1,123 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, chdir, download, get, 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, NMakeToolchain +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.55.0" + + +class SevenZipConan(ConanFile): + name = "7zip" + url = "https://github.com/conan-io/conan-center-index" + description = "7-Zip is a file archiver with a high compression ratio" + license = ("LGPL-2.1-or-later", "BSD-3-Clause", "Unrar") + homepage = "https://www.7-zip.org" + topics = ("archive", "compression", "decompression", "zip") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def validate(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("Only Windows supported") + if self.settings.arch not in ("x86", "x86_64"): + raise ConanInvalidConfiguration("Unsupported architecture") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + if Version(self.version) < "22": + self.build_requires("lzma_sdk/9.20") + + if not is_msvc(self) and self._settings_build.os == "Windows" and "make" not in os.environ.get("CONAN_MAKE_PROGRAM", ""): + self.build_requires("make/4.3") + + def package_id(self): + del self.info.settings.build_type + del self.info.settings.compiler + + def source(self): + if Version(self.version) < "22": + item = self.conan_data["sources"][self.version] + filename = "7z-source.7z" + download(self, **item, filename=filename) + sevenzip = os.path.join(self.dependencies.build["lzma_sdk"].package_folder, "bin", "7zr.exe") + self.run(f"{sevenzip} x {filename}") + os.unlink(filename) + else: + get(self, **self.conan_data["sources"][self.version]) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + env = None + if self.settings.os == "Windows" and self.settings.compiler == "gcc": + env = tc.environment() + env.define("IS_MINGW", "1") + tc.generate(env=env) + deps = AutotoolsDeps(self) + deps.generate() + + @property + def _msvc_platform(self): + return { + "x86_64": "x64", + "x86": "x86", + }[str(self.settings.arch)] + + def _build_msvc(self): + self.run(f"nmake /f makefile PLATFORM={self._msvc_platform}", cwd=os.path.join(self.source_folder, "CPP", "7zip")) + + def _build_autotools(self): + # TODO: Enable non-Windows methods in configure + autotools = Autotools(self) + with chdir(self, os.path.join(self.source_folder, "CPP", "7zip", "Bundles", "LzmaCon")): + autotools.make(args=["-f", "makefile.gcc"], target="all") + + def _patch_sources(self): + if is_msvc(self): + fn = os.path.join(self.source_folder, "CPP", "Build.mak") + os.chmod(fn, 0o644) + replace_in_file(self, fn, "-MT", f"-{self.settings.compiler.runtime}") + replace_in_file(self, fn, "-MD", f"-{self.settings.compiler.runtime}") + if self.version < Version("23.01"): + replace_in_file(self, fn, "-WX", "") + + pfc = os.path.join(self.source_folder, "CPP", "7zip", "UI", "FileManager", "PanelFolderChange.cpp") + os.chmod(pfc, 0o644) + replace_in_file(self, pfc, r'L"\\"', r'static_cast(L"\\")') + + def build(self): + self._patch_sources() + if is_msvc(self): + self._build_msvc() + else: + self._build_autotools() + + def package(self): + copy(self, "License.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "DOC")) + copy(self, "unRarLicense.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "DOC")) + if self.settings.os == "Windows": + copy(self, "*.exe", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self.source_folder, "CPP", "7zip"), keep_path=False) + copy(self, "*.dll", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self.source_folder, "CPP", "7zip"), keep_path=False) + # TODO: Package the libraries: binaries and headers (add the rest of settings) + + def package_info(self): + bin_path = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bin_path}") + self.env_info.path.append(bin_path) + + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/7zip/19.00/test_package/conanfile.py b/recipes/7zip/all/test_package/conanfile.py similarity index 100% rename from recipes/7zip/19.00/test_package/conanfile.py rename to recipes/7zip/all/test_package/conanfile.py diff --git a/recipes/7zip/19.00/test_v1_package/conanfile.py b/recipes/7zip/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/7zip/19.00/test_v1_package/conanfile.py rename to recipes/7zip/all/test_v1_package/conanfile.py diff --git a/recipes/7zip/config.yml b/recipes/7zip/config.yml index 5f2a8f313a5d8..9e03b0cc48e12 100644 --- a/recipes/7zip/config.yml +++ b/recipes/7zip/config.yml @@ -1,7 +1,7 @@ versions: "23.01": - folder: "19.00" + folder: "all" "22.01": - folder: "19.00" + folder: "all" "19.00": - folder: "19.00" + folder: "all" diff --git a/recipes/aaf/all/conanfile.py b/recipes/aaf/all/conanfile.py index ee7906ff05936..471ea8132e2ce 100644 --- a/recipes/aaf/all/conanfile.py +++ b/recipes/aaf/all/conanfile.py @@ -35,7 +35,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") self.requires("libjpeg/9e") if self.settings.os in ("FreeBSD", "Linux"): self.requires("util-linux-libuuid/2.39") diff --git a/recipes/abseil/all/conandata.yml b/recipes/abseil/all/conandata.yml index c6bc5198c7de0..b213e4b527e01 100644 --- a/recipes/abseil/all/conandata.yml +++ b/recipes/abseil/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "20240116.2": + url: "https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz" + sha256: "733726b8c3a6d39a4120d7e45ea8b41a434cdacde401cba500f14236c49b39dc" "20240116.1": url: "https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz" sha256: "3c743204df78366ad2eaf236d6631d83f6bc928d1705dd0000b872e53b73dc6a" @@ -15,6 +18,19 @@ sources: url: "https://github.com/abseil/abseil-cpp/archive/20211102.0.tar.gz" sha256: "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4" patches: + "20240116.2": + - patch_file: "patches/0003-absl-string-libm-20240116.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/issues/1100" + - patch_file: "patches/20240116.1-0001-fix-filesystem-include.patch" + patch_description: "Fix GCC 7 including in C++17 mode when it is not available (until GCC 8)" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303" + - patch_file: "patches/0004-test-allocator-testonly.patch" + patch_description: "Do not build test_allocator target when tests are disabled" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5" "20240116.1": - patch_file: "patches/0003-absl-string-libm-20240116.patch" patch_description: "link libm to absl string" @@ -24,6 +40,10 @@ patches: patch_description: "Fix GCC 7 including in C++17 mode when it is not available (until GCC 8)" patch_type: "portability" patch_source: "https://github.com/abseil/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303" + - patch_file: "patches/0004-test-allocator-testonly.patch" + patch_description: "Do not build test_allocator target when tests are disabled" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5" "20230802.1": - patch_file: "patches/0003-absl-string-libm-20230802.patch" patch_description: "link libm to absl string" diff --git a/recipes/abseil/all/conanfile.py b/recipes/abseil/all/conanfile.py index bcfa3c446e426..6c10812e38452 100644 --- a/recipes/abseil/all/conanfile.py +++ b/recipes/abseil/all/conanfile.py @@ -70,9 +70,9 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if self.options.shared and is_msvc(self): + if self.options.shared and is_msvc(self) and Version(self.version) < "20230802.1": # upstream tries its best to export symbols, but it's broken for the moment - raise ConanInvalidConfiguration(f"{self.ref} shared not availabe for Visual Studio (yet)") + raise ConanInvalidConfiguration(f"{self.ref} shared not availabe for Visual Studio, please use version 20230802.1 or newer") def layout(self): cmake_layout(self, src_folder="src") @@ -161,7 +161,7 @@ def _load_components_from_cmake_target_file(self, absl_target_file_path): if cmake_function_name == "add_library": cmake_imported_target_type = cmake_function_args[1] if cmake_imported_target_type in ["STATIC", "SHARED"]: - components[potential_lib_name]["libs"] = [potential_lib_name] if cmake_target_nonamespace != "abseil_dll" else [] + components[potential_lib_name]["libs"] = [potential_lib_name] if cmake_target_nonamespace != "abseil_dll" else ['abseil_dll'] elif cmake_function_name == "set_target_properties": target_properties = re.findall(r"(?PINTERFACE_COMPILE_DEFINITIONS|INTERFACE_INCLUDE_DIRECTORIES|INTERFACE_LINK_LIBRARIES)[\n|\s]+(?P.+)", cmake_function_args[2]) for target_property in target_properties: diff --git a/recipes/abseil/all/patches/0004-test-allocator-testonly.patch b/recipes/abseil/all/patches/0004-test-allocator-testonly.patch new file mode 100644 index 0000000000000..909c1f791c488 --- /dev/null +++ b/recipes/abseil/all/patches/0004-test-allocator-testonly.patch @@ -0,0 +1,10 @@ +--- a/absl/container/CMakeLists.txt ++++ b/absl/container/CMakeLists.txt +@@ -213,6 +213,7 @@ absl_cc_library( + DEPS + absl::config + GTest::gmock ++ TESTONLY + ) + + absl_cc_test( diff --git a/recipes/abseil/config.yml b/recipes/abseil/config.yml index 4db2fe8f16b71..0af2b7beb4451 100644 --- a/recipes/abseil/config.yml +++ b/recipes/abseil/config.yml @@ -1,4 +1,6 @@ versions: + "20240116.2": + folder: all "20240116.1": folder: all "20230802.1": diff --git a/recipes/ada/all/conandata.yml b/recipes/ada/all/conandata.yml index 8588363204f2a..4302d6278da6c 100644 --- a/recipes/ada/all/conandata.yml +++ b/recipes/ada/all/conandata.yml @@ -1,43 +1,16 @@ sources: - "2.7.7": - url: "https://github.com/ada-url/ada/archive/v2.7.7.tar.gz" - sha256: "7116d86a80b79886efbc9d946d3919801815060ae62daf78de68c508552af554" - "2.7.5": - url: "https://github.com/ada-url/ada/archive/v2.7.5.tar.gz" - sha256: "25a5d62fdd4950dbef785db5725675c15f3df2cf899a4a920449fe9a05fc6d00" - "2.7.4": - url: "https://github.com/ada-url/ada/archive/v2.7.4.tar.gz" - sha256: "897942ba8c99153f916c25698a49604022f3e54441cfa9b76f657ad15b6ca041" - "2.7.3": - url: "https://github.com/ada-url/ada/archive/v2.7.3.tar.gz" - sha256: "8e222d536d237269488f7d454544eedf12847f47b3d42651e8c9963c3fb0cf5e" - "2.7.2": - url: "https://github.com/ada-url/ada/archive/v2.7.2.tar.gz" - sha256: "4dea9dd6a46695547da2dac3dc7254d32187cd35d3170179c0cdc0900090c025" - "2.7.0": - url: "https://github.com/ada-url/ada/archive/v2.7.0.tar.gz" - sha256: "08646b8a41cd6367b282aab2c87c82e5ce4876078a0cbe0799af7e51e4358591" + "2.9.0": + url: "https://github.com/ada-url/ada/archive/v2.9.0.tar.gz" + sha256: "8b992f0ce9134cb4eafb74b164d2ce2cb3af1900902162713b0e0c5ab0b6acd8" + "2.8.0": + url: "https://github.com/ada-url/ada/archive/v2.8.0.tar.gz" + sha256: "83b77fb53d1a9eea22b1484472cea0215c50478c9ea2b4b44b0ba3b52e07c139" + "2.7.8": + url: "https://github.com/ada-url/ada/archive/v2.7.8.tar.gz" + sha256: "8de067b7cb3da1808bf5439279aee6048d761ba246bf8a854c2af73b16b41c75" "2.6.10": url: "https://github.com/ada-url/ada/archive/v2.6.10.tar.gz" sha256: "a43e1ea0bcdd7585edf538afffe1fc3303b936752e18bac545fa11729de088bc" - "2.6.7": - url: "https://github.com/ada-url/ada/archive/v2.6.7.tar.gz" - sha256: "882a0aa6e19174b60b2fa00ee75d35a31ecd5158fb97d0e4e719ba21bb07acb9" - "2.6.4": - url: "https://github.com/ada-url/ada/archive/v2.6.4.tar.gz" - sha256: "5b488e9a7a700de5d40a749c96c4339bcc9c425e5f5406a0887b13e70bd90907" - "2.6.2": - url: "https://github.com/ada-url/ada/archive/v2.6.2.tar.gz" - sha256: "425b8696a28a22d19ee7aa4516c26fc8ae3ab574870a9a74ef58ba8a345b822e" - "2.6.0": - url: "https://github.com/ada-url/ada/archive/v2.6.0.tar.gz" - sha256: "09551bfbd92853e59d731e5f44a88a690425fd2906977ad03a6a1059615a02a5" "2.5.1": url: "https://github.com/ada-url/ada/archive/v2.5.1.tar.gz" sha256: "a7591d771822c3f16e6665311b0c6b4de7dd7615333183f35d89c7573be7f7fa" - "2.5.0": - url: "https://github.com/ada-url/ada/archive/v2.5.0.tar.gz" - sha256: "bf11c9d0cc1ee9e377080bdd8a3b8a8bf736ac7acaedcae882587e21b3e5625c" - "2.4.2": - url: "https://github.com/ada-url/ada/archive/v2.4.2.tar.gz" - sha256: "d865ab8828c14fc1e2217ca9f5d7918d50775175b2873faf2fbda0085e0623d2" diff --git a/recipes/ada/config.yml b/recipes/ada/config.yml index 2c78344707765..6c8f8963de719 100644 --- a/recipes/ada/config.yml +++ b/recipes/ada/config.yml @@ -1,29 +1,11 @@ versions: - "2.7.7": + "2.9.0": folder: all - "2.7.5": + "2.8.0": folder: all - "2.7.4": - folder: all - "2.7.3": - folder: all - "2.7.2": - folder: all - "2.7.0": + "2.7.8": folder: all "2.6.10": folder: all - "2.6.7": - folder: all - "2.6.4": - folder: all - "2.6.2": - folder: all - "2.6.0": - folder: all "2.5.1": folder: all - "2.5.0": - folder: all - "2.4.2": - folder: all diff --git a/recipes/alembic/all/conanfile.py b/recipes/alembic/all/conanfile.py index 81ce4ae17f4f7..b0e76d94370d0 100644 --- a/recipes/alembic/all/conanfile.py +++ b/recipes/alembic/all/conanfile.py @@ -46,7 +46,7 @@ def layout(self): def requirements(self): self.requires("imath/3.1.9", transitive_headers=True) if self.options.with_hdf5: - self.requires("hdf5/1.14.2") + self.requires("hdf5/1.14.3") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/android-ndk/all/conandata.yml b/recipes/android-ndk/all/conandata.yml index 0a73cd9fc973b..450b3b65da338 100644 --- a/recipes/android-ndk/all/conandata.yml +++ b/recipes/android-ndk/all/conandata.yml @@ -1,4 +1,17 @@ sources: + "r26d": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26d-windows.zip" + sha256: "9b285da57a36818cb65ea5b93ec74f8138f48a40182ff2994f6aade4580ed597" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26d-linux.zip" + sha256: "eefeafe7ccf177de7cc57158da585e7af119bb7504a63604ad719e4b2a328b54" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26d-darwin.zip" + sha256: "ee2d0531685a69164fc0a66705d3a30109223f6fc01f1008ca5d8bc3a32d628d" "r26c": "Windows": "x86_64": diff --git a/recipes/android-ndk/all/conanfile.py b/recipes/android-ndk/all/conanfile.py index ecf241f5b5a1a..76b9a2ead193a 100644 --- a/recipes/android-ndk/all/conanfile.py +++ b/recipes/android-ndk/all/conanfile.py @@ -300,12 +300,13 @@ def package_info(self): self.conf_info.update("tools.build:compiler_executables", compiler_executables) self.buildenv_info.define_path("CC", compiler_executables["c"]) self.buildenv_info.define_path("CXX", compiler_executables["cpp"]) + self.buildenv_info.define_path("AS", compiler_executables["c"]) + self.buildenv_info.define_path("LD", compiler_executables["cpp"]) # Versions greater than 23 had the naming convention # changed to no longer include the triplet. bare = self._ndk_version_major >= 23 self.buildenv_info.define_path("AR", self._define_tool_var("AR", "ar", bare)) - self.buildenv_info.define_path("AS", self._define_tool_var("AS", "as", bare)) self.buildenv_info.define_path("RANLIB", self._define_tool_var("RANLIB", "ranlib", bare)) self.buildenv_info.define_path("STRIP", self._define_tool_var("STRIP", "strip", bare)) self.buildenv_info.define_path("ADDR2LINE", self._define_tool_var("ADDR2LINE", "addr2line", bare)) @@ -317,12 +318,6 @@ def package_info(self): if self._ndk_version_major < 23: self.buildenv_info.define_path("ELFEDIT", self._define_tool_var("ELFEDIT", "elfedit", bare)) - # The `ld` tool changed naming conventions earlier than others - if self._ndk_version_major >= 22: - self.buildenv_info.define_path("LD", self._define_tool_var_naked("LD", "ld")) - else: - self.buildenv_info.define_path("LD", self._define_tool_var("LD", "ld")) - self.buildenv_info.define("ANDROID_PLATFORM", f"android-{self.settings_target.os.api_level}") self.buildenv_info.define("ANDROID_TOOLCHAIN", "clang") self.buildenv_info.define("ANDROID_ABI", self._android_abi) diff --git a/recipes/android-ndk/all/test_package/conanfile.py b/recipes/android-ndk/all/test_package/conanfile.py index db186fc2c369f..1c03586bc651b 100644 --- a/recipes/android-ndk/all/test_package/conanfile.py +++ b/recipes/android-ndk/all/test_package/conanfile.py @@ -1,6 +1,8 @@ from conan import ConanFile from conan.tools.cmake import CMake, cmake_layout +from conan.tools.scm import Version import os +import platform class TestPackgeConan(ConanFile): @@ -22,10 +24,14 @@ def build(self): cmake.build() def test(self): - if self.settings.os == "Windows": - self.run("ndk-build.cmd --version") + ndk_build = "ndk-build.cmd" if self.settings.os == "Windows" else "ndk-build" + ndk_version = Version(self.tested_reference_str.split('/')[1]) + skip_run = platform.system() == "Darwin" and "arm" in platform.processor() and ndk_version < "r23c" + if not skip_run: + self.run(f"{ndk_build} --version", env="conanbuild") else: - self.run("ndk-build --version") + self.output.warning("Skipped running ndk-build on macOS Apple Silicon in arm64 mode, please use a newer" + " version of the Android NDK") # INFO: Run the project that was built using Android NDK if self.settings.os == "Android": diff --git a/recipes/android-ndk/all/test_v1_package/conanfile.py b/recipes/android-ndk/all/test_v1_package/conanfile.py deleted file mode 100644 index d61cc4e4da75e..0000000000000 --- a/recipes/android-ndk/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,32 +0,0 @@ -import os -from conan import ConanFile -from conans import CMake -from conan.tools.build import cross_building - - -class TestPackgeConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - test_type = "explicit" - generators = "cmake", "cmake_find_package_multi" - - def build_requirements(self): - self.build_requires(self.tested_reference_str) - - def build(self): - # It only makes sense to build a library, if the target os is Android - if self.settings.os == "Android": - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not cross_building(self): - if self.settings.os == "Windows": - self.run("ndk-build.cmd --version", run_environment=True) - else: - self.run("ndk-build --version", run_environment=True) - - # Run the project that was built using Android NDK - if self.settings.os == "Android": - test_file = os.path.join("bin", "test_package") - assert os.path.exists(test_file) diff --git a/recipes/android-ndk/config.yml b/recipes/android-ndk/config.yml index 2f8b2364c9c1c..ae138de6957a2 100644 --- a/recipes/android-ndk/config.yml +++ b/recipes/android-ndk/config.yml @@ -1,4 +1,6 @@ versions: + "r26d": + folder: all "r26c": folder: all "r26b": diff --git a/recipes/annoy/all/conandata.yml b/recipes/annoy/all/conandata.yml new file mode 100644 index 0000000000000..540727dc55607 --- /dev/null +++ b/recipes/annoy/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.17.3": + url: "https://github.com/spotify/annoy/archive/refs/tags/v1.17.3.tar.gz" + sha256: "c121d38cacd98f5103b24ca4e94ca097f18179eed3037e9eb93ad70ec1e6356e" diff --git a/recipes/annoy/all/conanfile.py b/recipes/annoy/all/conanfile.py new file mode 100644 index 0000000000000..a583978167f26 --- /dev/null +++ b/recipes/annoy/all/conanfile.py @@ -0,0 +1,44 @@ +import os + +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" + +class AnnoyConan(ConanFile): + name = "annoy" + description = "Approximate Nearest Neighbors optimized for memory usage and loading/saving to disk" + license = "Apache-2.0" + homepage = "https://github.com/spotify/annoy" + url = "https://github.com/conan-io/conan-center-index" + topics = ("approximate-nearest-neighbors", "machine-learning", "nearest-neighbors", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + for header in ["annoylib.h", "kissrandom.h", "mman.h"]: + copy(self, header, os.path.join(self.source_folder, "src"), os.path.join(self.package_folder, "include", "annoy")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Annoy") + self.cpp_info.set_property("cmake_target_name", "Annoy::Annoy") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "Annoy" + self.cpp_info.names["cmake_find_package_multi"] = "Annoy" diff --git a/recipes/annoy/all/test_package/CMakeLists.txt b/recipes/annoy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33d34348b2425 --- /dev/null +++ b/recipes/annoy/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Annoy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Annoy::Annoy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/annoy/all/test_package/conanfile.py b/recipes/annoy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/annoy/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/annoy/all/test_package/test_package.cpp b/recipes/annoy/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ee5f4538042ea --- /dev/null +++ b/recipes/annoy/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include + +#include +#include + +int main() { + const int n = 3; + Annoy::AnnoyIndex index(n); + + double x[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; + double needle[3] = {0.1, 0.1, 0.8}; + + for (int i = 0; i < n; i++) { + index.add_item(i, x[i]); + } + index.build(-1); + + std::vector result; + index.get_nns_by_vector(needle, 1, -1, &result, nullptr); + std::cout << "Nearest neighbor to vector [1.0, 0.5, 0.5]: "; + for (int i : result) { + std::cout << i << " "; + } + std::cout << std::endl; + return 0; +} diff --git a/recipes/annoy/config.yml b/recipes/annoy/config.yml new file mode 100644 index 0000000000000..a138b582eaf2e --- /dev/null +++ b/recipes/annoy/config.yml @@ -0,0 +1,3 @@ +versions: + "1.17.3": + folder: all diff --git a/recipes/approvaltests.cpp/all/conandata.yml b/recipes/approvaltests.cpp/all/conandata.yml index b3f371f3d0cdd..f5f47fc15d2ea 100644 --- a/recipes/approvaltests.cpp/all/conandata.yml +++ b/recipes/approvaltests.cpp/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "10.13.0": + - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.10.13.0/ApprovalTests.v.10.13.0.hpp + sha256: c00f6390b81d9924dc646e9d32b61e1e09abda106c13704f714ac349241bb9ff + - url: "https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/v.10.13.0/LICENSE" + sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 "10.12.2": - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.10.12.2/ApprovalTests.v.10.12.2.hpp sha256: 4c43d0ea98669e3d6fbb5810cc47b19adaf88cabb1421b488aa306b08c434131 diff --git a/recipes/approvaltests.cpp/all/conanfile.py b/recipes/approvaltests.cpp/all/conanfile.py index 167d80165bb6d..1bfdff95cf245 100644 --- a/recipes/approvaltests.cpp/all/conanfile.py +++ b/recipes/approvaltests.cpp/all/conanfile.py @@ -1,11 +1,12 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd from conan.tools.files import copy, download, rename from conan.tools.layout import basic_layout from conan.tools.scm import Version import os -required_conan_version = ">=1.51.1" +required_conan_version = ">=1.53" class ApprovalTestsCppConan(ConanFile): @@ -38,6 +39,10 @@ class ApprovalTestsCppConan(ConanFile): @property def _header_file(self): return "ApprovalTests.hpp" + + @property + def _min_cppstd(self): + return 11 def config_options(self): if Version(self.version) < "10.4.0": @@ -62,6 +67,9 @@ def package_id(self): self.info.clear() def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + if Version(self.version) >= "10.2.0": if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration(f"{self.ref} with compiler gcc requires at least compiler version 5") diff --git a/recipes/approvaltests.cpp/config.yml b/recipes/approvaltests.cpp/config.yml index caf3f177e07c7..6e7a92b2ed85a 100644 --- a/recipes/approvaltests.cpp/config.yml +++ b/recipes/approvaltests.cpp/config.yml @@ -1,4 +1,6 @@ versions: + "10.13.0": + folder: all "10.12.2": folder: all "10.12.1": diff --git a/recipes/apr-util/all/conanfile.py b/recipes/apr-util/all/conanfile.py index ed635923b1c3a..92e0be4b1f040 100644 --- a/recipes/apr-util/all/conanfile.py +++ b/recipes/apr-util/all/conanfile.py @@ -90,7 +90,7 @@ def requirements(self): if self.options.with_sqlite3: self.requires("sqlite3/3.45.0") if self.options.with_expat: - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.with_postgresql: self.requires("libpq/15.4") diff --git a/recipes/apr/all/conanfile.py b/recipes/apr/all/conanfile.py index 932bac9dcf2ea..2f5b13dc054ed 100644 --- a/recipes/apr/all/conanfile.py +++ b/recipes/apr/all/conanfile.py @@ -1,3 +1,6 @@ +import os +import re + from conan import ConanFile from conan.errors import ConanException, ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name @@ -9,8 +12,6 @@ from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc from conan.tools.scm import Version -import os -import re required_conan_version = ">=1.54.0" @@ -69,7 +70,20 @@ def layout(self): def validate_build(self): if cross_building(self) and not is_msvc(self): - raise ConanInvalidConfiguration("apr recipe doesn't support cross-build yet due to runtime checks in autoconf") + msg = ("apr recipe doesn't support cross-build for all the platforms" + " due to runtime checks in autoconf. You can provide" + " a pre-built cached file as an user Conan conf variable to try it.\n\n" + "Via host profile:\n" + "[conf]\nuser.apr:cache_file=/path/to/cache_file\n\n" + "Via CLI: \n" + "-c \"user.apr:cache_file='/path/to/cache_file'\"") + # Cross-building for apr < 1.7.4 is not supported without a pre-built cached file + if Version(self.version) < "1.7.4" and self.conf.get("user.apr:cache_file") is None: + raise ConanInvalidConfiguration(msg) + # Conan provides for apr >= 1.7.4 and Linux some configuration flags to avoid + # entering a pre-built cached file + if self.settings.os != "Linux" and self.conf.get("user.apr:cache_file") is None: + raise ConanInvalidConfiguration(msg) def build_requirements(self): if not is_msvc(self): @@ -83,6 +97,47 @@ def build_requirements(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + def _get_cross_building_configure_args(self): + """ + The vast majority of projects that use autotools and make use of the AC_TRY_RUN macro, + do provide a default fallback when cross-compiling, as per the documentation here: + + * https://ftp.gnu.org/old-gnu/Manuals/autoconf-2.53/html_node/Test-Programs.html + + In that regard, APR cannot be cross-compiled by traditional means, and the only fallback + is to use a cache file. Indeed, the only way to cross-compile that is documented by upstream + is by pre-empting the configuration checks with a cache file that needs to be generated on + the target system: + + ./configure --cache-file={gnu_host_triplet}.cache + + The generated cache file can be repeatedly used to cross-compile to the targeted host system + by including it with the recipe data. + + This recipe is reading this custom user conf variable: + + [conf] + user.apr:cache_file=/path/to/{gnu_host_triplet}.cache + + So you can use it to cross-compile on your system. + """ + configure_args = [] + user_cache_file = self.conf.get("user.apr:cache_file", check_type=str) + if user_cache_file: + configure_args.append(f"--cache-file={user_cache_file}") + return configure_args + + self.output.warning("Trying to set some configuration arguments, but it" + " could fail. The best approach is to provide a" + " pre-built cached file.") + if self.settings.os == "Linux": + # Mandatory cross-building configuration flags (tested on Linux ARM and Intel) + configure_args.extend(["apr_cv_mutex_robust_shared=yes", + "ac_cv_file__dev_zero=yes", + "apr_cv_process_shared_works=yes", + "apr_cv_tcp_nodelay_with_cork=yes"]) + return configure_args + def generate(self): if is_msvc(self): tc = CMakeToolchain(self) @@ -95,7 +150,7 @@ def generate(self): tc = AutotoolsToolchain(self) tc.configure_args.append("--with-installbuilddir=${prefix}/res/build-1") if cross_building(self): - tc.configure_args.append("apr_cv_mutex_robust_shared=yes") + tc.configure_args.extend(self._get_cross_building_configure_args()) tc.generate() def _patch_sources(self): diff --git a/recipes/aravis/all/conandata.yml b/recipes/aravis/all/conandata.yml index 768365163e373..3a163fd8d1e6f 100644 --- a/recipes/aravis/all/conandata.yml +++ b/recipes/aravis/all/conandata.yml @@ -8,9 +8,6 @@ sources: "0.8.25": # latest version that supports GenDC data format (supported by U3V 1.1) url: "https://github.com/AravisProject/aravis/releases/download/0.8.25/aravis-0.8.25.tar.xz" sha256: "3ba18f941ae4e2c898fed1f63c4ce67ea41a800a902ee5684eef4ffdb87f1c09" - "0.8.20": - url: "https://github.com/AravisProject/aravis/releases/download/0.8.20/aravis-0.8.20.tar.xz" - sha256: "0c0eb5a76109f29180c09c7e6a23fd403633bf22bbe8468a0ae44995c4449f46" patches: "0.8.30": - patch_file: "patches/0.8.29-gst-shared-lib.patch" @@ -24,7 +21,3 @@ patches: - patch_file: "patches/0.8.25-gst-shared-lib.patch" patch_description: "remove forcing of shared library built for gst-plugins" patch_type: conan - "0.8.20": - - patch_file: "patches/0.8.19-gst-shared-lib.patch" - patch_description: "remove forcing of shared library built for gst-plugins" - patch_type: conan diff --git a/recipes/aravis/all/conanfile.py b/recipes/aravis/all/conanfile.py index af5a8560dea48..1b412478f26e7 100644 --- a/recipes/aravis/all/conanfile.py +++ b/recipes/aravis/all/conanfile.py @@ -33,7 +33,6 @@ class AravisConan(ConanFile): "gst_plugin": [True, False], "tools": [True, False], "introspection": [True, False], - "gv_n_buffers": ["ANY"], } default_options = { "shared": False, @@ -43,7 +42,6 @@ class AravisConan(ConanFile): "gst_plugin": False, "tools": True, "introspection": False, - "gv_n_buffers": 16, } def export_sources(self): @@ -54,10 +52,6 @@ def config_options(self): del self.options.fPIC if self.settings.os not in ["Linux", "FreeBSD"]: del self.options.packet_socket - # https://github.com/AravisProject/aravis/commit/b4211e5e0266d0226e936818b3faefd6d0daaa3a#diff-f28598af2e23aa5d2bc7c72e022ae2c56a33802eb970afffaeca1e40607f97fe - if Version(self.version) < "0.8.21": - del self.options.gv_n_buffers - def configure(self): if self.options.shared: @@ -72,8 +66,8 @@ def layout(self): def requirements(self): # glib-object.h and gio/gio.h are used in several public headers - self.requires("glib/2.78.1", transitive_headers=True) - self.requires("libxml2/2.12.3") + self.requires("glib/2.78.3", transitive_headers=True) + self.requires("libxml2/[>=2.12.5 <3]") self.requires("zlib/[>=1.2.11 <2]") if self.options.usb: @@ -93,18 +87,9 @@ def validate(self): "conan-io/conan#7324 gets merged to fix macOS SIP issue #8443" ) - if self.options.get_safe("gv_n_buffers"): - try: - gv_n_buffers_val = int(str(self.options.gv_n_buffers)) - if gv_n_buffers_val < 1: - raise ConanInvalidConfiguration( - f"gv_n_buffers_val must be greater than 1 Provided: {gv_n_buffers_val}") - except ValueError as e: - raise ConanInvalidConfiguration("gv_n_buffers_val must be an integer.") from e - def build_requirements(self): #windows build: meson/1.2.1 works, meson/1.2.2 breaks for some reason! - self.tool_requires("meson/1.3.1") + self.tool_requires("meson/1.4.0") self.tool_requires("glib/") if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/2.1.0") @@ -129,10 +114,6 @@ def generate(self): tc.project_options["viewer"] = "disabled" tc.project_options["tests"] = False tc.project_options["documentation"] = "disabled" - - if self.options.get_safe("gv_n_buffers"): - tc.project_options["gv-n-buffers"] = int(str(self.options.gv_n_buffers)) - tc.project_options["fast-heartbeat"] = False if self.settings.get_safe("compiler.runtime"): tc.project_options["b_vscrt"] = msvc_runtime_flag(self).lower() diff --git a/recipes/aravis/all/patches/0.8.19-gst-shared-lib.patch b/recipes/aravis/all/patches/0.8.19-gst-shared-lib.patch deleted file mode 100644 index fec845831e656..0000000000000 --- a/recipes/aravis/all/patches/0.8.19-gst-shared-lib.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gst/meson.build -+++ b/gst/meson.build -@@ -15,7 +15,7 @@ gst_c_args = [ - - gst_plugin_filename = 'gstaravis.@0@'.format (aravis_api_version) - --gst_plugin = shared_library (gst_plugin_filename, -+gst_plugin = library (gst_plugin_filename, - gst_sources, gst_headers, - name_suffix: [], - link_with: aravis_library, diff --git a/recipes/aravis/config.yml b/recipes/aravis/config.yml index 1aa8532edf0e6..62d9bfe99223a 100644 --- a/recipes/aravis/config.yml +++ b/recipes/aravis/config.yml @@ -6,5 +6,3 @@ versions: # 0.8.25 is the last version to support GenDC data format "0.8.25": folder: all - "0.8.20": - folder: all diff --git a/recipes/arcus/all/conanfile.py b/recipes/arcus/all/conanfile.py index 8f6e301a39313..38ae3416bb350 100644 --- a/recipes/arcus/all/conanfile.py +++ b/recipes/arcus/all/conanfile.py @@ -45,7 +45,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("protobuf/3.21.9") + self.requires("protobuf/3.21.12") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/args-parser/all/conandata.yml b/recipes/args-parser/all/conandata.yml index 427c4c05d81dd..5a22686895e16 100644 --- a/recipes/args-parser/all/conandata.yml +++ b/recipes/args-parser/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.3.4": + url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.3.4.tar.gz" + sha256: "874be94baac622e16045b958539e91347f18fc0803356fb500757c0060222aa2" "6.3.3": url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.3.3.tar.gz" sha256: "67867d7ab624a8c2f391230c54c37830e6127f7f5c716ff634165f674d876b64" diff --git a/recipes/args-parser/all/conanfile.py b/recipes/args-parser/all/conanfile.py index f4ea312819ef0..45b750c9e57c9 100644 --- a/recipes/args-parser/all/conanfile.py +++ b/recipes/args-parser/all/conanfile.py @@ -56,7 +56,10 @@ def build(self): pass def package(self): - copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) <= "6.3.3": + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + else: + copy(self, "MIT.txt", src=os.path.join(self.source_folder, "LICENSES"), dst=os.path.join(self.package_folder, "licenses")) copy(self, "*.hpp", src=os.path.join(self.source_folder, "args-parser"), dst=os.path.join(self.package_folder, "include", "args-parser")) def package_info(self): diff --git a/recipes/args-parser/config.yml b/recipes/args-parser/config.yml index b67bad0e21e0f..9b0a8042dbf5e 100644 --- a/recipes/args-parser/config.yml +++ b/recipes/args-parser/config.yml @@ -1,4 +1,6 @@ versions: + "6.3.4": + folder: all "6.3.3": folder: all "6.3.2": diff --git a/recipes/armadillo/all/conanfile.py b/recipes/armadillo/all/conanfile.py index d37ca846e702e..4735e4fcda303 100644 --- a/recipes/armadillo/all/conanfile.py +++ b/recipes/armadillo/all/conanfile.py @@ -1,13 +1,14 @@ from conan import ConanFile 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.files import copy, get, rmdir, apply_conandata_patches, export_conandata_patches, save 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 +import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.55.0" class ArmadilloConan(ConanFile): @@ -258,6 +259,40 @@ def build(self): cmake.configure() cmake.build() + @property + def _get_arma_version_name(self): + version_file = os.path.join(self.source_folder, "include", "armadillo_bits", "arma_version.hpp") + with open(version_file, "r") as f: + for line in f: + if "ARMA_VERSION_NAME" in line: + return line.split("\"")[-2].strip() + return "" + + @property + def _module_vars_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent(f"""\ + set(ARMADILLO_FOUND TRUE) + if(DEFINED Armadillo_INCLUDE_DIRS) + set(ARMADILLO_INCLUDE_DIRS ${{Armadillo_INCLUDE_DIRS}}) + endif() + if(DEFINED Armadillo_LIBRARIES) + set(ARMADILLO_LIBRARIES ${{Armadillo_LIBRARIES}}) + endif() + set(ARMADILLO_VERSION_MAJOR "{Version(self.version).major}") + set(ARMADILLO_VERSION_MINOR "{Version(self.version).minor}") + set(ARMADILLO_VERSION_PATCH "{Version(self.version).patch}") + if(DEFINED Armadillo_VERSION_STRING) + set(ARMADILLO_VERSION_STRING ${{Armadillo_VERSION_STRING}}) + else() + set(ARMADILLO_VERSION_STRING "${{ARMADILLO_VERSION_MAJOR}}.${{ARMADILLO_VERSION_MINOR}}.${{ARMADILLO_VERSION_PATCH}}") + endif() + set(ARMADILLO_VERSION_NAME "{self._get_arma_version_name}") + """) + save(self, module_file, content) + def package(self): cmake = CMake(self) cmake.install() @@ -266,10 +301,25 @@ def package(self): copy(self, "NOTICE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) + self._create_cmake_module_variables(os.path.join(self.package_folder, self._module_vars_rel_path)) + def package_info(self): self.cpp_info.libs = ["armadillo"] self.cpp_info.set_property("pkg_config_name", "armadillo") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "Armadillo") + self.cpp_info.set_property("cmake_target_name", "Armadillo::Armadillo") + self.cpp_info.set_property("cmake_target_aliases", ["armadillo", "armadillo::armadillo"]) + self.cpp_info.set_property("cmake_build_modules", [self._module_vars_rel_path]) + + # Remove when cmake_find_package and pkg_config generators are no + # longer supported + self.cpp_info.names["pkg_config"] = "armadillo" + self.cpp_info.names["cmake_find_package"] = "Armadillo" + self.cpp_info.names["cmake_find_package_multi"] = "Armadillo" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_vars_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_vars_rel_path] if self.options.get_safe("use_extern_rng"): self.cpp_info.defines.append("ARMA_USE_EXTERN_RNG") diff --git a/recipes/armadillo/all/test_package/CMakeLists.txt b/recipes/armadillo/all/test_package/CMakeLists.txt index da38c2d4cf348..7f0a114a2e9e8 100644 --- a/recipes/armadillo/all/test_package/CMakeLists.txt +++ b/recipes/armadillo/all/test_package/CMakeLists.txt @@ -1,12 +1,32 @@ cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -find_package(armadillo CONFIG REQUIRED) +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 ${HDF5_TARGETS}) +target_link_libraries(example Armadillo::Armadillo ${HDF5_TARGETS}) set_property(TARGET example PROPERTY CXX_STANDARD 11) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindArmadillo.html are properly defined + +set(_custom_vars + ARMADILLO_FOUND + ARMADILLO_INCLUDE_DIRS + ARMADILLO_LIBRARIES + ARMADILLO_VERSION_MAJOR + ARMADILLO_VERSION_MINOR + ARMADILLO_VERSION_PATCH + ARMADILLO_VERSION_STRING + ARMADILLO_VERSION_NAME +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() diff --git a/recipes/armadillo/all/test_v1_package/CMakeLists.txt b/recipes/armadillo/all/test_v1_package/CMakeLists.txt index 3ac69a9731274..30cc31a24a3d1 100644 --- a/recipes/armadillo/all/test_v1_package/CMakeLists.txt +++ b/recipes/armadillo/all/test_v1_package/CMakeLists.txt @@ -4,8 +4,28 @@ project(PackageTest CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(armadillo REQUIRED) +find_package(Armadillo REQUIRED) add_executable(example ../test_package/src/example.cpp) -target_link_libraries(example armadillo::armadillo) +target_link_libraries(example Armadillo::Armadillo) set_property(TARGET example PROPERTY CXX_STANDARD 11) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindArmadillo.html are properly defined + +set(_custom_vars + ARMADILLO_FOUND + ARMADILLO_INCLUDE_DIRS + ARMADILLO_LIBRARIES + ARMADILLO_VERSION_MAJOR + ARMADILLO_VERSION_MINOR + ARMADILLO_VERSION_PATCH + ARMADILLO_VERSION_STRING + ARMADILLO_VERSION_NAME +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() diff --git a/recipes/arrow/all/conandata.yml b/recipes/arrow/all/conandata.yml index 5521daf96b996..e231222d58659 100644 --- a/recipes/arrow/all/conandata.yml +++ b/recipes/arrow/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "16.1.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-16.1.0/apache-arrow-16.1.0.tar.gz?action=download" + sha256: "c9e60c7e87e59383d21b20dc874b17153729ee153264af6d21654b7dff2c60d7" + "16.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-16.0.0/apache-arrow-16.0.0.tar.gz?action=download" + sha256: "9f4051ae9473c97991d9af801e2f94ae3455067719ca7f90b8137f9e9a700b8d" "15.0.0": url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-15.0.0/apache-arrow-15.0.0.tar.gz?action=download" sha256: "01dd3f70e85d9b5b933ec92c0db8a4ef504a5105f78d2d8622e84279fb45c25d" @@ -38,51 +44,25 @@ sources: "7.0.0": url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-7.0.0/apache-arrow-7.0.0.tar.gz?action=download" sha256: "e8f49b149a15ecef4e40fcfab1b87c113c6b1ee186005c169e5cdf95d31a99de" - "2.0.0": - url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-2.0.0/apache-arrow-2.0.0.tar.gz?action=download" - sha256: "be0342cc847bb340d86aeaef43596a0b6c1dbf1ede9c789a503d939e01c71fbe" - "1.0.0": - url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-1.0.0/apache-arrow-1.0.0.tar.gz?action=download" - sha256: "86ddb9feb48203a5aaf9cc4f2827525e20a2ca4d7239e492af17e74532ccf243" patches: "8.0.1": - patch_file: "patches/8.0.0-0005-install-utils.patch" - patch_description: "enable utilis installation" + patch_description: "enable utils installation" patch_type: "conan" - patch_file: "patches/8.0.0-0006-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" "8.0.0": - patch_file: "patches/8.0.0-0005-install-utils.patch" - patch_description: "enable utilis installation" + patch_description: "enable utils installation" patch_type: "conan" - patch_file: "patches/8.0.0-0006-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" "7.0.0": - patch_file: "patches/7.0.0-0006-install-utils.patch" - patch_description: "enable utilis installation" + patch_description: "enable utils installation" patch_type: "conan" - patch_file: "patches/7.0.0-0007-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" - "2.0.0": - - patch_file: "patches/2.0.0-0003-fix-shared-msvc.patch" - patch_description: "make shared enabled in msvc" - patch_type: "official" - - patch_file: "patches/2.0.0-0005-gandiva-engine.patch" - patch_description: "fix grandiva compilation error" - patch_type: "official" - - patch_file: "patches/2.0.0-0008-fix-cmake.patch" - patch_description: "use cci package" - patch_type: "conan" - "1.0.0": - - patch_file: "patches/1.0.0-0003-fix-shared-msvc.patch" - patch_description: "make shared enabled in msvc" - patch_type: "official" - - patch_file: "patches/1.0.0-0005-fix-make12-namespace.patch" - patch_description: "fix ambiguous `make12` function between std and date" - patch_type: "official" - - patch_file: "patches/1.0.0-0006-fix-cmake.patch" - patch_description: "use cci package" - patch_type: "conan" diff --git a/recipes/arrow/all/conanfile.py b/recipes/arrow/all/conanfile.py index dcd80308b7b01..8080af297b81b 100644 --- a/recipes/arrow/all/conanfile.py +++ b/recipes/arrow/all/conanfile.py @@ -1,13 +1,14 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException from conan.tools.build import check_min_cppstd, cross_building from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os import glob +import textwrap required_conan_version = ">=1.53.0" @@ -71,13 +72,13 @@ class ArrowConan(ConanFile): "shared": False, "fPIC": True, "gandiva": False, - "parquet": "auto", + "parquet": False, "skyhook": False, "substrait": False, "acero": False, "cli": False, - "compute": "auto", - "dataset_modules": "auto", + "compute": False, + "dataset_modules": False, "deprecated": True, "encryption": False, "filesystem_layer": False, @@ -86,29 +87,29 @@ class ArrowConan(ConanFile): "simd_level": "default", "runtime_simd_level": "max", "with_backtrace": False, - "with_boost": "auto", + "with_boost": False, "with_brotli": False, "with_bz2": False, "with_csv": False, "with_cuda": False, - "with_flight_rpc": "auto", + "with_flight_rpc": False, "with_flight_sql": False, "with_gcs": False, - "with_gflags": "auto", - "with_jemalloc": "auto", + "with_gflags": False, + "with_jemalloc": False, "with_mimalloc": False, - "with_glog": "auto", - "with_grpc": "auto", + "with_glog": False, + "with_grpc": False, "with_json": False, - "with_thrift": "auto", - "with_llvm": "auto", - "with_openssl": "auto", + "with_thrift": False, + "with_llvm": False, + "with_openssl": False, "with_opentelemetry": False, "with_orc": False, - "with_protobuf": "auto", - "with_re2": "auto", + "with_protobuf": False, + "with_re2": False, "with_s3": False, - "with_utf8proc": "auto", + "with_utf8proc": False, "with_lz4": False, "with_snappy": False, "with_zlib": False, @@ -144,35 +145,10 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if Version(self.version) < "2.0.0": - del self.options.simd_level - del self.options.runtime_simd_level - elif Version(self.version) < "6.0.0": - self.options.simd_level = "sse4_2" - if Version(self.version) < "6.0.0": - del self.options.with_gcs - if Version(self.version) < "7.0.0": - del self.options.skyhook - del self.options.with_flight_sql - del self.options.with_opentelemetry if Version(self.version) < "8.0.0": del self.options.substrait - - self.options.parquet = self._parquet() - self.options.compute = self._compute() - self.options.dataset_modules = self._dataset_modules() - self.options.with_boost = self._with_boost() - self.options.with_flight_rpc = self._with_flight_rpc() - self.options.with_gflags = self._with_gflags() - self.options.with_glog = self._with_glog() - self.options.with_grpc = self._with_grpc() - self.options.with_jemalloc = self._with_jemalloc() - self.options.with_thrift = self._with_thrift() - self.options.with_llvm = self._with_llvm() - self.options.with_openssl = self._with_openssl() - self.options.with_protobuf = self._with_protobuf() - self.options.with_re2 = self._with_re2() - self.options.with_utf8proc = self._with_utf8proc() + if is_msvc(self): + self.options.with_boost = True def configure(self): if self.options.shared: @@ -181,127 +157,20 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") - def _compute(self): - if self.options.compute == "auto": - return bool(self._parquet() or self._dataset_modules()) or bool(self.options.get_safe("substrait", False)) - else: - return bool(self.options.compute) - - def _parquet(self): - if self.options.parquet == "auto": - return bool(self.options.get_safe("substrait", False)) - else: - return bool(self.options.parquet) - - def _dataset_modules(self): - if self.options.dataset_modules == "auto": - return bool(self.options.get_safe("substrait", False)) - else: - return bool(self.options.dataset_modules) - - def _with_jemalloc(self): - if self.options.with_jemalloc == "auto": - return bool("BSD" in str(self.settings.os)) - else: - return bool(self.options.with_jemalloc) - - def _with_re2(self): - if self.options.with_re2 == "auto": - if self.options.gandiva or self.options.parquet: - return True - if Version(self) >= "7.0.0" and (self._compute() or self._dataset_modules()): - return True - return False - else: - return bool(self.options.with_re2) - - def _with_protobuf(self): - if self.options.with_protobuf == "auto": - return bool(self.options.gandiva or self._with_flight_rpc() or self.options.with_orc or self.options.get_safe("substrait", False)) - else: - return bool(self.options.with_protobuf) - - def _with_flight_rpc(self): - if self.options.with_flight_rpc == "auto": - return bool(self.options.get_safe("with_flight_sql", False)) - else: - return bool(self.options.with_flight_rpc) - - def _with_gflags(self): - if self.options.with_gflags == "auto": - return bool(self._with_glog() or self._with_grpc()) - else: - return bool(self.options.with_gflags) - - def _with_glog(self): - if self.options.with_glog == "auto": - return False - else: - return bool(self.options.with_glog) - - def _with_grpc(self): - if self.options.with_grpc == "auto": - return self._with_flight_rpc() - else: - return bool(self.options.with_grpc) - - def _with_boost(self): - if self.options.with_boost == "auto": - if self.options.gandiva: - return True - version = Version(self.version) - if version.major == "1": - if self._parquet() and self.settings.compiler == "gcc" and self.settings.compiler.version < Version("4.9"): - return True - elif version.major >= "2": - if is_msvc(self): - return True - return False - else: - return bool(self.options.with_boost) - - def _with_thrift(self): - if self.options.with_thrift == "auto": - return bool(self._parquet()) - else: - return bool(self.options.with_thrift) - - def _with_utf8proc(self): - if self.options.with_utf8proc == "auto": - return bool(self._compute() or self.options.gandiva) - else: - return bool(self.options.with_utf8proc) - - def _with_llvm(self): - if self.options.with_llvm == "auto": - return bool(self.options.gandiva) - else: - return bool(self.options.with_llvm) - - def _with_openssl(self): - if self.options.with_openssl == "auto": - return bool(self.options.encryption or self._with_flight_rpc() or self.options.with_s3) - else: - return bool(self.options.with_openssl) - def _requires_rapidjson(self): - if self.options.with_json: - return True - if Version(self.version) >= "7.0.0" and self.options.encryption: - return True - return False + return self.options.with_json or self.options.encryption def requirements(self): if self.options.with_thrift: self.requires("thrift/0.17.0") if self.options.with_protobuf: - self.requires("protobuf/3.21.9") + self.requires("protobuf/3.21.12") if self.options.with_jemalloc: self.requires("jemalloc/5.3.0") if self.options.with_mimalloc: self.requires("mimalloc/1.7.6") if self.options.with_boost: - self.requires("boost/1.83.0") + self.requires("boost/1.84.0") if self.options.with_gflags: self.requires("gflags/2.2.2") if self.options.with_glog: @@ -332,8 +201,7 @@ def requirements(self): self.requires("lz4/1.9.4") if self.options.with_snappy: self.requires("snappy/1.1.9") - if Version(self.version) >= "6.0.0" and \ - self.options.get_safe("simd_level") != None or \ + if self.options.get_safe("simd_level") != None or \ self.options.get_safe("runtime_simd_level") != None: self.requires("xsimd/9.0.1") if self.options.with_zlib: @@ -346,13 +214,32 @@ def requirements(self): self.requires("utf8proc/2.8.0") if self.options.with_backtrace: self.requires("libbacktrace/cci.20210118") + if self.options.with_orc: + self.requires("orc/2.0.0") def validate(self): - # validate options with 'auto' as default value - auto_options = ["parquet", "compute", "dataset_modules", "with_boost", "with_flight_rpc", "with_gflags", "with_glog", - "with_grpc", "with_jemalloc", "with_thrift", "with_llvm", "with_openssl", "with_protobuf", "with_re2", "with_utf8proc"] - for option in auto_options: - assert "auto" not in str(self.options.get_safe(option)), f"Option '{option}' contains 'auto' value, wich is not allowed. Generally the final value should be True/False" + # Do not allow options with 'auto' value + # TODO: Remove "auto" from the possible values for these options + auto_options = [option for option, value in self.options.items() if value == "auto"] + if auto_options: + raise ConanException("Options with value 'auto' are deprecated. Please set them true/false or use its default value." + f" Please change the following options: {auto_options}") + + # From https://github.com/conan-io/conan-center-index/pull/23163#issuecomment-2039808851 + if self.options.gandiva: + if not self.options.with_re2: + raise ConanException("'with_re2' option should be True when'gandiva=True'") + if not self.options.with_boost: + raise ConanException("'with_boost' option should be True when'gandiva=True'") + if not self.options.with_utf8proc: + raise ConanException("'with_utf8proc' option should be True when'gandiva=True'") + if self.options.parquet: + if not self.options.with_boost: + raise ConanException("'with_boost' option should be True when'parquet=True'") + if not self.options.with_thrift: + raise ConanException("'with_thrift' option should be True when'parquet=True'") + if self.options.with_flight_rpc and not self.options.with_protobuf: + raise ConanException("'with_protobuf' option should be True when'with_flight_rpc=True'") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) @@ -367,8 +254,6 @@ def validate(self): raise ConanInvalidConfiguration("CCI has no librados recipe (yet)") if self.options.with_cuda: raise ConanInvalidConfiguration("CCI has no cuda recipe (yet)") - if self.options.with_orc: - raise ConanInvalidConfiguration("CCI has no orc recipe (yet)") if self.options.with_s3 and not self.dependencies["aws-sdk-cpp"].options.config: raise ConanInvalidConfiguration("arrow:with_s3 requires aws-sdk-cpp:config is True.") @@ -376,8 +261,6 @@ def validate(self): if self.dependencies["jemalloc"].options.enable_cxx: raise ConanInvalidConfiguration("jemmalloc.enable_cxx of a static jemalloc must be disabled") - if Version(self.version) < "6.0.0" and self.options.get_safe("simd_level") == "default": - raise ConanInvalidConfiguration(f"In {self.ref}, simd_level options is not supported `default` value.") def build_requirements(self): if Version(self.version) >= "13.0.0": @@ -414,7 +297,7 @@ def generate(self): tc.variables["ARROW_NO_DEPRECATED_API"] = not bool(self.options.deprecated) tc.variables["ARROW_FLIGHT"] = self.options.with_flight_rpc tc.variables["ARROW_FLIGHT_SQL"] = bool(self.options.get_safe("with_flight_sql", False)) - tc.variables["ARROW_COMPUTE"] = self.options.compute + tc.variables["ARROW_COMPUTE"] = bool(self.options.compute) tc.variables["ARROW_CSV"] = bool(self.options.with_csv) tc.variables["ARROW_CUDA"] = bool(self.options.with_cuda) tc.variables["ARROW_JEMALLOC"] = self.options.with_jemalloc @@ -459,12 +342,9 @@ def generate(self): tc.variables["ZLIB_SOURCE"] = "SYSTEM" tc.variables["xsimd_SOURCE"] = "SYSTEM" tc.variables["ARROW_WITH_ZSTD"] = bool(self.options.with_zstd) - if Version(self.version) >= "2.0": - tc.variables["zstd_SOURCE"] = "SYSTEM" - tc.variables["ARROW_SIMD_LEVEL"] = str(self.options.simd_level).upper() - tc.variables["ARROW_RUNTIME_SIMD_LEVEL"] = str(self.options.runtime_simd_level).upper() - else: - tc.variables["ZSTD_SOURCE"] = "SYSTEM" + tc.variables["zstd_SOURCE"] = "SYSTEM" + tc.variables["ARROW_SIMD_LEVEL"] = str(self.options.simd_level).upper() + tc.variables["ARROW_RUNTIME_SIMD_LEVEL"] = str(self.options.runtime_simd_level).upper() if self.options.with_zstd: tc.variables["ARROW_ZSTD_USE_SHARED"] = bool(self.dependencies["zstd"].options.shared) tc.variables["ORC_SOURCE"] = "SYSTEM" @@ -509,7 +389,7 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - if "7.0.0" <= Version(self.version) < "10.0.0": + if Version(self.version) < "10.0.0": for filename in glob.glob(os.path.join(self.source_folder, "cpp", "cmake_modules", "Find*.cmake")): if os.path.basename(filename) not in [ "FindArrow.cmake", @@ -530,28 +410,74 @@ def _patch_sources(self): def build(self): self._patch_sources() - cmake =CMake(self) + cmake = CMake(self) cmake.configure(build_script_folder=os.path.join(self.source_folder, "cpp")) cmake.build() def package(self): copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) copy(self, pattern="NOTICE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - cmake =CMake(self) + cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) + cmake_suffix = "shared" if self.options.shared else "static" + + alias_map = { f"Arrow::arrow_{cmake_suffix}": f"arrow::arrow_{cmake_suffix}" } + + if self.options.parquet: + alias_map[f"Parquet::parquet_{cmake_suffix}"] = f"arrow::parquet_{cmake_suffix}" + + if self.options.get_safe("substrait"): + alias_map[f"Arrow::arrow_substrait_{cmake_suffix}"] = f"arrow::arrow_substrait_{cmake_suffix}" + + if self.options.acero: + alias_map[f"Arrow::arrow_acero_{cmake_suffix}"] = f"arrow::arrow_acero_{cmake_suffix}" + + if self.options.gandiva: + alias_map[f"Gandiva::gandiva_{cmake_suffix}"] = f"arrow::gandiva_{cmake_suffix}" + + if self.options.with_flight_rpc: + alias_map[f"ArrowFlight::arrow_flight_sql_{cmake_suffix}"] = f"arrow::arrow_flight_sql_{cmake_suffix}" + + + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), alias_map + ) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + save(self, module_file, content) + + @property + def _module_subfolder(self): + return os.path.join("lib", "cmake") + + @property + def _module_file_rel_path(self): + return os.path.join(self._module_subfolder, + f"conan-official-{self.name}-targets.cmake") + def package_info(self): # FIXME: fix CMake targets of components self.cpp_info.set_property("cmake_file_name", "Arrow") suffix = "_static" if is_msvc(self) and not self.options.shared else "" + cmake_suffix = "shared" if self.options.shared else "static" self.cpp_info.components["libarrow"].set_property("pkg_config_name", "arrow") + self.cpp_info.components["libarrow"].set_property("cmake_target_name", f"Arrow::arrow_{cmake_suffix}") self.cpp_info.components["libarrow"].libs = [f"arrow{suffix}"] if not self.options.shared: self.cpp_info.components["libarrow"].defines = ["ARROW_STATIC"] @@ -560,6 +486,7 @@ def package_info(self): if self.options.parquet: self.cpp_info.components["libparquet"].set_property("pkg_config_name", "parquet") + self.cpp_info.components["libparquet"].set_property("cmake_target_name", f"Parquet::parquet_{cmake_suffix}") self.cpp_info.components["libparquet"].libs = [f"parquet{suffix}"] self.cpp_info.components["libparquet"].requires = ["libarrow"] if not self.options.shared: @@ -567,6 +494,7 @@ def package_info(self): if self.options.get_safe("substrait"): self.cpp_info.components["libarrow_substrait"].set_property("pkg_config_name", "arrow_substrait") + self.cpp_info.components["libarrow_substrait"].set_property("cmake_target_name", f"Arrow::arrow_substrait_{cmake_suffix}") self.cpp_info.components["libarrow_substrait"].libs = [f"arrow_substrait{suffix}"] self.cpp_info.components["libarrow_substrait"].requires = ["libparquet", "dataset"] @@ -574,6 +502,8 @@ def package_info(self): del self.options.plasma if self.options.acero: + self.cpp_info.components["libacero"].set_property("pkg_config_name", "acero") + self.cpp_info.components["libacero"].set_property("cmake_target_name", f"Acero::arrow_acero_{cmake_suffix}") self.cpp_info.components["libacero"].libs = [f"arrow_acero{suffix}"] self.cpp_info.components["libacero"].names["cmake_find_package"] = "acero" self.cpp_info.components["libacero"].names["cmake_find_package_multi"] = "acero" @@ -582,6 +512,7 @@ def package_info(self): if self.options.gandiva: self.cpp_info.components["libgandiva"].set_property("pkg_config_name", "gandiva") + self.cpp_info.components["libgandiva"].set_property("cmake_target_name", f"Gandiva::gandiva_{cmake_suffix}") self.cpp_info.components["libgandiva"].libs = [f"gandiva{suffix}"] self.cpp_info.components["libgandiva"].requires = ["libarrow"] if not self.options.shared: @@ -589,11 +520,13 @@ def package_info(self): if self.options.with_flight_rpc: self.cpp_info.components["libarrow_flight"].set_property("pkg_config_name", "flight_rpc") + self.cpp_info.components["libarrow_flight"].set_property("cmake_target_name", f"ArrowFlight::arrow_flight_{cmake_suffix}") self.cpp_info.components["libarrow_flight"].libs = [f"arrow_flight{suffix}"] self.cpp_info.components["libarrow_flight"].requires = ["libarrow"] if self.options.get_safe("with_flight_sql"): self.cpp_info.components["libarrow_flight_sql"].set_property("pkg_config_name", "flight_sql") + self.cpp_info.components["libarrow_flight_sql"].set_property("cmake_target_name", f"ArrowFlightSql::arrow_flight_sql_{cmake_suffix}") self.cpp_info.components["libarrow_flight_sql"].libs = [f"arrow_flight_sql{suffix}"] self.cpp_info.components["libarrow_flight_sql"].requires = ["libarrow", "libarrow_flight"] @@ -613,9 +546,8 @@ def package_info(self): self.cpp_info.components["libgandiva"].requires.append("boost::boost") if self.options.parquet and self.settings.compiler == "gcc" and self.settings.compiler.version < Version("4.9"): self.cpp_info.components["libparquet"].requires.append("boost::boost") - if Version(self.version) >= "2.0": - # FIXME: only headers components is used - self.cpp_info.components["libarrow"].requires.append("boost::boost") + # FIXME: only headers components is used + self.cpp_info.components["libarrow"].requires.append("boost::boost") if self.options.with_openssl: self.cpp_info.components["libarrow"].requires.append("openssl::openssl") if self.options.with_gflags: @@ -668,8 +600,6 @@ def package_info(self): self.cpp_info.components["libarrow"].requires.append("zlib::zlib") if self.options.with_zstd: self.cpp_info.components["libarrow"].requires.append("zstd::zstd") - if self.options.with_boost: - self.cpp_info.components["libarrow"].requires.append("boost::boost") if self.options.with_grpc: self.cpp_info.components["libarrow"].requires.append("grpc::grpc") if self.options.with_flight_rpc: @@ -678,22 +608,34 @@ def package_info(self): # TODO: to remove in conan v2 self.cpp_info.filenames["cmake_find_package"] = "Arrow" self.cpp_info.filenames["cmake_find_package_multi"] = "Arrow" - self.cpp_info.components["libarrow"].names["cmake_find_package"] = "arrow" - self.cpp_info.components["libarrow"].names["cmake_find_package_multi"] = "arrow" + self.cpp_info.components["libarrow"].names["cmake_find_package"] = f"arrow_{cmake_suffix}" + self.cpp_info.components["libarrow"].names["cmake_find_package_multi"] = f"arrow_{cmake_suffix}" + self.cpp_info.components["libarrow"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libarrow"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] if self.options.parquet: - self.cpp_info.components["libparquet"].names["cmake_find_package"] = "parquet" - self.cpp_info.components["libparquet"].names["cmake_find_package_multi"] = "parquet" + self.cpp_info.components["libparquet"].names["cmake_find_package"] = f"parquet_{cmake_suffix}" + self.cpp_info.components["libparquet"].names["cmake_find_package_multi"] = f"parquet_{cmake_suffix}" + self.cpp_info.components["libparquet"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libparquet"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] if self.options.get_safe("substrait"): - self.cpp_info.components["libarrow_substrait"].names["cmake_find_package"] = "arrow_substrait" - self.cpp_info.components["libarrow_substrait"].names["cmake_find_package_multi"] = "arrow_substrait" + self.cpp_info.components["libarrow_substrait"].names["cmake_find_package"] = f"arrow_substrait_{cmake_suffix}" + self.cpp_info.components["libarrow_substrait"].names["cmake_find_package_multi"] = f"arrow_substrait_{cmake_suffix}" + self.cpp_info.components["libarrow_substrait"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libarrow_substrait"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] if self.options.gandiva: self.cpp_info.components["libgandiva"].names["cmake_find_package"] = "gandiva" self.cpp_info.components["libgandiva"].names["cmake_find_package_multi"] = "gandiva" + self.cpp_info.components["libgandiva"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libgandiva"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] if self.options.with_flight_rpc: self.cpp_info.components["libarrow_flight"].names["cmake_find_package"] = "flight_rpc" self.cpp_info.components["libarrow_flight"].names["cmake_find_package_multi"] = "flight_rpc" + self.cpp_info.components["libarrow_flight"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libarrow_flight"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] if self.options.get_safe("with_flight_sql"): self.cpp_info.components["libarrow_flight_sql"].names["cmake_find_package"] = "flight_sql" self.cpp_info.components["libarrow_flight_sql"].names["cmake_find_package_multi"] = "flight_sql" + self.cpp_info.components["libarrow_flight_sql"].build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.components["libarrow_flight_sql"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] if self.options.cli and (self.options.with_cuda or self.options.with_flight_rpc or self.options.parquet): self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/arrow/all/patches/1.0.0-0003-fix-shared-msvc.patch b/recipes/arrow/all/patches/1.0.0-0003-fix-shared-msvc.patch deleted file mode 100644 index 3c7e86d5ff279..0000000000000 --- a/recipes/arrow/all/patches/1.0.0-0003-fix-shared-msvc.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- cpp/src/arrow/CMakeLists.txt -+++ cpp/src/arrow/CMakeLists.txt -@@ -490,6 +490,10 @@ - target_compile_definitions(arrow_static PUBLIC ARROW_STATIC) - endif() - -+if(ARROW_BUILD_SHARED AND WIN32) -+target_compile_definitions(arrow_shared PRIVATE ARROW_EXPORTING) -+endif() -+ - if(ARROW_WITH_BACKTRACE) - find_package(Backtrace) - diff --git a/recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch b/recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch deleted file mode 100644 index 5f0f6f4c52d5c..0000000000000 --- a/recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/cpp/src/arrow/vendored/datetime/date.h b/cpp/src/arrow/vendored/datetime/date.h -index 02a4909..2b168d2 100644 ---- a/cpp/src/arrow/vendored/datetime/date.h -+++ b/cpp/src/arrow/vendored/datetime/date.h -@@ -5152,7 +5152,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt, - if (modified == CharT{}) - #endif - { -- auto h = *fmt == CharT{'I'} ? make12(hms.hours()) : hms.hours(); -+ auto h = *fmt == CharT{'I'} ? arrow_vendored::date::make12(hms.hours()) : hms.hours(); - if (h < hours{10}) - os << CharT{'0'}; - os << h.count(); -@@ -5366,7 +5366,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt, - save_ostream _(os); - os.fill('0'); - os.width(2); -- os << make12(tod.hours()).count() << CharT{':'}; -+ os << arrow_vendored::date::make12(tod.hours()).count() << CharT{':'}; - os.width(2); - os << tod.minutes().count() << CharT{':'}; - os.width(2); diff --git a/recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch b/recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch deleted file mode 100644 index eb6816262214b..0000000000000 --- a/recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch +++ /dev/null @@ -1,333 +0,0 @@ -diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index 300f043..0127a7a 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -654,7 +654,7 @@ endif() - - if(ARROW_WITH_BROTLI) - # Order is important for static linking -- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) -+ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) - list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) - list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) - endif() -@@ -664,7 +664,7 @@ if(ARROW_WITH_BZ2) - endif() - - if(ARROW_WITH_LZ4) -- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) -+ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_static) - endif() - - if(ARROW_WITH_SNAPPY) -@@ -800,8 +800,11 @@ endif() - - if(ARROW_MIMALLOC) - add_definitions(-DARROW_MIMALLOC) -- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) -- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) -+ if (TARGET mimalloc-static) -+ list(APPEND ARROW_LINK_LIBS mimalloc-static) -+ else() -+ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) -+ endif() - endif() - - # ---------------------------------------------------------------------- -diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake -index eb10ebe..9c81017 100644 ---- a/cpp/cmake_modules/BuildUtils.cmake -+++ b/cpp/cmake_modules/BuildUtils.cmake -@@ -165,10 +165,10 @@ function(create_merged_static_lib output_target) - set(ar_script_path ${CMAKE_BINARY_DIR}/${ARG_NAME}.ar) - - file(WRITE ${ar_script_path}.in "CREATE ${output_lib_path}\n") -- file(APPEND ${ar_script_path}.in "ADDLIB $\n") -+ file(APPEND ${ar_script_path}.in "ADDLIB $\n") - - foreach(lib ${ARG_TO_MERGE}) -- file(APPEND ${ar_script_path}.in "ADDLIB $\n") -+ file(APPEND ${ar_script_path}.in "ADDLIB $\n") - endforeach() - - file(APPEND ${ar_script_path}.in "SAVE\nEND\n") -diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake -index 807e2b9..016c8db 100644 ---- a/cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -154,16 +154,7 @@ macro(build_dependency DEPENDENCY_NAME) - endmacro() - - macro(resolve_dependency DEPENDENCY_NAME) -- if(${DEPENDENCY_NAME}_SOURCE STREQUAL "AUTO") -- find_package(${DEPENDENCY_NAME} MODULE) -- if(NOT ${${DEPENDENCY_NAME}_FOUND}) -- build_dependency(${DEPENDENCY_NAME}) -- endif() -- elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "BUNDLED") -- build_dependency(${DEPENDENCY_NAME}) -- elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM") -- find_package(${DEPENDENCY_NAME} REQUIRED) -- endif() -+ find_package(${DEPENDENCY_NAME} REQUIRED) - endmacro() - - macro(resolve_dependency_with_version DEPENDENCY_NAME REQUIRED_VERSION) -@@ -765,6 +756,7 @@ endif() - # - Tests need Boost at runtime. - # - S3FS and Flight benchmarks need Boost at runtime. - if(ARROW_BUILD_INTEGRATION -+ OR ARROW_BOOST_REQUIRED - OR ARROW_BUILD_TESTS - OR ARROW_GANDIVA - OR (ARROW_FLIGHT AND ARROW_BUILD_BENCHMARKS) -@@ -785,7 +777,7 @@ if(ARROW_BOOST_REQUIRED) - elseif(BOOST_SOURCE STREQUAL "BUNDLED") - build_boost() - elseif(BOOST_SOURCE STREQUAL "SYSTEM") -- find_package(BoostAlt ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) -+ find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) - endif() - - if(TARGET Boost::system) -@@ -936,11 +928,11 @@ macro(build_brotli) - endmacro() - - if(ARROW_WITH_BROTLI) -- resolve_dependency(Brotli) -+ resolve_dependency(brotli) - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon -+ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon - INTERFACE_INCLUDE_DIRECTORIES) -- include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) -+ include_directories(SYSTEM ${brotli_INCLUDE_DIR}) - endif() - - if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET) -@@ -1146,9 +1138,10 @@ if(ARROW_NEED_GFLAGS) - endif() - endif() - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) -+ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) -+ set(GFLAGS_LIBRARIES ${gflags_LIBRARIES}) - -- if(NOT TARGET ${GFLAGS_LIBRARIES}) -+ if(0) - if(TARGET gflags-shared) - set(GFLAGS_LIBRARIES gflags-shared) - elseif(TARGET gflags_shared) -@@ -1237,12 +1230,13 @@ endmacro() - if(ARROW_WITH_THRIFT) - # We already may have looked for Thrift earlier, when considering whether - # to build Boost, so don't look again if already found. -- if(NOT Thrift_FOUND AND NOT THRIFT_FOUND) -+ if(0) - # Thrift c++ code generated by 0.13 requires 0.11 or greater - resolve_dependency_with_version(Thrift 0.11.0) - endif() -+ find_package(Thrift CONFIG REQUIRED) - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) -+ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) - endif() - - # ---------------------------------------------------------------------- -@@ -1407,6 +1401,7 @@ endif() - # jemalloc - Unix-only high-performance allocator - - if(ARROW_JEMALLOC) -+if(0) - message(STATUS "Building (vendored) jemalloc from source") - # We only use a vendored jemalloc as we want to control its version. - # Also our build of jemalloc is specially prefixed so that it will not -@@ -1465,12 +1460,18 @@ if(ARROW_JEMALLOC) - add_dependencies(jemalloc::jemalloc jemalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) -+else() -+ find_package(jemalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- - # mimalloc - Cross-platform high-performance allocator, from Microsoft - - if(ARROW_MIMALLOC) -+if(0) - message(STATUS "Building (vendored) mimalloc from source") - # We only use a vendored mimalloc as we want to control its build options. - -@@ -1518,6 +1519,11 @@ if(ARROW_MIMALLOC) - add_dependencies(toolchain mimalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) -+else() -+ find_package(mimalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -1918,11 +1924,16 @@ macro(build_lz4) - endmacro() - - if(ARROW_WITH_LZ4) -- resolve_dependency(Lz4) -+ resolve_dependency(lz4) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) -- include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) -+ if(TARGET LZ4::lz4_static) -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) -+ else() -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) -+ endif() -+ include_directories(SYSTEM ${lz4_INCLUDE_DIR}) -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${lz4_LIBRARIES_TARGETS} ) - endif() - - macro(build_zstd) -@@ -2037,10 +2048,10 @@ macro(build_re2) - endmacro() - - if(ARROW_GANDIVA) -- resolve_dependency(RE2) -+ resolve_dependency(re2) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(RE2_INCLUDE_DIR RE2::re2 INTERFACE_INCLUDE_DIRECTORIES) -+ get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${RE2_INCLUDE_DIR}) - endif() - -@@ -2480,17 +2491,24 @@ if(ARROW_WITH_GRPC) - endif() - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) -+ # get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) -+ if(grpc_INCLUDE_DIRS_RELEASE) -+ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_RELEASE}) -+ elseif(grpc_INCLUDE_DIRS_DEBUG) -+ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_DEBUG}) -+ endif() - include_directories(SYSTEM ${GRPC_INCLUDE_DIR}) -+ include_directories(SYSTEM ${absl_INCLUDE_DIR}) -+ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) - - if(GRPC_VENDORED) - set(GRPCPP_PP_INCLUDE TRUE) - else() - # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp - # depending on the gRPC version. -- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") -+ if(EXISTS ${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE TRUE) -- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") -+ elseif(EXISTS ${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE FALSE) - else() - message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") -diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt -index 5797a78..da6bd4d 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -292,10 +292,15 @@ set(ARROW_TESTING_SRCS - - set(_allocator_dependencies "") # Empty list - if(ARROW_JEMALLOC) -- list(APPEND _allocator_dependencies jemalloc_ep) -+ list(APPEND _allocator_dependencies jemalloc::jemalloc) - endif() -+ - if(ARROW_MIMALLOC) -- list(APPEND _allocator_dependencies mimalloc_ep) -+ if (TARGET mimalloc-static) -+ list(APPEND _allocator_dependencies mimalloc-static) -+ else() -+ list(APPEND _allocator_dependencies mimalloc) -+ endif() - endif() - - if(_allocator_dependencies) -diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc -index 784bf7b..8f005a5 100644 ---- a/cpp/src/arrow/memory_pool.cc -+++ b/cpp/src/arrow/memory_pool.cc -@@ -31,7 +31,7 @@ - // Needed to support jemalloc 3 and 4 - #define JEMALLOC_MANGLE - // Explicitly link to our version of jemalloc --#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" -+#include "jemalloc/jemalloc.h" - #endif - - #ifdef ARROW_MIMALLOC -diff --git a/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt -index 85e8db6..cd70c63 100644 ---- a/cpp/src/gandiva/CMakeLists.txt -+++ b/cpp/src/gandiva/CMakeLists.txt -@@ -25,7 +25,7 @@ add_custom_target(gandiva-benchmarks) - - add_dependencies(gandiva-all gandiva gandiva-tests gandiva-benchmarks) - --find_package(LLVMAlt REQUIRED) -+find_package(LLVM REQUIRED) - - if(LLVM_VERSION_MAJOR LESS "10") - set(GANDIVA_CXX_STANDARD ${CMAKE_CXX_STANDARD}) -@@ -88,9 +88,16 @@ set(SRC_FILES - random_generator_holder.cc - ${GANDIVA_PRECOMPILED_CC_PATH}) - --set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared LLVM::LLVM_INTERFACE RE2::re2) - --set(GANDIVA_STATIC_LINK_LIBS arrow_static LLVM::LLVM_INTERFACE RE2::re2) -+ function(get_all_targets var) -+ set(targets) -+ get_all_targets_recursive(targets ${CMAKE_CURRENT_SOURCE_DIR}) -+ set(${var} ${targets} PARENT_SCOPE) -+endfunction() -+ -+set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared llvm-core::llvm-core re2::re2) -+ -+set(GANDIVA_STATIC_LINK_LIBS arrow_static llvm-core::llvm-core re2::re2) - - if(ARROW_GANDIVA_STATIC_LIBSTDCPP - AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)) -@@ -131,7 +138,7 @@ add_arrow_lib(gandiva - arrow_dependencies - precompiled - EXTRA_INCLUDES -- $ -+ $ - SHARED_LINK_FLAGS - ${GANDIVA_SHARED_LINK_FLAGS} - SHARED_LINK_LIBS -@@ -203,7 +210,7 @@ endfunction() - - set(GANDIVA_INTERNALS_TEST_ARGUMENTS) - if(WIN32) -- list(APPEND GANDIVA_INTERNALS_TEST_ARGUMENTS EXTRA_LINK_LIBS LLVM::LLVM_INTERFACE) -+ list(APPEND GANDIVA_INTERNALS_TEST_ARGUMENTS EXTRA_LINK_LIBS llvm-core::llvm-core) - endif() - add_gandiva_test(internals-test - SOURCES -@@ -225,9 +232,9 @@ add_gandiva_test(internals-test - decimal_type_util_test.cc - random_generator_holder_test.cc - EXTRA_DEPENDENCIES -- LLVM::LLVM_INTERFACE -+ llvm-core::llvm-core - EXTRA_INCLUDES -- $ -+ $ - ${GANDIVA_INTERNALS_TEST_ARGUMENTS}) - - if(ARROW_GANDIVA_JAVA) diff --git a/recipes/arrow/all/patches/2.0.0-0003-fix-shared-msvc.patch b/recipes/arrow/all/patches/2.0.0-0003-fix-shared-msvc.patch deleted file mode 100644 index f3268abf74e2c..0000000000000 --- a/recipes/arrow/all/patches/2.0.0-0003-fix-shared-msvc.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- cpp/src/arrow/CMakeLists.txt -+++ cpp/src/arrow/CMakeLists.txt -@@ -504,6 +504,10 @@ - target_compile_definitions(arrow_static PUBLIC ARROW_STATIC) - endif() - -+if(ARROW_BUILD_SHARED AND WIN32) -+target_compile_definitions(arrow_shared PRIVATE ARROW_EXPORTING) -+endif() -+ - if(ARROW_WITH_BACKTRACE) - find_package(Backtrace) - diff --git a/recipes/arrow/all/patches/2.0.0-0005-gandiva-engine.patch b/recipes/arrow/all/patches/2.0.0-0005-gandiva-engine.patch deleted file mode 100644 index 9fcc4b1a36a8a..0000000000000 --- a/recipes/arrow/all/patches/2.0.0-0005-gandiva-engine.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- cpp/src/gandiva/engine.cc -+++ cpp/src/gandiva/engine.cc -@@ -64,6 +64,10 @@ - #include - #include - -+#if GANDIVA_LLVM_VERSION >= 11 -+#include -+#endif -+ - #if defined(_MSC_VER) - #pragma warning(pop) - #endif diff --git a/recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch b/recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch deleted file mode 100644 index 7153d641e0c61..0000000000000 --- a/recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch +++ /dev/null @@ -1,273 +0,0 @@ -diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index 515e6af..7488161 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -109,7 +109,7 @@ set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support") - set(ARROW_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") - set(ARROW_DOC_DIR "share/doc/${PROJECT_NAME}") - --set(ARROW_LLVM_VERSIONS "10" "9" "8" "7") -+set(ARROW_LLVM_VERSIONS "13" "12" "11" "10" "9" "8" "7") - list(GET ARROW_LLVM_VERSIONS 0 ARROW_LLVM_VERSION_PRIMARY) - string(REGEX - REPLACE "^([0-9]+)(\\..+)?" "\\1" ARROW_LLVM_VERSION_PRIMARY_MAJOR -@@ -667,7 +667,7 @@ endif() - - if(ARROW_WITH_BROTLI) - # Order is important for static linking -- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) -+ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) - list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) - list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) - if(Brotli_SOURCE STREQUAL "SYSTEM") -@@ -683,9 +683,9 @@ if(ARROW_WITH_BZ2) - endif() - - if(ARROW_WITH_LZ4) -- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) -+ list(APPEND ARROW_STATIC_LINK_LIBS lz4::lz4) - if(Lz4_SOURCE STREQUAL "SYSTEM") -- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) -+ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS lz4::lz4) - endif() - endif() - -@@ -842,8 +842,14 @@ endif() - - if(ARROW_MIMALLOC) - add_definitions(-DARROW_MIMALLOC) -- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) -- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) -+ if (TARGET mimalloc-static) -+ list(APPEND ARROW_LINK_LIBS mimalloc-static) -+ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc-static) -+ else() -+ list(APPEND ARROW_LINK_LIBS mimalloc) -+ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) -+ endif() -+ - endif() - - # ---------------------------------------------------------------------- -diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake -index cc37a3c..8fe6db9 100644 ---- a/cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -171,6 +171,7 @@ macro(provide_find_module DEPENDENCY_NAME) - endmacro() - - macro(resolve_dependency DEPENDENCY_NAME) -+if(0) - set(options) - set(one_value_args REQUIRED_VERSION) - cmake_parse_arguments(ARG -@@ -207,6 +208,14 @@ macro(resolve_dependency DEPENDENCY_NAME) - provide_find_module(${DEPENDENCY_NAME}) - list(APPEND ARROW_SYSTEM_DEPENDENCIES ${DEPENDENCY_NAME}) - endif() -+else() -+ if(ARG_REQUIRED_VERSION) -+ find_package(${DEPENDENCY_NAME} ${ARG_REQUIRED_VERSION} REQUIRED) -+ else() -+ find_package(${DEPENDENCY_NAME} REQUIRED) -+ endif() -+ list(APPEND ARROW_SYSTEM_DEPENDENCIES ${DEPENDENCY_NAME}) -+endif() - endmacro() - - # ---------------------------------------------------------------------- -@@ -826,6 +835,7 @@ endif() - # - Tests need Boost at runtime. - # - S3FS and Flight benchmarks need Boost at runtime. - if(ARROW_BUILD_INTEGRATION -+ OR ARROW_BOOST_REQUIRED - OR ARROW_BUILD_TESTS - OR ARROW_GANDIVA - OR (ARROW_FLIGHT AND ARROW_BUILD_BENCHMARKS) -@@ -846,7 +856,7 @@ if(ARROW_BOOST_REQUIRED) - elseif(BOOST_SOURCE STREQUAL "BUNDLED") - build_boost() - elseif(BOOST_SOURCE STREQUAL "SYSTEM") -- find_package(BoostAlt ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) -+ find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) - endif() - - if(TARGET Boost::system) -@@ -973,11 +983,11 @@ macro(build_brotli) - endmacro() - - if(ARROW_WITH_BROTLI) -- resolve_dependency(Brotli) -+ resolve_dependency(brotli) - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon -+ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon - INTERFACE_INCLUDE_DIRECTORIES) -- include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) -+ include_directories(SYSTEM ${brotli_INCLUDE_DIR}) - endif() - - if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET) -@@ -1200,9 +1210,10 @@ if(ARROW_NEED_GFLAGS) - endif() - endif() - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) -+ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) -+ set(GFLAGS_LIBRARIES ${gflags_LIBRARIES}) - -- if(NOT TARGET ${GFLAGS_LIBRARIES}) -+ if(0) - if(TARGET gflags-shared) - set(GFLAGS_LIBRARIES gflags-shared) - elseif(TARGET gflags_shared) -@@ -1291,12 +1302,13 @@ endmacro() - if(ARROW_WITH_THRIFT) - # We already may have looked for Thrift earlier, when considering whether - # to build Boost, so don't look again if already found. -- if(NOT Thrift_FOUND AND NOT THRIFT_FOUND) -+ if(0) - # Thrift c++ code generated by 0.13 requires 0.11 or greater - resolve_dependency(Thrift REQUIRED_VERSION 0.11.0) - endif() -+ find_package(Thrift CONFIG REQUIRED) - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) -+ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) - endif() - - # ---------------------------------------------------------------------- -@@ -1461,6 +1473,7 @@ endif() - # jemalloc - Unix-only high-performance allocator - - if(ARROW_JEMALLOC) -+if(0) - message(STATUS "Building (vendored) jemalloc from source") - # We only use a vendored jemalloc as we want to control its version. - # Also our build of jemalloc is specially prefixed so that it will not -@@ -1519,12 +1532,18 @@ if(ARROW_JEMALLOC) - add_dependencies(jemalloc::jemalloc jemalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) -+else() -+ find_package(jemalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- - # mimalloc - Cross-platform high-performance allocator, from Microsoft - - if(ARROW_MIMALLOC) -+if(0) - message(STATUS "Building (vendored) mimalloc from source") - # We only use a vendored mimalloc as we want to control its build options. - -@@ -1572,6 +1591,11 @@ if(ARROW_MIMALLOC) - add_dependencies(toolchain mimalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) -+else() -+ find_package(mimalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -1971,11 +1995,16 @@ macro(build_lz4) - endmacro() - - if(ARROW_WITH_LZ4) -- resolve_dependency(Lz4) -+ resolve_dependency(lz4) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) -- include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) -+ if(TARGET LZ4::lz4_static) -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) -+ else() -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) -+ endif() -+ include_directories(SYSTEM ${lz4_INCLUDE_DIR}) -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${lz4_LIBRARIES_TARGETS} ) - endif() - - macro(build_zstd) -@@ -2090,10 +2119,10 @@ macro(build_re2) - endmacro() - - if(ARROW_GANDIVA) -- resolve_dependency(RE2) -+ resolve_dependency(re2) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(RE2_INCLUDE_DIR RE2::re2 INTERFACE_INCLUDE_DIRECTORIES) -+ get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${RE2_INCLUDE_DIR}) - endif() - -@@ -2541,17 +2570,24 @@ if(ARROW_WITH_GRPC) - endif() - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) -+ if(grpc_INCLUDE_DIRS_RELEASE) -+ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_RELEASE}) -+ elseif(grpc_INCLUDE_DIRS_DEBUG) -+ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_DEBUG}) -+ endif() -+ - include_directories(SYSTEM ${GRPC_INCLUDE_DIR}) -+ include_directories(SYSTEM ${absl_INCLUDE_DIR}) -+ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) - - if(GRPC_VENDORED) - set(GRPCPP_PP_INCLUDE TRUE) - else() - # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp - # depending on the gRPC version. -- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") -+ if(EXISTS ${gRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE TRUE) -- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") -+ elseif(EXISTS ${gRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE FALSE) - else() - message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") -diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt -index 2751254..842fc9e 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -307,10 +307,14 @@ set(ARROW_TESTING_SRCS - - set(_allocator_dependencies "") # Empty list - if(ARROW_JEMALLOC) -- list(APPEND _allocator_dependencies jemalloc_ep) -+ list(APPEND _allocator_dependencies jemalloc::jemalloc) - endif() - if(ARROW_MIMALLOC) -- list(APPEND _allocator_dependencies mimalloc_ep) -+ if (TARGET mimalloc-static) -+ list(APPEND _allocator_dependencies mimalloc-static) -+ else() -+ list(APPEND _allocator_dependencies mimalloc) -+ endif() - endif() - - if(_allocator_dependencies) -diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc -index 784bf7b..8f005a5 100644 ---- a/cpp/src/arrow/memory_pool.cc -+++ b/cpp/src/arrow/memory_pool.cc -@@ -31,7 +31,7 @@ - // Needed to support jemalloc 3 and 4 - #define JEMALLOC_MANGLE - // Explicitly link to our version of jemalloc --#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" -+#include "jemalloc/jemalloc.h" - #endif - - #ifdef ARROW_MIMALLOC diff --git a/recipes/arrow/all/test_package/CMakeLists.txt b/recipes/arrow/all/test_package/CMakeLists.txt index 9b721bbe6a17c..bd890a4dd57e5 100644 --- a/recipes/arrow/all/test_package/CMakeLists.txt +++ b/recipes/arrow/all/test_package/CMakeLists.txt @@ -4,7 +4,13 @@ project(test_package LANGUAGES CXX) find_package(Arrow REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE arrow::arrow) + +if (TARGET Arrow::arrow_shared) + target_link_libraries(${PROJECT_NAME} PRIVATE Arrow::arrow_shared) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE Arrow::arrow_static) +endif() + if (${Arrow_VERSION} VERSION_LESS "10.0.0") target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) else() diff --git a/recipes/arrow/config.yml b/recipes/arrow/config.yml index fdbc85ca26541..9ee5f53ad1cbe 100644 --- a/recipes/arrow/config.yml +++ b/recipes/arrow/config.yml @@ -1,4 +1,8 @@ versions: + "16.1.0": + folder: all + "16.0.0": + folder: all "15.0.0": folder: all "14.0.2": @@ -25,7 +29,3 @@ versions: folder: all "7.0.0": folder: all - "2.0.0": - folder: all - "1.0.0": - folder: all diff --git a/recipes/artery-font-format/all/conandata.yml b/recipes/artery-font-format/all/conandata.yml index b248576ab34a5..d7128685d341e 100644 --- a/recipes/artery-font-format/all/conandata.yml +++ b/recipes/artery-font-format/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1": + url: "https://github.com/Chlumsky/artery-font-format/archive/v1.1.tar.gz" + sha256: "cd8eb58590d85069312b831ce5bc6eba21778ef2fa8ca8ac06e1ecf8eca53a7c" "1.0.1": url: "https://github.com/Chlumsky/artery-font-format/archive/v1.0.1.tar.gz" sha256: "23dc9450d2364c9f1a67fcb0ae8f2bef365fabc5a3f4af55d9a646f8fbcdc537" diff --git a/recipes/artery-font-format/all/conanfile.py b/recipes/artery-font-format/all/conanfile.py index 0b2ff0a648da1..ec8583e598e0b 100644 --- a/recipes/artery-font-format/all/conanfile.py +++ b/recipes/artery-font-format/all/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.tools.build import check_min_cppstd from conan.tools.files import get, copy import os @@ -7,24 +8,29 @@ class ArteryFontFormatConan(ConanFile): name = "artery-font-format" + description = "Artery Atlas Font format library" license = "MIT" - homepage = "https://github.com/Chlumsky/artery-font-format" url = "https://github.com/conan-io/conan-center-index" - description = "Artery Atlas Font format library" - topics = ("artery", "font", "atlas") + homepage = "https://github.com/Chlumsky/artery-font-format" + topics = ("artery", "font", "atlas", "header-only") package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + return 11 + 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): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build(self): - # header only: no build step - pass - def package(self): copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) copy( @@ -39,3 +45,7 @@ def package(self): 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/artery-font-format/all/test_package/CMakeLists.txt b/recipes/artery-font-format/all/test_package/CMakeLists.txt index 240a8cec38d93..d7b8e200d1115 100644 --- a/recipes/artery-font-format/all/test_package/CMakeLists.txt +++ b/recipes/artery-font-format/all/test_package/CMakeLists.txt @@ -4,5 +4,5 @@ project(test_package LANGUAGES CXX) find_package(artery-font-format REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} artery-font-format::artery-font-format) +target_link_libraries(${PROJECT_NAME} PRIVATE 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 26110ca175735..3a91c9439218e 100644 --- a/recipes/artery-font-format/all/test_package/conanfile.py +++ b/recipes/artery-font-format/all/test_package/conanfile.py @@ -4,7 +4,6 @@ import os -# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" @@ -24,5 +23,4 @@ def build(self): def test(self): 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(f"{bin_path} {arfont}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/artery-font-format/all/test_package/example.arfont b/recipes/artery-font-format/all/test_package/example.arfont deleted file mode 100644 index a1530434762b6..0000000000000 Binary files a/recipes/artery-font-format/all/test_package/example.arfont and /dev/null differ diff --git a/recipes/artery-font-format/all/test_package/test_package.cpp b/recipes/artery-font-format/all/test_package/test_package.cpp index 8e85c6f96e501..ff1d420aff0b0 100644 --- a/recipes/artery-font-format/all/test_package/test_package.cpp +++ b/recipes/artery-font-format/all/test_package/test_package.cpp @@ -1,32 +1,9 @@ -#include -#include #include #include -#include int main(int argc, char *argv[]) { - if (argc < 2) { - std::cerr << "usage: test_package \n"; - return EXIT_FAILURE; - } - - FILE *const font_file = fopen(argv[1], "rb"); - if (font_file == nullptr) { - std::cerr << "couldn't open font file" << std::endl; - return EXIT_FAILURE; - } - - artery_font::StdArteryFont font; - if (!artery_font::read(font, font_file)) { - std::cerr << "couldn't read artery font" << std::endl; - return EXIT_FAILURE; - } - - if (fclose(font_file) != 0) { - std::cerr << "an error occured when closing font file" << std::endl; - return EXIT_FAILURE; - } - - return EXIT_SUCCESS; + auto list = artery_font::StdList(5); + std::cout << "There are " << list.length() << " elements in the list" << std::endl; + return EXIT_SUCCESS; } diff --git a/recipes/artery-font-format/config.yml b/recipes/artery-font-format/config.yml index 7b06dd8bf61ea..3c69caf4158b5 100644 --- a/recipes/artery-font-format/config.yml +++ b/recipes/artery-font-format/config.yml @@ -1,4 +1,6 @@ versions: + "1.1": + folder: all "1.0.1": folder: all "1.0": diff --git a/recipes/asio/all/conandata.yml b/recipes/asio/all/conandata.yml index 5d0a18b1c54ce..2701f5013ce40 100644 --- a/recipes/asio/all/conandata.yml +++ b/recipes/asio/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.30.2": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-30-2.tar.gz" + sha256: "755bd7f85a4b269c67ae0ea254907c078d408cce8e1a352ad2ed664d233780e8" + "1.30.1": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-30-1.tar.gz" + sha256: "94b121cc2016680f2314ef58eadf169c2d34fff97fba01df325a192d502d3a58" "1.29.0": url: "https://github.com/chriskohlhoff/asio/archive/asio-1-29-0.tar.gz" sha256: "44305859b4e6664dbbf853c1ef8ca0259d694f033753ae309fcb2534ca20f721" diff --git a/recipes/asio/config.yml b/recipes/asio/config.yml index 5385ba9219644..1655f339efad7 100644 --- a/recipes/asio/config.yml +++ b/recipes/asio/config.yml @@ -1,4 +1,8 @@ versions: + "1.30.2": + folder: all + "1.30.1": + folder: all "1.29.0": folder: all "1.28.2": diff --git a/recipes/asmjit/all/conandata.yml b/recipes/asmjit/all/conandata.yml index c714f763c3707..0e6689d1ee9fc 100644 --- a/recipes/asmjit/all/conandata.yml +++ b/recipes/asmjit/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20240531": + url: "https://github.com/asmjit/asmjit/archive/d6c5be2212b9a50ba56ec6d1e9b68693c62136c1.zip" + sha256: "678549712d4708d0513fb0017d03211df415387aea4c031923d4dd5c07b43db6" "cci.20230325": url: "https://github.com/asmjit/asmjit/archive/51b10b19b6631434d3f9ad536a6fb140944a36d2.zip" sha256: "4f62b1b6247864417fb50a2928d541ccf8e9273b0c3ce36ccd443c9d6ca7bc9a" diff --git a/recipes/asmjit/all/conanfile.py b/recipes/asmjit/all/conanfile.py index ad8cb46dcf24d..5461e75517fb2 100644 --- a/recipes/asmjit/all/conanfile.py +++ b/recipes/asmjit/all/conanfile.py @@ -2,20 +2,20 @@ 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 +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os required_conan_version = ">=1.53.0" - class AsmjitConan(ConanFile): name = "asmjit" description = "AsmJit is a lightweight library for machine code " \ "generation written in C++ language." license = "Zlib" topics = ("asmjit", "compiler", "assembler", "jit") - homepage = "https://asmjit.com" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://asmjit.com" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -27,6 +27,16 @@ class AsmjitConan(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + } + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -40,7 +50,14 @@ def layout(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + check_min_cppstd(self, self._min_cppstd) + + if self.version >= "cci.20240531": + 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} does not support {self.settings.compiler}/{self.settings.compiler.version}." + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/asmjit/all/test_package/CMakeLists.txt b/recipes/asmjit/all/test_package/CMakeLists.txt index 39640d23a5929..f8fba8f71f0a1 100644 --- a/recipes/asmjit/all/test_package/CMakeLists.txt +++ b/recipes/asmjit/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(asmjit REQUIRED CONFIG) diff --git a/recipes/asmjit/all/test_package/test_package.cpp b/recipes/asmjit/all/test_package/test_package.cpp index 4b85962e0942d..f6d920ca6d627 100644 --- a/recipes/asmjit/all/test_package/test_package.cpp +++ b/recipes/asmjit/all/test_package/test_package.cpp @@ -1,27 +1,16 @@ -#include +#include -#include - -typedef int (*Func)(void); +#include "asmjit/asmjit.h" int main(int argc, char* argv[]) { asmjit::JitRuntime rt; - asmjit::CodeHolder code; code.init(rt.environment()); - asmjit::x86::Assembler a(&code); - a.mov(asmjit::x86::eax, 1); - a.ret(); - - Func fn; - asmjit::Error err = rt.add(&fn, &code); - if (err) return 1; - - int result = fn(); - printf("%d\n", result); - - rt.release(fn); + std::cout << + unsigned((ASMJIT_LIBRARY_VERSION >> 16)) << "." << + unsigned((ASMJIT_LIBRARY_VERSION >> 8) & 0xFF) << "." << + unsigned((ASMJIT_LIBRARY_VERSION ) & 0xFF) << "\n"; return 0; } diff --git a/recipes/asmjit/config.yml b/recipes/asmjit/config.yml index ea0049ba18227..03449364f4128 100644 --- a/recipes/asmjit/config.yml +++ b/recipes/asmjit/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20240531": + folder: all "cci.20230325": folder: all "cci.20221111": diff --git a/recipes/assimp/5.x/conandata.yml b/recipes/assimp/5.x/conandata.yml index 42aa3dd3fee85..503614eeac72a 100644 --- a/recipes/assimp/5.x/conandata.yml +++ b/recipes/assimp/5.x/conandata.yml @@ -1,18 +1,16 @@ sources: + "5.4.1": + url: "https://github.com/assimp/assimp/archive/refs/tags/v5.4.1.tar.gz" + sha256: "a1bf71c4eb851ca336bba301730cd072b366403e98e3739d6a024f6313b8f954" "5.3.1": url: "https://github.com/assimp/assimp/archive/refs/tags/v5.3.1.tar.gz" sha256: "a07666be71afe1ad4bc008c2336b7c688aca391271188eb9108d0c6db1be53f1" "5.2.5": url: "https://github.com/assimp/assimp/archive/refs/tags/v5.2.5.tar.gz" sha256: "b5219e63ae31d895d60d98001ee5bb809fb2c7b2de1e7f78ceeb600063641e1a" - "5.2.2": - url: "https://github.com/assimp/assimp/archive/refs/tags/v5.2.2.tar.gz" - sha256: "ad76c5d86c380af65a9d9f64e8fc57af692ffd80a90f613dfc6bd945d0b80bb4" "5.1.6": url: "https://github.com/assimp/assimp/archive/refs/tags/v5.1.6.tar.gz" sha256: "52ad3a3776ce320c8add531dbcb2d3b93f2e1f10fcff5ac30178b09ba934d084" patches: - "5.2.2": - - patch_file: "patches/0005-fix-unzip.patch" "5.1.6": - patch_file: "patches/0005-fix-unzip.patch" diff --git a/recipes/assimp/5.x/conanfile.py b/recipes/assimp/5.x/conanfile.py index 9d8d654edce03..67b7cd93c924b 100644 --- a/recipes/assimp/5.x/conanfile.py +++ b/recipes/assimp/5.x/conanfile.py @@ -2,8 +2,9 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import stdcpp_library, check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir, save -from conan.tools.microsoft import is_msvc +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os @@ -205,31 +206,47 @@ def validate(self): if Version(self.version) < "5.3.0" and self._depends_on_clipper and Version(self.dependencies["clipper"].ref.version).major != "4": raise ConanInvalidConfiguration("Only 'clipper/4.x' is supported") + def build_requirements(self): + if Version(self.version) >= "5.4.0": + self.tool_requires("cmake/[>=3.22 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) - tc.variables["ASSIMP_HUNTER_ENABLED"] = False - tc.variables["ASSIMP_IGNORE_GIT_HASH"] = True - tc.variables["ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR"] = False tc.variables["ASSIMP_ANDROID_JNIIOSYSTEM"] = False tc.variables["ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT"] = False tc.variables["ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT"] = False tc.variables["ASSIMP_BUILD_ASSIMP_TOOLS"] = False + tc.variables["ASSIMP_BUILD_DOCS"] = False + tc.variables["ASSIMP_BUILD_DRACO"] = False + tc.variables["ASSIMP_BUILD_FRAMEWORK"] = False + tc.variables["ASSIMP_BUILD_MINIZIP"] = False tc.variables["ASSIMP_BUILD_SAMPLES"] = False tc.variables["ASSIMP_BUILD_TESTS"] = False + tc.variables["ASSIMP_BUILD_ZLIB"] = False tc.variables["ASSIMP_DOUBLE_PRECISION"] = self.options.double_precision + tc.variables["ASSIMP_HUNTER_ENABLED"] = False + tc.variables["ASSIMP_IGNORE_GIT_HASH"] = True + tc.variables["ASSIMP_INJECT_DEBUG_POSTFIX"] = False + tc.variables["ASSIMP_INSTALL"] = True tc.variables["ASSIMP_INSTALL_PDB"] = False tc.variables["ASSIMP_NO_EXPORT"] = False - tc.variables["ASSIMP_BUILD_MINIZIP"] = False + tc.variables["ASSIMP_OPT_BUILD_PACKAGES"] = False + tc.variables["ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR"] = False + tc.variables["ASSIMP_UBSAN"] = False + tc.variables["ASSIMP_WARNINGS_AS_ERRORS"] = False + tc.variables["USE_STATIC_CRT"] = is_msvc_static_runtime(self) + for option, (definition, _) in self._format_option_map.items(): value = self.options.get_safe(option) if value is not None: tc.variables[definition] = value if self.settings.os == "Windows": tc.preprocessor_definitions["NOMINMAX"] = 1 - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" # to avoid warnings + if Version(self.version) < "5.4.0": + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.cache_variables["CMAKE_PROJECT_Assimp_INCLUDE"] = "conan_deps.cmake" tc.cache_variables["WITH_CLIPPER"] = self._depends_on_clipper @@ -246,24 +263,25 @@ def generate(self): cd.set_property("utfcpp", "cmake_target_name", "utf8cpp::utf8cpp") cd.generate() + venv = VirtualBuildEnv(self) + venv.generate() + def _patch_sources(self): apply_conandata_patches(self) # Don't force several compiler and linker flags - replace_mapping = [ - ("-fPIC", ""), - ("-g ", ""), - ("/WX", ""), - ("-Werror", ""), - ("SET(CMAKE_POSITION_INDEPENDENT_CODE ON)", ""), - ('SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Ob2 /DEBUG:FULL /Zi")', ""), - ('SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")', ""), - ('SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")', ""), - ('SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /PDBALTPATH:%_PDB% /OPT:REF /OPT:ICF")', ""), - ] - for before, after in replace_mapping: - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), before, after, strict=False) - replace_in_file(self, os.path.join(self.source_folder, "code", "CMakeLists.txt"), before, after, strict=False) + for pattern in [ + "-fPIC", + "-g ", + "SET(CMAKE_POSITION_INDEPENDENT_CODE ON)", + 'SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")', + 'SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /PDBALTPATH:%_PDB% /OPT:REF /OPT:ICF")', + ]: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), pattern, "") + + for pattern in ["-Werror", "/WX"]: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), pattern, "") + replace_in_file(self, os.path.join(self.source_folder, "code", "CMakeLists.txt"), pattern, "") # Make sure vendored libs are not used by accident by removing their subdirs allow_vendored = ["Open3DGC"] @@ -298,6 +316,8 @@ def _patch_sources(self): ]: save(self, os.path.join(self.source_folder, "contrib", contrib_header), f"#include <{include}>\n") + if Version(self.version) >= "5.4.0": + rmdir(self, self.source_path.joinpath("contrib", "utf8cpp")) # minizip is provided via conan_deps.cmake, no need to use pkgconfig replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), diff --git a/recipes/assimp/config.yml b/recipes/assimp/config.yml index c3337bd62baf1..e3725a7b77888 100644 --- a/recipes/assimp/config.yml +++ b/recipes/assimp/config.yml @@ -1,9 +1,9 @@ versions: + "5.4.1": + folder: "5.x" "5.3.1": folder: "5.x" "5.2.5": folder: "5.x" - "5.2.2": - folder: "5.x" "5.1.6": folder: "5.x" diff --git a/recipes/astc-codec/all/test_package/atlas_small_4x4.astc b/recipes/astc-codec/all/test_package/atlas_small_4x4.astc deleted file mode 100644 index 0dd080b12d23f..0000000000000 Binary files a/recipes/astc-codec/all/test_package/atlas_small_4x4.astc and /dev/null differ diff --git a/recipes/astc-codec/all/test_package/conanfile.py b/recipes/astc-codec/all/test_package/conanfile.py index 9f50bbe4c73b2..98ab55852ad56 100644 --- a/recipes/astc-codec/all/test_package/conanfile.py +++ b/recipes/astc-codec/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - bees = os.path.join(self.source_folder, "atlas_small_4x4.astc") - self.run(f"{bin_path} {bees} 256 256", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/astc-codec/all/test_package/test_package.cpp b/recipes/astc-codec/all/test_package/test_package.cpp index ec0a2e3ad6195..266f4473a5391 100644 --- a/recipes/astc-codec/all/test_package/test_package.cpp +++ b/recipes/astc-codec/all/test_package/test_package.cpp @@ -8,21 +8,13 @@ int main(int argc, char **argv) { - if (argc < 4) { - std::cerr << "Need at least three argument\n"; - } - std::ifstream stream(argv[1], std::ios::in | std::ios::binary); + std::ifstream stream("fake-file.astc", std::ios::in | std::ios::binary); std::vector astc_data((std::istreambuf_iterator(stream)), std::istreambuf_iterator()); - const size_t width = std::stoi(argv[2]); - const size_t height = std::stoi(argv[3]); - - std::vector result; - result.resize(width * height * 4); - bool success = astc_codec::ASTCDecompressToRGBA( - astc_data.data(), astc_data.size(), width, height, astc_codec::FootprintType::k4x4, - result.data(), result.size(), /* stride */ width * 4); + astc_data.data(), 100, 100, 100, astc_codec::FootprintType::k4x4, NULL, 100, 100); + + std::cout << "Test: " << success << std::endl; stream.close(); diff --git a/recipes/astc-codec/all/test_v1_package/conanfile.py b/recipes/astc-codec/all/test_v1_package/conanfile.py index 3605ef5403092..38f4483872d47 100644 --- a/recipes/astc-codec/all/test_v1_package/conanfile.py +++ b/recipes/astc-codec/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - bees = os.path.join(self.source_folder, os.pardir, "test_package", "atlas_small_4x4.astc") - self.run(f"{bin_path} {bees} 256 256", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/astro-informatics-so3/all/conandata.yml b/recipes/astro-informatics-so3/all/conandata.yml index 044d46996e9be..7fd6407fb8411 100644 --- a/recipes/astro-informatics-so3/all/conandata.yml +++ b/recipes/astro-informatics-so3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.6": + url: "https://github.com/astro-informatics/so3/archive/v1.3.6.tar.gz" + sha256: "9a8536b9998d54e7b61313548df01e989f07e15116ad49b471d7e321999f5f35" "1.3.4": url: "https://github.com/astro-informatics/so3/archive/refs/tags/v1.3.4.zip" sha256: "383431c3078faa073c3017ceb3e0108885ab7628e81af13488f9aa021b95bbc7" diff --git a/recipes/astro-informatics-so3/all/conanfile.py b/recipes/astro-informatics-so3/all/conanfile.py index e7486ed5b8c5a..a00f6ada8c83c 100644 --- a/recipes/astro-informatics-so3/all/conanfile.py +++ b/recipes/astro-informatics-so3/all/conanfile.py @@ -17,14 +17,12 @@ class AstroInformaticsSO3(ConanFile): homepage = "https://github.com/astro-informatics/so3" topics = ("physics", "astrophysics", "radio interferometry") - package_type = "library" + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { - "shared": [True, False], "fPIC": [True, False], } default_options = { - "shared": False, "fPIC": True, } @@ -40,8 +38,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("ssht/1.4.0", transitive_headers=True) - self.requires("fftw/3.3.9") + self.requires("ssht/1.5.2", transitive_headers=True, transitive_libs=True) + self.requires("fftw/3.3.10") def validate(self): if is_msvc(self): @@ -68,9 +66,7 @@ def build(self): cmake.build() def package(self): - copy(self, "LICENSE", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() diff --git a/recipes/astro-informatics-so3/config.yml b/recipes/astro-informatics-so3/config.yml index a81e52666d075..f8568797580a5 100644 --- a/recipes/astro-informatics-so3/config.yml +++ b/recipes/astro-informatics-so3/config.yml @@ -1,3 +1,5 @@ versions: + "1.3.6": + folder: all "1.3.4": folder: all diff --git a/recipes/async_simple/all/conandata.yml b/recipes/async_simple/all/conandata.yml index b0f536ac75473..4befe3006ae91 100644 --- a/recipes/async_simple/all/conandata.yml +++ b/recipes/async_simple/all/conandata.yml @@ -1,5 +1,16 @@ sources: + "1.3": + url: "https://github.com/alibaba/async_simple/archive/refs/tags/v1.3.tar.gz" + sha256: "0BA0DC3397882611B538D04B8EE6668B1A04CE046128599205184C598B718743" + "1.2": + url: "https://github.com/alibaba/async_simple/archive/refs/tags/1.2.tar.gz" + sha256: "a59a2674ac2b0a3997b90873b2bf0fbe4d96fdedbe6a2628c16c92a65a3fa39a" "1.0.0": - url: - - "https://github.com/alibaba/async_simple/archive/refs/tags/1.0.tar.gz" + url: "https://github.com/alibaba/async_simple/archive/refs/tags/1.0.tar.gz" sha256: "b243fb7af5d61b534fe18b662d16498392bbce1deffdc68e58829aa31db7badf" +patches: + "1.0.0": + - patch_file: "patches/disable-asan-1.0.patch" + patch_description: "Add option for disabling address sanitizer in root CMakeLists" + patch_type: "portability" + patch_source: "https://github.com/alibaba/async_simple/commit/ccb760356b9d7481ca73f0c58d15928bf8b0aa0b" diff --git a/recipes/async_simple/all/conanfile.py b/recipes/async_simple/all/conanfile.py index 52e7c0ae4b223..f0da3ed24785b 100644 --- a/recipes/async_simple/all/conanfile.py +++ b/recipes/async_simple/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import check_min_vs, is_msvc -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rename, replace_in_file from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.layout import basic_layout @@ -18,9 +18,18 @@ class AsyncSimpleConan(ConanFile): homepage = "https://github.com/alibaba/async_simple" topics = ("modules", "asynchronous", "coroutines", "cpp20", "header-only") - package_type = "header-library" + package_type = "library" settings = "os", "arch", "compiler", "build_type" - no_copy_source = True + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": True + } @property def _min_cppstd(self): @@ -29,6 +38,8 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): return { + "Visual Studio": "17", + "msvc": "193", "gcc": "10.3", "clang": "13", "apple-clang": "14", @@ -37,59 +48,111 @@ def _compilers_minimum_version(self): def export_sources(self): export_conandata_patches(self) - def layout(self): - basic_layout(self, src_folder="src") + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.header_only: + self.options.rm_safe("fPIC") + self.options.rm_safe("shared") + elif self.options.shared: + self.options.rm_safe("fPIC") - def requirements(self): - pass + def layout(self): + if self.options.header_only: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") def package_id(self): - self.info.clear() + if self.info.options.header_only: + self.info.clear() def validate(self): - if self.settings.compiler.cppstd: + if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, self._min_cppstd) - 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." - ) - else: - raise ConanInvalidConfiguration("msvc not supported now") - - def build_requirements(self): - pass + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") + if not self.options.header_only and self.settings.os == "Windows": + raise ConanInvalidConfiguration(f'{self.ref} cannot use uthread on Windows, and therefore it\'s only supported as a header-only library in this configuration with "{self.name}/*:header_only=True"') def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): + if not self.options.header_only: + tc = CMakeToolchain(self) + tc.cache_variables["ASYNC_SIMPLE_BUILD_DEMO_EXAMPLE"] = False + tc.cache_variables["ASYNC_SIMPLE_ENABLE_TESTS"] = False + tc.cache_variables["ASYNC_SIMPLE_ENABLE_ASAN"] = False + #libaio is only used in SimpleIOExecutor which is only used in executor tests and not meant for end users + tc.cache_variables["ASYNC_SIMPLE_DISABLE_AIO"] = True + tc.generate() + def build(self): apply_conandata_patches(self) + if not self.options.header_only: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), '-D_GLIBCXX_USE_CXX11_ABI=1', '') + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - copy( - self, - pattern="*.h", + + if self.options.header_only: + hCopyExcludes = ("test", "uthread", "executors") + if not self.options.header_only: + hCopyExcludes = ("test", "executors") + if self.options.shared: + if self.settings.os == "Macos": + sharedLibExt = "*.dylib*" + else: + sharedLibExt = "*.so*" + copy(self, pattern=sharedLibExt, + dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(self.build_folder, "async_simple") + ) + else: + copy(self, pattern="*.a", + dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(self.build_folder, "async_simple") + ) + libTarget = os.path.join(self.package_folder, "lib", "libasync_simple.a") + if not os.path.isfile(libTarget): + rename(self, os.path.join(self.package_folder, "lib", "libasync_simple_static.a"), + libTarget) + + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include/async_simple"), src=os.path.join(self.source_folder, "async_simple"), - excludes=("test", "executors", "uthread") + excludes=hCopyExcludes ) def package_info(self): - self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] - self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] + if not self.options.header_only: + self.cpp_info.libs = ["async_simple"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] self.cpp_info.set_property("cmake_file_name", "async_simple") - self.cpp_info.set_property("cmake_target_name", "async_simple::async_simple") + if self.options.header_only: + self.cpp_info.set_property("cmake_target_name", "async_simple::async_simple_header_only") + + self.cpp_info.components["_async_simple"].names["cmake_find_package"] = "async_simple_header_only" + self.cpp_info.components["_async_simple"].names["cmake_find_package_multi"] = "async_simple_header_only" + self.cpp_info.components["_async_simple"].set_property("cmake_target_name", "async_simple::async_simple_header_only") + else: + self.cpp_info.set_property("cmake_target_name", "async_simple::async_simple") + + self.cpp_info.components["_async_simple"].names["cmake_find_package"] = "async_simple" + self.cpp_info.components["_async_simple"].names["cmake_find_package_multi"] = "async_simple" + self.cpp_info.components["_async_simple"].set_property("cmake_target_name", "async_simple::async_simple") self.cpp_info.filenames["cmake_find_package"] = "async_simple" self.cpp_info.filenames["cmake_find_package_multi"] = "async_simple" self.cpp_info.names["cmake_find_package"] = "async_simple" self.cpp_info.names["cmake_find_package_multi"] = "async_simple" - self.cpp_info.components["_async_simple"].names["cmake_find_package"] = "async_simple_header_only" - self.cpp_info.components["_async_simple"].names["cmake_find_package_multi"] = "async_simple_header_only" - self.cpp_info.components["_async_simple"].set_property("cmake_target_name", "async_simple::async_simple_header_only") diff --git a/recipes/async_simple/all/patches/disable-asan-1.0.patch b/recipes/async_simple/all/patches/disable-asan-1.0.patch new file mode 100644 index 0000000000000..ce18632f1b35d --- /dev/null +++ b/recipes/async_simple/all/patches/disable-asan-1.0.patch @@ -0,0 +1,21 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,11 +106,13 @@ + #list(APPEND deplibs "-m64") + endif() + endif() +- +-if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") +- if (CMAKE_BUILD_TYPE STREQUAL "Debug") +- message("-- Use flag -fsanitize=address") +- list(APPEND CXX_FLAGS "-fsanitize=address") ++option(ASYNC_SIMPLE_ENABLE_ASAN "enable asan in debug when compiler is not msvc" ON) ++if (ASYNC_SIMPLE_ENABLE_ASAN) ++ if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") ++ if (CMAKE_BUILD_TYPE STREQUAL "Debug") ++ message("-- Use flag -fsanitize=address") ++ list(APPEND CXX_FLAGS "-fsanitize=address") ++ endif() + endif() + endif() + diff --git a/recipes/async_simple/all/test_package/CMakeLists.txt b/recipes/async_simple/all/test_package/CMakeLists.txt index 8b854aa258e40..ccb7b85dadd81 100644 --- a/recipes/async_simple/all/test_package/CMakeLists.txt +++ b/recipes/async_simple/all/test_package/CMakeLists.txt @@ -7,4 +7,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(async_simple REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE async_simple::async_simple_header_only) +if(ASYNC_SIMPLE_HEADER_ONLY) + target_link_libraries(test_package PRIVATE async_simple::async_simple_header_only) +else() + target_link_libraries(test_package PRIVATE async_simple::async_simple) +endif() diff --git a/recipes/async_simple/all/test_package/conanfile.py b/recipes/async_simple/all/test_package/conanfile.py index 1111583fea732..be622ed71cf62 100644 --- a/recipes/async_simple/all/test_package/conanfile.py +++ b/recipes/async_simple/all/test_package/conanfile.py @@ -1,13 +1,13 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout, CMake +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os # It will become the standard on Conan 2.x class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" def requirements(self): @@ -15,7 +15,12 @@ def requirements(self): def layout(self): cmake_layout(self) - + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ASYNC_SIMPLE_HEADER_ONLY"] = self.dependencies[self.tested_reference_str].options.header_only + tc.generate() + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/async_simple/config.yml b/recipes/async_simple/config.yml index 5d96905a31039..e526b1e8db52a 100644 --- a/recipes/async_simple/config.yml +++ b/recipes/async_simple/config.yml @@ -1,4 +1,8 @@ versions: # Newer versions at the top + "1.3": + folder: all + "1.2": + folder: all "1.0.0": folder: all diff --git a/recipes/asyncpp/all/conandata.yml b/recipes/asyncpp/all/conandata.yml new file mode 100644 index 0000000000000..4b083e872c16b --- /dev/null +++ b/recipes/asyncpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.2.4": + url: "https://github.com/petiaccja/asyncpp/archive/refs/tags/v0.2.4.tar.gz" + sha256: "58138FF5801D3A547EAAD9ADC2C30FE7A0D506C0E41DC56071CEAAD5747210B5" diff --git a/recipes/asyncpp/all/conanfile.py b/recipes/asyncpp/all/conanfile.py new file mode 100644 index 0000000000000..c8bb4abd89547 --- /dev/null +++ b/recipes/asyncpp/all/conanfile.py @@ -0,0 +1,102 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + + +class AsyncppRecipe(ConanFile): + name = "asyncpp" + description = "A C++20 coroutine library for asynchronous and parallel programming." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/project/package" + topics = ("coroutine", "c++20", "async", "parallel", "concurrency") + + 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": "13", + "clang": "17", + "msvc": "193", + "Visual Studio": "17", + } + + 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): + # src_folder must use the same source folder name the project + cmake_layout(self, src_folder="src") + + def validate(self): + # validate the minimum cpp standard supported. For C++ projects only + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if self.settings.compiler == "apple-clang": + # As per https://en.cppreference.com/w/cpp/compiler_support, apple-clang 14.0.0 partially supports C++20 but not jthread + raise ConanInvalidConfiguration(f"{self.ref} does not support apple-clang compiler, as it lacks jthread support.") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.25 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ASYNCPP_BUILD_TESTS"] = "OFF" + tc.variables["ASYNCPP_BUILD_BENCHMARKS"] = "OFF" + tc.generate() + venv = VirtualBuildEnv(self) + venv.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.install() + + def package_info(self): + self.cpp_info.libs = ["asyncpp"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.bindirs = ["libs"] + + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/asyncpp/all/test_package/CMakeLists.txt b/recipes/asyncpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5a4068e0dbcf7 --- /dev/null +++ b/recipes/asyncpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(TestPackage CXX) + +add_executable(test_package test_package.cpp) + +find_package(asyncpp CONFIG REQUIRED) +target_link_libraries(test_package asyncpp::asyncpp) +target_compile_features(test_package PUBLIC cxx_std_20) diff --git a/recipes/asyncpp/all/test_package/conanfile.py b/recipes/asyncpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..58dfdc09f139b --- /dev/null +++ b/recipes/asyncpp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class AsyncppTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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) + 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/asyncpp/all/test_package/test_package.cpp b/recipes/asyncpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..070acd2fe6b83 --- /dev/null +++ b/recipes/asyncpp/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include + +#include +#include + +using namespace asyncpp; + + +task message() { + co_return std::string("async++ installation works."); +} + + +int main() { + std::cout << join(message()) << std::endl; + return 0; +} diff --git a/recipes/asyncpp/config.yml b/recipes/asyncpp/config.yml new file mode 100644 index 0000000000000..a718e51b057ea --- /dev/null +++ b/recipes/asyncpp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.4": + folder: all diff --git a/recipes/audiofile/all/test_package/conanfile.py b/recipes/audiofile/all/test_package/conanfile.py index fb1d035fc5b12..d120a992c06a6 100644 --- a/recipes/audiofile/all/test_package/conanfile.py +++ b/recipes/audiofile/all/test_package/conanfile.py @@ -22,5 +22,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - wav_path = os.path.join(self.source_folder, "sine.wav") - self.run(f"{bin_path} {wav_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/audiofile/all/test_package/sine.wav b/recipes/audiofile/all/test_package/sine.wav deleted file mode 100644 index a3225d12bf297..0000000000000 Binary files a/recipes/audiofile/all/test_package/sine.wav and /dev/null differ diff --git a/recipes/audiofile/all/test_package/test_package.cpp b/recipes/audiofile/all/test_package/test_package.cpp index d95bc64031cda..906aa9efa0327 100644 --- a/recipes/audiofile/all/test_package/test_package.cpp +++ b/recipes/audiofile/all/test_package/test_package.cpp @@ -1,18 +1,15 @@ // workaround for a missing include in v1.0.9 and earlier +#include +#include #include - #include -#include + int main(int argc, char **argv) { - if (argc < 2) { - std::cerr << "Need at least one argument" << std::endl; - return 1; - } AudioFile audioFile; - audioFile.load(argv[1]); + audioFile.load("fake-file.wav"); audioFile.printSummary(); return 0; } diff --git a/recipes/audiofile/all/test_v1_package/conanfile.py b/recipes/audiofile/all/test_v1_package/conanfile.py index 21642db6ce1ba..38f4483872d47 100644 --- a/recipes/audiofile/all/test_v1_package/conanfile.py +++ b/recipes/audiofile/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - wav_path = os.path.join(self.source_folder, os.pardir, "test_package", "sine.wav") - self.run(f"{bin_path} {wav_path}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/autoconf/all/conandata.yml b/recipes/autoconf/all/conandata.yml index 48a99f0a3f908..9d182df49e442 100644 --- a/recipes/autoconf/all/conandata.yml +++ b/recipes/autoconf/all/conandata.yml @@ -1,9 +1,13 @@ sources: "2.72": - url: "https://ftpmirror.gnu.org/autoconf/autoconf-2.72.tar.xz" + url: + - "https://ftpmirror.gnu.org/autoconf/autoconf-2.72.tar.xz" + - "https://ftp.gnu.org/gnu/autoconf/autoconf-2.72.tar.xz" sha256: "ba885c1319578d6c94d46e9b0dceb4014caafe2490e437a0dbca3f270a223f5a" "2.71": - url: "https://ftpmirror.gnu.org/autoconf/autoconf-2.71.tar.xz" + url: + - "https://ftpmirror.gnu.org/autoconf/autoconf-2.71.tar.xz" + - "https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.xz" sha256: "f14c83cfebcc9427f2c3cea7258bd90df972d92eb26752da4ddad81c87a0faa4" patches: "2.72": diff --git a/recipes/avahi/all/conanfile.py b/recipes/avahi/all/conanfile.py index 6dfd0f410cd70..2920eabb9e448 100644 --- a/recipes/avahi/all/conanfile.py +++ b/recipes/avahi/all/conanfile.py @@ -45,8 +45,8 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.78.1") - self.requires("expat/2.5.0") + self.requires("glib/2.78.3") + self.requires("expat/[>=2.6.2 <3]") self.requires("libdaemon/0.14") self.requires("dbus/1.15.8") self.requires("gdbm/1.23") diff --git a/recipes/avcpp/all/conandata.yml b/recipes/avcpp/all/conandata.yml index 1ba5e69f511c2..59d5eecbaffc4 100644 --- a/recipes/avcpp/all/conandata.yml +++ b/recipes/avcpp/all/conandata.yml @@ -1,17 +1,24 @@ sources: + "2.3.2": + url: "https://github.com/h4tr3d/avcpp/archive/refs/tags/v2.3.2.tar.gz" + sha256: "ce1a7296e6b1bf808ad4f9f486723c88e4cd12d80a96e226635ce3316ca73733" + "2.3.0": + url: "https://github.com/h4tr3d/avcpp/archive/refs/tags/v2.3.0.tar.gz" + sha256: "8ecb98caa9640a21772562c326f7c1f6ad99cd7f15d7ea40fe37d114fabbe2b5" "2.1.0": url: "https://github.com/h4tr3d/avcpp/archive/refs/tags/v2.1.0.tar.gz" sha256: "8398217dccb9f5b4cbb41e5bf4f73f47b461ed3ba8c3aefdda9f9dd714649855" - "cci.20220301": - url: "https://github.com/h4tr3d/avcpp/archive/fd4bc4662eb39853de8fcac4a663bebd0eea30b8.tar.gz" - sha256: "e48eae2ec154bc69aed16159c8b18c9ffb4925ba672b022e94a3c9b96782a4bf" patches: - "2.1.0": - - patch_file: "patches/2.1.0-fix-ffmpeg.patch" + "2.3.2": + - patch_file: "patches/2.3.0-fix-ffmpeg.patch" + patch_description: "fix ffmpeg package name and remove ffmpeg from install targets" + patch_type: "conan" + "2.3.0": + - patch_file: "patches/2.3.0-fix-ffmpeg.patch" patch_description: "fix ffmpeg package name and remove ffmpeg from install targets" patch_type: "conan" - "cci.20220301": - - patch_file: "patches/cci.20220301-fix-ffmpeg.patch" + "2.1.0": + - patch_file: "patches/2.1.0-fix-ffmpeg.patch" patch_description: "fix ffmpeg package name and remove ffmpeg from install targets" patch_type: "conan" diff --git a/recipes/avcpp/all/conanfile.py b/recipes/avcpp/all/conanfile.py index e1479bc47146c..dfef33000726b 100644 --- a/recipes/avcpp/all/conanfile.py +++ b/recipes/avcpp/all/conanfile.py @@ -56,7 +56,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("ffmpeg/5.0") + self.requires("ffmpeg/6.1", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -68,6 +68,10 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) + def build_requirements(self): + if Version(self.version) >= "2.2.0": + self.tool_requires("cmake/[>=3.19 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/avcpp/all/patches/2.3.0-fix-ffmpeg.patch b/recipes/avcpp/all/patches/2.3.0-fix-ffmpeg.patch new file mode 100644 index 0000000000000..e316cd9d624ba --- /dev/null +++ b/recipes/avcpp/all/patches/2.3.0-fix-ffmpeg.patch @@ -0,0 +1,46 @@ +diff --git CMakeLists.txt CMakeLists.txt +index b086352..91d3165 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -9,8 +9,6 @@ endif() + + project(AvCpp LANGUAGES CXX VERSION ${AVCPP_VERSION}) + +-set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) +- + set(FFMPEG_PKG_CONFIG_SUFFIX "" CACHE STRING "This suffix uses for FFmpeg component names searches by pkg-config") + set(AV_ENABLE_STATIC On CACHE BOOL "Enable static library build (On)") + set(AV_ENABLE_SHARED On CACHE BOOL "Enable shared library build (On)") +@@ -31,8 +29,8 @@ set (AVCPP_WARNING_OPTIONS + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads) + +-find_package(FFmpeg +- COMPONENTS AVCODEC AVFORMAT AVUTIL AVDEVICE AVFILTER SWSCALE SWRESAMPLE REQUIRED) ++find_package(ffmpeg ++ COMPONENTS avcodec avformat avutil avdevice avfilter swscale swresample REQUIRED) + + add_subdirectory(src) + +diff --git src/CMakeLists.txt src/CMakeLists.txt +index 3c00150..c3818cf 100644 +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -29,7 +29,7 @@ foreach(TARGET ${AV_TARGETS}) + + target_compile_options(${TARGET} PRIVATE ${AVCPP_WARNING_OPTIONS}) + target_compile_definitions(${TARGET} PUBLIC __STDC_CONSTANT_MACROS) +- target_link_libraries(${TARGET} PRIVATE Threads::Threads PUBLIC FFmpeg::FFmpeg) ++ target_link_libraries(${TARGET} PRIVATE Threads::Threads PUBLIC ffmpeg::ffmpeg) + target_include_directories(${TARGET} + PUBLIC + $ +@@ -58,7 +58,7 @@ if (AVCPP_NOT_SUBPROJECT) + # APPEND + # FILE ${CMAKE_CURRENT_BINARY_DIR}/avcpp-targets.cmake) + +- install(TARGETS ${AV_TARGETS} FFmpeg ++ install(TARGETS ${AV_TARGETS} + EXPORT avcpp-targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/recipes/avcpp/all/patches/cci.20220301-fix-ffmpeg.patch b/recipes/avcpp/all/patches/cci.20220301-fix-ffmpeg.patch deleted file mode 100644 index 3207ead4b4610..0000000000000 --- a/recipes/avcpp/all/patches/cci.20220301-fix-ffmpeg.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a5fed05..d077b96 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,7 +6,7 @@ endif() - - project(AvCpp LANGUAGES CXX VERSION 2.0.99) - --set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) -+# set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) - - set(FFMPEG_PKG_CONFIG_SUFFIX "" CACHE STRING "This suffix uses for FFmpeg component names searches by pkg-config") - set(AV_ENABLE_STATIC On CACHE BOOL "Enable static library build (On)") -@@ -28,8 +28,8 @@ set (AVCPP_WARNING_OPTIONS - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads) - --find_package(FFmpeg -- COMPONENTS AVCODEC AVFORMAT AVUTIL AVDEVICE AVFILTER SWSCALE SWRESAMPLE REQUIRED) -+find_package(ffmpeg -+ COMPONENTS avcodec avformat avutil avdevice avfilter swscale swresample REQUIRED) - - add_subdirectory(src) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 80c6faa..262c16c 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -24,7 +24,7 @@ foreach(TARGET ${AV_TARGETS}) - add_library(${TARGET} ${TYPE} ${AV_SOURCES} ${AV_HEADERS}) - - target_compile_options(${TARGET} PRIVATE ${AVCPP_WARNING_OPTIONS}) -- target_link_libraries(${TARGET} PRIVATE Threads::Threads PUBLIC FFmpeg::FFmpeg) -+ target_link_libraries(${TARGET} PRIVATE Threads::Threads PUBLIC ffmpeg::ffmpeg) - target_include_directories(${TARGET} - PUBLIC - $ -@@ -53,7 +53,7 @@ if (AVCPP_NOT_SUBPROJECT) - # APPEND - # FILE ${CMAKE_CURRENT_BINARY_DIR}/avcpp-targets.cmake) - -- install(TARGETS ${AV_TARGETS} FFmpeg -+ install(TARGETS ${AV_TARGETS} - EXPORT avcpp-targets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/recipes/avcpp/config.yml b/recipes/avcpp/config.yml index deb0eb011c7ea..38cdb450f8142 100644 --- a/recipes/avcpp/config.yml +++ b/recipes/avcpp/config.yml @@ -1,5 +1,7 @@ versions: - "2.1.0": + "2.3.2": + folder: all + "2.3.0": folder: all - "cci.20220301": + "2.1.0": folder: all diff --git a/recipes/aws-c-cal/all/conanfile.py b/recipes/aws-c-cal/all/conanfile.py index de7ce7d5e222d..82f0949981b96 100644 --- a/recipes/aws-c-cal/all/conanfile.py +++ b/recipes/aws-c-cal/all/conanfile.py @@ -50,8 +50,11 @@ def layout(self): def requirements(self): if Version(self.version) <= "0.5.20": self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) - else: + elif Version(self.version) <= "0.6.1": self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) + else: + # [>=0.9.7] + self.requires("aws-c-common/0.9.12", transitive_headers=True, transitive_libs=True) if self._needs_openssl: self.requires("openssl/[>=1.1 <4]") diff --git a/recipes/aws-kvs-pic/all/conandata.yml b/recipes/aws-kvs-pic/all/conandata.yml index 4be3843841ab1..5e5052a1a9680 100644 --- a/recipes/aws-kvs-pic/all/conandata.yml +++ b/recipes/aws-kvs-pic/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://github.com/awslabs/amazon-kinesis-video-streams-pic/archive/refs/tags/v1.1.0.tar.gz" + sha256: "ef45723cd439f855bae2304d9488b68cd6d1e0dc3203c97ebd1cbb26197edb55" "1.0.1": url: "https://github.com/awslabs/amazon-kinesis-video-streams-pic/archive/refs/tags/v1.0.1.tar.gz" sha256: "d04732217c74687c5498665b353cb089d725ca7f5b5da61a3f984f7fbefb2ac9" diff --git a/recipes/aws-kvs-pic/all/conanfile.py b/recipes/aws-kvs-pic/all/conanfile.py index a0653e082edea..e8a1073232807 100644 --- a/recipes/aws-kvs-pic/all/conanfile.py +++ b/recipes/aws-kvs-pic/all/conanfile.py @@ -4,6 +4,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rmdir, replace_in_file +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -72,6 +73,10 @@ def package_info(self): self.cpp_info.components["kvspic"].set_property("pkg_config_name", "libkvspic") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["kvspic"].system_libs = ["dl", "rt", "pthread"] + + if Version(self.version) >= "1.1.0": + if self.settings.build_type == "Debug": + self.cpp_info.components["kvspic"].defines = ["DEBUG_BUILD"] self.cpp_info.components["kvspicClient"].libs = ["kvspicClient"] self.cpp_info.components["kvspicClient"].set_property("pkg_config_name", "libkvspicClient") diff --git a/recipes/aws-kvs-pic/config.yml b/recipes/aws-kvs-pic/config.yml index 42adf0e62a4df..f7630e1054b00 100644 --- a/recipes/aws-kvs-pic/config.yml +++ b/recipes/aws-kvs-pic/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.0": + folder: all "1.0.1": folder: all "cci.20210812": diff --git a/recipes/azure-sdk-for-cpp/all/CMakeLists.txt b/recipes/azure-sdk-for-cpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..46e5bc05a5d70 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.15) +project(cmake_wrapper) + +# The cmake_wrapper allows users to build only modules they want and not the entire sdk, +# the CMakeLists.txt from source does not provide this modularity to users (it's all or nothing). + +foreach(sdk ${BUILD_LIST}) + if(${sdk} STREQUAL azure-core) + # Always build Core + add_subdirectory("src/sdk/core") + elseif(${sdk} STREQUAL azure-storage-common) + add_subdirectory("src/sdk/storage/azure-storage-common") + elseif(${sdk} STREQUAL azure-storage-blobs) + add_subdirectory("src/sdk/storage/azure-storage-blobs") + elseif(${sdk} STREQUAL azure-storage-files-shares) + add_subdirectory("src/sdk/storage/azure-storage-files-shares") + endif() +endforeach() diff --git a/recipes/azure-sdk-for-cpp/all/conandata.yml b/recipes/azure-sdk-for-cpp/all/conandata.yml new file mode 100644 index 0000000000000..62ba6f53644b1 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.11.3": + url: "https://github.com/Azure/azure-sdk-for-cpp/archive/refs/tags/azure-core_1.11.3.tar.gz" + sha256: "c67e42622bf1ebafee29aa09f333e41adc24712b0c993ada5dd97c9265b444cc" diff --git a/recipes/azure-sdk-for-cpp/all/conanfile.py b/recipes/azure-sdk-for-cpp/all/conanfile.py new file mode 100644 index 0000000000000..48f2abf1a5de9 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/conanfile.py @@ -0,0 +1,110 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + +AZURE_SDK_MODULES = ( + "azure-storage-common", + "azure-storage-blobs", + "azure-storage-files-shares" +) + +class AzureSDKForCppConan(ConanFile): + name = "azure-sdk-for-cpp" + description = "Microsoft Azure Storage Client Library for C++" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Azure/azure-sdk-for-cpp" + topics = ("azure", "cpp", "cross-platform", "microsoft", "cloud") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + options.update({_name: [True, False] for _name in AZURE_SDK_MODULES}) + default_options = {"shared": False, "fPIC": True} + default_options.update({_name: True for _name in AZURE_SDK_MODULES}) # Build all modules by default, let users pick what they do not want + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def configure(self): + if self.options.get_safe("shared"): + self.options.rm_safe("fPIC") + + def requirements(self): + self.requires("openssl/[>=1.1 <4]") + self.requires("libcurl/[>=7.78 <9]") + self.requires("libxml2/[>=2.12.5 <3]") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + # Open to contributions for windows and apple + if self.settings.os != "Linux": + raise ConanInvalidConfiguration( + f"{self.ref} Conan recipe in ConanCenter still does not support {self.settings.os}, contributions to the recipe welcome.") + + if self.settings.compiler != "gcc": + raise ConanInvalidConfiguration( + f"{self.ref} Conan recipe in ConanCenter still does not support {self.settings.compiler}, contributions to the recipe welcome.") + + if self.settings.compiler == 'gcc' and Version(self.settings.compiler.version) < "6": + raise ConanInvalidConfiguration("Building requires GCC >= 6") + + def generate(self): + tc = CMakeToolchain(self) + + build_list = ["azure-core"] + for sdk in AZURE_SDK_MODULES: + if self.options.get_safe(sdk): + build_list.append(sdk) + tc.cache_variables["BUILD_LIST"] = ";".join(build_list) + + tc.variables["AZ_ALL_LIBRARIES"] = "ON" + tc.variables["FETCH_SOURCE_DEPS"] = "OFF" + tc.cache_variables["BUILD_TESTING"] = "OFF" + tc.cache_variables["BUILD_WINDOWS_UWP"] = "ON" + tc.cache_variables["DISABLE_AZURE_CORE_OPENTELEMETRY"] = "ON" + tc.cache_variables["BUILD_TRANSPORT_CURL"] = "ON" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", + 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "AzureSDK") + + # core component + self.cpp_info.components["azure-core"].set_property("cmake_target_name", "Azure::azure-core") + self.cpp_info.components["azure-core"].libs = ["azure-core"] + self.cpp_info.components["azure-core"].requires.extend(["openssl::openssl", "libcurl::curl", "libxml2::libxml2"]) + + enabled_sdks = [sdk for sdk in AZURE_SDK_MODULES if self.options.get_safe(sdk)] + for sdk in enabled_sdks: + self.cpp_info.components[sdk].set_property("cmake_target_name", f"Azure::{sdk}") + self.cpp_info.components[sdk].libs = [sdk] diff --git a/recipes/azure-sdk-for-cpp/all/test_package/CMakeLists.txt b/recipes/azure-sdk-for-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8347b50cbb47d --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.8) + +project(test_package LANGUAGES CXX) + +find_package(AzureSDK CONFIG REQUIRED) + +add_executable(test_azure-core test_azure-core.cc) +target_link_libraries(test_azure-core PRIVATE Azure::azure-core) + +add_executable(test_azure-storage-common test_azure-storage-common.cc) +target_link_libraries(test_azure-storage-common PRIVATE Azure::azure-core Azure::azure-storage-common) + +add_executable(test_azure-storage-blobs test_azure-storage-blobs.cc) +target_link_libraries(test_azure-storage-blobs PRIVATE Azure::azure-core Azure::azure-storage-common Azure::azure-storage-blobs) + +add_executable(test_azure-storage-files-shares test_azure-storage-files-shares.cc) +target_link_libraries(test_azure-storage-files-shares PRIVATE Azure::azure-core Azure::azure-storage-common Azure::azure-storage-files-shares) diff --git a/recipes/azure-sdk-for-cpp/all/test_package/conanfile.py b/recipes/azure-sdk-for-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2dfe88d001d05 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/test_package/conanfile.py @@ -0,0 +1,33 @@ +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" + + @property + def _tested_modules(self): + return ["azure-core", + "azure-storage-common", + "azure-storage-blobs", + "azure-storage-files-shares"] + + 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): + for module in self._tested_modules: + bin_path = os.path.join(self.cpp.build.bindirs[0], f"test_{module}") + self.run(bin_path, env="conanrun") diff --git a/recipes/azure-sdk-for-cpp/all/test_package/test_azure-core.cc b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-core.cc new file mode 100644 index 0000000000000..bfd5501b81141 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-core.cc @@ -0,0 +1,10 @@ +#include +#include + +int main() +{ + std::vector data = {1, 2, 3, 4}; + Azure::Core::IO::MemoryBodyStream stream(data); + + return 0; +} diff --git a/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-blobs.cc b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-blobs.cc new file mode 100644 index 0000000000000..23cc6b485edbc --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-blobs.cc @@ -0,0 +1,10 @@ +#include + +using namespace Azure::Storage::Blobs; + +int main() +{ + BlobAudience audience{"TEST"}; + + return 0; +} diff --git a/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-common.cc b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-common.cc new file mode 100644 index 0000000000000..5fdbe6d99f6dc --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-common.cc @@ -0,0 +1,10 @@ +#include + +using namespace Azure::Storage; + +int main() +{ + ContentHash contentHash{}; + + return 0; +} diff --git a/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-files-shares.cc b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-files-shares.cc new file mode 100644 index 0000000000000..00034be2a0119 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-files-shares.cc @@ -0,0 +1,10 @@ +#include + +using namespace Azure::Storage::Files::Shares; + +int main() +{ + SetSharePropertiesOptions options; + + return 0; +} diff --git a/recipes/azure-sdk-for-cpp/config.yml b/recipes/azure-sdk-for-cpp/config.yml new file mode 100644 index 0000000000000..dc736edb41043 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.11.3": + folder: "all" diff --git a/recipes/b2/config.yml b/recipes/b2/config.yml index fc7ada07a386e..0e3bbe203df45 100644 --- a/recipes/b2/config.yml +++ b/recipes/b2/config.yml @@ -9,3 +9,9 @@ versions: folder: portable "5.0.0": folder: portable + "5.1.0": + folder: portable + "5.2.0": + folder: portable + "5.2.1": + folder: portable diff --git a/recipes/b2/portable/conandata.yml b/recipes/b2/portable/conandata.yml index 4bd954865dc3a..18e6c7ae29c82 100644 --- a/recipes/b2/portable/conandata.yml +++ b/recipes/b2/portable/conandata.yml @@ -14,3 +14,12 @@ sources: "5.0.0": url: "https://github.com/bfgroup/b2/releases/download/5.0.0/b2-5.0.0.tar.bz2" sha256: "1ef867f7d374345a948baca025ed277dadda05a68439aa383a06aceb9911f7d3" + "5.1.0": + url: "https://github.com/bfgroup/b2/releases/download/5.1.0/b2-5.1.0.tar.bz2" + sha256: "8429a2e7c9c4484f6a4bd7fb18743f0ea1dba41eb024479a9b23381bcb813623" + "5.2.0": + url: "https://github.com/bfgroup/b2/releases/download/5.2.0/b2-5.2.0.tar.bz2" + sha256: "c27adfb4e667d748bb7d3e18657938fa8bcf185b74a29bf091113299f532ed6d" + "5.2.1": + url: "https://github.com/bfgroup/b2/releases/download/5.2.1/b2-5.2.1.tar.bz2" + sha256: "6428edec31731aa479b4e7d8f83898831a0919352ec7d7f9874145abe165a578" diff --git a/recipes/b2/portable/conanfile.py b/recipes/b2/portable/conanfile.py index eb45936017eef..68803d254a16d 100644 --- a/recipes/b2/portable/conanfile.py +++ b/recipes/b2/portable/conanfile.py @@ -21,6 +21,8 @@ class B2Conan(ConanFile): url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch" + package_type = "application" + ''' * use_cxx_env: False, True @@ -193,6 +195,7 @@ def build(self): def package(self): copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.LICENSE", src=self._b2_engine_dir, dst=os.path.join(self.package_folder, "licenses")) copy(self, "*b2", dst=self._pkg_bin_dir, src=self._b2_output_dir) copy(self, "*b2.exe", dst=self._pkg_bin_dir, src=self._b2_output_dir) copy(self, "*.jam", dst=self._pkg_bin_dir, src=self._b2_output_dir) diff --git a/recipes/b2/portable/test_package/.gitignore b/recipes/b2/portable/test_package/.gitignore new file mode 100644 index 0000000000000..c97f963b3da62 --- /dev/null +++ b/recipes/b2/portable/test_package/.gitignore @@ -0,0 +1 @@ +*.sh diff --git a/recipes/basu/all/conandata.yml b/recipes/basu/all/conandata.yml new file mode 100644 index 0000000000000..3da511b3e486b --- /dev/null +++ b/recipes/basu/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "0.2.1": + url: "https://git.sr.ht/~emersion/basu/refs/download/v0.2.1/basu-0.2.1.tar.gz" + sha256: "d9b373a9fcb5d5eb5f6c1c56355f76edb7f2f52bc744570e80604e83455a19bd" + +patches: + "0.2.1": + - patch_file: "patches/0001-memfd-util.c-Use-F_ADD_SEALS-definition-from-missing.patch" + patch_description: "add missing header to support old glibc" + patch_type: "portability" + patch_source: "https://lists.sr.ht/~emersion/public-inbox/patches/49899" diff --git a/recipes/basu/all/conanfile.py b/recipes/basu/all/conanfile.py new file mode 100644 index 0000000000000..5fbf09d93352b --- /dev/null +++ b/recipes/basu/all/conanfile.py @@ -0,0 +1,97 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +import os + + +required_conan_version = ">=1.53.0" + + +class BasuConan(ConanFile): + name = "basu" + description = "The sd-bus library, extracted from systemd" + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://git.sr.ht/~emersion/basu" + topics = ("dbus", "sd-bus", "systemd") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libcap": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libcap": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os != "Linux": + del self.options.with_libcap + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.get_safe("with_libcap"): + self.requires("libcap/2.69") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration( + f"{self.ref} does not support {self.settings.os}") + + def build_requirements(self): + self.tool_requires("meson/1.3.2") + self.tool_requires("gperf/3.1") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + feature = lambda option: "enabled" if option else "disabled" + + tc = MesonToolchain(self) + tc.project_options["auto_features"] = "disabled" + tc.project_options["libcap"] = feature(self.options.get_safe("with_libcap")) + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "LICENSE.LGPL2.1", self.source_folder, + os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["basu"] + self.cpp_info.set_property("pkg_config_name", "basu") + self.cpp_info.system_libs.extend(["m", "pthread", "rt"]) diff --git a/recipes/basu/all/patches/0001-memfd-util.c-Use-F_ADD_SEALS-definition-from-missing.patch b/recipes/basu/all/patches/0001-memfd-util.c-Use-F_ADD_SEALS-definition-from-missing.patch new file mode 100644 index 0000000000000..69e899279f1ae --- /dev/null +++ b/recipes/basu/all/patches/0001-memfd-util.c-Use-F_ADD_SEALS-definition-from-missing.patch @@ -0,0 +1,34 @@ +From 8e4960e8b9d11d9be96e83b02bd3b08178ddce1b Mon Sep 17 00:00:00 2001 +From: Sergey Bobrenok +Date: Wed, 28 Feb 2024 20:42:19 +0300 +Subject: [PATCH basu] memfd-util.c: Use F_ADD_SEALS definition from missing.h + +uClibc and glibc (until version 2.27, 2018) implementations don't +support F_ADD_SEALS and other F_SEAL_xxx flags. +'missing.h' was removed from 'memfd-util.c' in 37dbb2fcb ("Remove +useless includes"). + +Upstream: https://lists.sr.ht/~emersion/public-inbox/patches/49899 + +Signed-off-by: Sergey Bobrenok +--- + src/basic/memfd-util.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/basic/memfd-util.c b/src/basic/memfd-util.c +index 89893ba..7e535c6 100644 +--- a/src/basic/memfd-util.c ++++ b/src/basic/memfd-util.c +@@ -7,6 +7,7 @@ + + #include "alloc-util.h" + #include "memfd-util.h" ++#include "missing.h" + + int memfd_set_sealed(int fd) { + #if defined(__FreeBSD__) && __FreeBSD__ < 13 + +base-commit: 684a41d68cfbb05e38aacb60a8548e21ddfbecdb +-- +2.44.0 + diff --git a/recipes/basu/all/test_package/conanfile.py b/recipes/basu/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cdcf9b281723d --- /dev/null +++ b/recipes/basu/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "PkgConfigDeps", "MesonToolchain", "VirtualRunEnv", "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires("meson/1.3.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/basu/all/test_package/meson.build b/recipes/basu/all/test_package/meson.build new file mode 100644 index 0000000000000..adf0ed21b4bcd --- /dev/null +++ b/recipes/basu/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +package_dep = dependency('basu') +executable('test_package', + sources : ['test_package.c'], + dependencies : [package_dep]) diff --git a/recipes/basu/all/test_package/test_package.c b/recipes/basu/all/test_package/test_package.c new file mode 100644 index 0000000000000..9fe70e4d4a1ce --- /dev/null +++ b/recipes/basu/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include +#include + +#include + +int main(void) { + char *id = NULL; + int ret = 0; + + puts("decode object path"); + ret = sd_bus_path_decode("/foo/bar", "/foo", &id); + free(id); + if (ret > 0) { + puts("ok"); + return EXIT_SUCCESS; + } + puts("failed"); + return EXIT_FAILURE; +} diff --git a/recipes/basu/config.yml b/recipes/basu/config.yml new file mode 100644 index 0000000000000..f975c1e3261f7 --- /dev/null +++ b/recipes/basu/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.1": + folder: all diff --git a/recipes/beauty/all/conandata.yml b/recipes/beauty/all/conandata.yml index ba365a8d82861..42c96b3a5b488 100644 --- a/recipes/beauty/all/conandata.yml +++ b/recipes/beauty/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.4": + url: "https://github.com/dfleury2/beauty/archive/refs/tags/1.0.4.tar.gz" + sha256: "8bfd3718470bdbed05b6b9253543d6ab9b33e21e25028e53fa513c67893a39f3" "1.0.3": url: "https://github.com/dfleury2/beauty/archive/refs/tags/1.0.3.tar.gz" sha256: "1707b0974537cfd8d1d2fd0b5accd5a662c0b408042aa01384cf5840ecc43594" @@ -6,8 +9,19 @@ sources: url: "https://github.com/dfleury2/beauty/archive/refs/tags/1.0.2.tar.gz" sha256: "627294d04a91c85e14d9c29475d539da5172c6d7306a48dca7c72413e47eebd6" patches: + "1.0.4": + - patch_file: "patches/0002-remove-openssl-target.patch" + patch_description: "Avoid defining openssl::openssl target when defined by Conan" + patch_type: "conan" + "1.0.3": + - patch_file: "patches/0002-remove-openssl-target.patch" + patch_description: "Avoid defining openssl::openssl target when defined by Conan" + patch_type: "conan" "1.0.2": - patch_file: "patches/0001-apple-compatibility.patch" patch_description: "Handle pthread_setname_np not being defined on macOS" patch_type: "portability" patch_source: "https://github.com/dfleury2/beauty/pull/28" + - patch_file: "patches/0002-remove-openssl-target.patch" + patch_description: "Avoid defining openssl::openssl target when defined by Conan" + patch_type: "conan" diff --git a/recipes/beauty/all/conanfile.py b/recipes/beauty/all/conanfile.py index cb6e4434731c3..f8b9acb4c99ef 100644 --- a/recipes/beauty/all/conanfile.py +++ b/recipes/beauty/all/conanfile.py @@ -23,23 +23,26 @@ class BeautyConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_openssl": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_openssl": True, } @property def _min_cppstd(self): - return "20" + return "17" @property def _compilers_minimum_version(self): return { "gcc": "8", - "clang": "11", + "clang": "7", "Visual Studio": "16", "msvc": "192", + "apple-clang": "10" } def export_sources(self): @@ -59,9 +62,14 @@ def layout(self): def requirements(self): # beauty public headers include some boost headers. # For example beauty/application.hpp includes boost/asio.hpp - self.requires("boost/1.83.0", transitive_headers=True) - # dependency of asio in boost, exposed in boost/asio/ssl/detail/openssl_types.hpp - self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True) + if Version(self.version) >= "1.0.4": + # https://github.com/dfleury2/beauty/issues/30 + self.requires("boost/1.85.0", transitive_headers=True) + else: + self.requires("boost/1.84.0", transitive_headers=True) + if self.options.with_openssl: + # dependency of asio in boost, exposed in boost/asio/ssl/detail/openssl_types.hpp + self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -74,13 +82,13 @@ def validate(self): ) if self.settings.compiler == "clang" and self.settings.compiler.libcxx != "libc++": - raise ConanInvalidConfiguration("Only libc++ is supported for clang") + raise ConanInvalidConfiguration(f"{self.ref} clang compiler requires -s compiler.libcxx=libc++") if self.settings.compiler == "apple-clang" and self.options.shared: - raise ConanInvalidConfiguration("shared is not supported on apple-clang") + raise ConanInvalidConfiguration(f"The option {self.ref}:shared=True is not supported on Apple Clang. Use static instead.") if is_msvc(self) and self.options.shared: - raise ConanInvalidConfiguration("shared is not supported on Visual Studio") + raise ConanInvalidConfiguration(f"{self.ref} shared=True is not supported with {self.settings.compiler}") def build_requirements(self): self.tool_requires("cmake/[>=3.21 <4]") @@ -92,6 +100,7 @@ def generate(self): VirtualBuildEnv(self).generate() tc = CMakeToolchain(self) tc.variables["CONAN"] = False + tc.variables["BEAUTY_ENABLE_OPENSSL"] = self.options.with_openssl tc.generate() deps = CMakeDeps(self) deps.generate() @@ -112,6 +121,12 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "beauty") self.cpp_info.set_property("cmake_target_name", "beauty::beauty") self.cpp_info.libs = ["beauty"] - self.cpp_info.requires = ["boost::headers", "openssl::openssl"] + self.cpp_info.requires = ["boost::headers"] + if self.options.with_openssl: + self.cpp_info.requires.append("openssl::ssl") if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["m"] + self.cpp_info.system_libs = ["m", "pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["crypt32"] + if self.options.with_openssl: + self.cpp_info.defines = ["BEAUTY_ENABLE_OPENSSL"] diff --git a/recipes/beauty/all/patches/0002-remove-openssl-target.patch b/recipes/beauty/all/patches/0002-remove-openssl-target.patch new file mode 100644 index 0000000000000..28cfd66f4489f --- /dev/null +++ b/recipes/beauty/all/patches/0002-remove-openssl-target.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7cc5bda..12a5e71 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -27,7 +27,6 @@ else() + + if (BEAUTY_ENABLE_OPENSSL) + find_package(OpenSSL REQUIRED) +- add_library(openssl::openssl ALIAS OpenSSL::SSL) + endif() + endif() + diff --git a/recipes/beauty/all/test_package/CMakeLists.txt b/recipes/beauty/all/test_package/CMakeLists.txt index 8673671fd5aab..485e39c140276 100644 --- a/recipes/beauty/all/test_package/CMakeLists.txt +++ b/recipes/beauty/all/test_package/CMakeLists.txt @@ -5,4 +5,4 @@ find_package(beauty REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE beauty::beauty) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/beauty/config.yml b/recipes/beauty/config.yml index f625d5d2b747f..55b20570619c0 100644 --- a/recipes/beauty/config.yml +++ b/recipes/beauty/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.4": + folder: all "1.0.3": folder: all "1.0.2": diff --git a/recipes/behaviortree.cpp/all/conan_deps.cmake b/recipes/behaviortree.cpp/all/conan_deps.cmake new file mode 100644 index 0000000000000..1bfd028b22003 --- /dev/null +++ b/recipes/behaviortree.cpp/all/conan_deps.cmake @@ -0,0 +1,16 @@ +# Inject unvendored dependencies provided by Conan + +if(WITH_LEXY) + find_package(lexy REQUIRED CONFIG) + link_libraries(foonathan::lexy) +endif() + +if(WITH_MINITRACE) + find_package(minitrace REQUIRED CONFIG) + link_libraries(minitrace::minitrace) +endif() + +if(WITH_TINYXML2) + find_package(tinyxml2 REQUIRED CONFIG) + link_libraries(tinyxml2::tinyxml2) +endif() diff --git a/recipes/behaviortree.cpp/all/conandata.yml b/recipes/behaviortree.cpp/all/conandata.yml index 8e188b3097d43..25beb0006c60f 100644 --- a/recipes/behaviortree.cpp/all/conandata.yml +++ b/recipes/behaviortree.cpp/all/conandata.yml @@ -1,28 +1,19 @@ sources: + "4.6.1": + url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/4.6.1.tar.gz" + sha256: "a4e0dd92b200eedfbc6a16bebe613aeeb84b685416211b68fd097d21254f324b" + "4.6.0": + url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/4.6.0.tar.gz" + sha256: "b24fed4f51212ea40bc492f7d4a310b1672bc05df6a83f2341c41ccf233307a9" + "4.5.2": + url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/4.5.2.tar.gz" + sha256: "1aaac034fc6a2f03d9347934e3baf3cabd5edc8bb416b9d7f5d944598019aeb9" "4.0.1": url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/4.0.1.tar.gz" sha256: "71544f72abea8e8c246b016b7e8d87d96f731c8aa96698058d8e69d40e56f9b9" + "3.8.6": + url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/3.8.6.tar.gz" + sha256: "df01713e61aa3b6f4a637dcff31dfd3c96c3c05fac226da8566a873a24ccde27" "3.7.0": url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/3.7.0.tar.gz" sha256: "ab0d8ac1a0df4dd43cf45da8a784bab7fdedf711bd0e227f7ed071f79b0c7b5c" - "3.5.6": - url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/3.5.6.tar.gz" - sha256: "543c428602b5acb7c5666aee34feb532e18ce7200870a79b23ff9aed17ee84c4" -patches: - "4.0.1": - - patch_file: "patches/4.0.1-0001-remove-fpic.patch" - - patch_file: "patches/4.0.1-0002-find-zmq.patch" - - patch_file: "patches/4.0.1-0003-no-werror.patch" - - patch_file: "patches/3.5.6-0005-stdc-format.patch" - - patch_file: "patches/3.5.6-0005-stdc-format.patch" - "3.7.0": - - patch_file: "patches/3.7.0-0001-remove-fpic.patch" - - patch_file: "patches/3.7.0-0002-find-zmq.patch" - - patch_file: "patches/3.7.0-0003-no-werror.patch" - - patch_file: "patches/3.5.6-0005-stdc-format.patch" - "3.5.6": - - patch_file: "patches/3.5.6-0001-remove-fpic.patch" - - patch_file: "patches/3.5.6-0002-find-zmq.patch" - - patch_file: "patches/3.5.6-0003-no-werror.patch" - - patch_file: "patches/3.5.6-0004-win-sigaction.patch" - - patch_file: "patches/3.5.6-0005-stdc-format.patch" diff --git a/recipes/behaviortree.cpp/all/conanfile.py b/recipes/behaviortree.cpp/all/conanfile.py index 54f5ae5ad8322..219b2a799c6c6 100644 --- a/recipes/behaviortree.cpp/all/conanfile.py +++ b/recipes/behaviortree.cpp/all/conanfile.py @@ -1,8 +1,8 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import check_min_vs, is_msvc -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir -from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm +from conan.tools.build import check_min_cppstd, cross_building from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout @@ -17,45 +17,77 @@ class BehaviorTreeCPPConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/BehaviorTree/BehaviorTree.CPP" topics = ("ai", "robotics", "games", "coordination") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "with_tools": [True, False], "with_coroutines": [True, False], + "enable_groot_interface": [True, False], + "enable_sqlite_logging": [True, False], + "enable_manual_selector": [True, False], + "use_v3_compatible_names": [True, False], } default_options = { "shared": False, "fPIC": True, "with_tools": False, "with_coroutines": False, + "enable_groot_interface": True, + "enable_sqlite_logging": True, + "enable_manual_selector": False, + "use_v3_compatible_names": False, + } + options_description = { + "with_tools": "Build commandline tools", + "with_coroutines": "Enable Boost coroutines", + "enable_groot_interface": "Add Groot2 connection (requires ZeroMQ)", + "enable_sqlite_logging": "Add SQLite logging", + "enable_manual_selector": "Build manual selector node", + "use_v3_compatible_names": "Use v3 compatible names", } @property def _minimum_cppstd_required(self): - return 14 if Version(self.version) < "4.0" else 17 + if Version(self.version) >= "4.0": + return 17 + return 14 @property def _minimum_compilers_version(self): - if Version(self.version) < "4.0": + if Version(self.version) >= "4.0": return { - "gcc": "5", - "clang": "5", + "gcc": "8", + "clang": "7", "apple-clang": "12", + "msvc": "192", + "Visual Studio": "16", } else: return { - "gcc": "8", - "clang": "7", + "gcc": "5", + "clang": "5", "apple-clang": "12", + "msvc": "191", + "Visual Studio": "15", } def export_sources(self): - export_conandata_patches(self) + copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "4.0": + del self.options.use_v3_compatible_names + if Version(self.version) >= "4.1.0": + del self.options.with_coroutines + if Version(self.version) >= "4.1.1": + del self.options.enable_manual_selector + else: + del self.options.enable_groot_interface + del self.options.enable_sqlite_logging def configure(self): if self.options.shared: @@ -64,54 +96,150 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + @property + def _with_boost(self): + return self.options.get_safe("with_coroutines", False) + + @property + def _with_lexy(self): + # FIXME: using vendored version temporarily due to a missing CCI binary + # return Version(self.version) >= "4.0.0" + return False + + @property + def _with_minitrace(self): + return Version(self.version) >= "4.3.4" + + @property + def _with_ncurses(self): + return self.options.get_safe("enable_manual_selector", False) + + @property + def _with_sqlite3(self): + return self.options.get_safe("enable_sqlite_logging", False) + + @property + def _with_tinyxml2(self): + return Version(self.version) >= "4.0.0" + + @property + def _with_zeromq(self): + if Version(self.version) >= "4.1.1": + return self.options.enable_groot_interface + return Version(self.version) >= "4.0.0" + def requirements(self): - if self.options.with_coroutines: - self.requires("boost/1.80.0") - self.requires("ncurses/6.3") - self.requires("zeromq/4.3.4") - self.requires("cppzmq/4.9.0") + if self._with_boost: + self.requires("boost/1.83.0") + if self._with_ncurses: + self.requires("ncurses/6.4") + if self._with_lexy: + self.requires("foonathan-lexy/2022.12.1") + if self._with_minitrace: + self.requires("minitrace/cci.20230905") + if self._with_sqlite3: + self.requires("sqlite3/3.44.2") + if self._with_tinyxml2: + self.requires("tinyxml2/10.0.0") + if self._with_zeromq: + self.requires("zeromq/4.3.5") + + # TODO: other vendored dependencies + # - cppzmq is customized and not compatible with Conan version + # - cpp-sqlite + # - minicoro + # - wildcards def validate(self): if self.info.settings.os == "Windows" and self.info.options.shared: raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Windows.") if self.info.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._minimum_cppstd_required) - check_min_vs(self, 191 if Version(self.version) < "4.0" else 192) - if not is_msvc(self): - minimum_version = self._minimum_compilers_version.get(str(self.info.settings.compiler), False) - if not minimum_version: - self.output.warn(f"{self.ref} requires C++{self._minimum_cppstd_required}. Your compiler is unknown. Assuming it supports C++{self._minimum_cppstd_required}.") - elif Version(self.info.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("BehaviorTree.CPP requires C++{}, which your compiler does not support." - .format(self._minimum_cppstd_required)) + minimum_version = self._minimum_compilers_version.get(str(self.info.settings.compiler), False) + if not minimum_version: + self.output.warn(f"{self.ref} requires C++{self._minimum_cppstd_required}. " + f"Your compiler is unknown. Assuming it supports C++{self._minimum_cppstd_required}.") + elif Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"BehaviorTree.CPP requires C++{self._minimum_cppstd_required}, which your compiler does not support." + ) if self.settings.compiler == "clang" and str(self.settings .compiler.libcxx) == "libstdc++": raise ConanInvalidConfiguration(f"{self.ref} needs recent libstdc++ with charconv. please switch to gcc, or to libc++") + if self.settings.compiler == "apple-clang" and cross_building(self) and self.settings.arch in ["x86", "x86_64"]: + raise ConanInvalidConfiguration(f"Cross-compiling for {self.settings.arch} is not yet supported. Contributions are welcome!") + + def build_requirements(self): + if Version(self.version) >= "4.1.0": + self.tool_requires("cmake/[>=3.16.3 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def generate(self): + venv = VirtualBuildEnv(self) + venv.generate() + tc = CMakeToolchain(self) + tc.variables["CMAKE_PROJECT_behaviortree_cpp_INCLUDE"] = "conan_deps.cmake" + tc.variables["WITH_LEXY"] = self._with_lexy + tc.variables["WITH_MINITRACE"] = self._with_minitrace + tc.variables["WITH_TINYXML2"] = self._with_tinyxml2 + if not self.options.get_safe("enable_manual_selector"): + # Avoid accidental use of system ncurses + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_Curses"] = True if Version(self.version) < "4.0": tc.variables["BUILD_EXAMPLES"] = False tc.variables["BUILD_UNIT_TESTS"] = False tc.variables["BUILD_TOOLS"] = self.options.with_tools tc.variables["ENABLE_COROUTINES"] = self.options.with_coroutines + tc.variables["BUILD_MANUAL_SELECTOR"] = self.options.get_safe("enable_manual_selector", False) else: tc.variables["BTCPP_SHARED_LIBS"] = self.options.shared tc.variables["BTCPP_EXAMPLES"] = False tc.variables["BTCPP_UNIT_TESTS"] = False tc.variables["BTCPP_BUILD_TOOLS"] = self.options.with_tools - tc.variables["BTCPP_ENABLE_COROUTINES"] = self.options.with_coroutines + tc.variables["BTCPP_ENABLE_COROUTINES"] = self.options.get_safe("with_coroutines", False) + tc.variables["BTCPP_MANUAL_SELECTOR"] = self.options.get_safe("enable_manual_selector", False) + tc.variables["BTCPP_GROOT_INTERFACE"] = self.options.get_safe("enable_groot_interface", False) + tc.variables["BTCPP_SQLITE_LOGGING"] = self.options.get_safe("enable_sqlite_logging", False) + tc.variables["USE_V3_COMPATIBLE_NAMES"] = self.options.use_v3_compatible_names tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) + if Version(self.version) >= "4.1.0": + deps.set_property("zeromq", "cmake_file_name", "ZeroMQ") + else: + deps.set_property("zeromq", "cmake_file_name", "ZMQ") deps.generate() + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # Let Conan handle -fPIC + replace_in_file(self, cmakelists, "set(CMAKE_POSITION_INDEPENDENT_CODE ON)\n", "") + # Unvendor lexy + if self._with_lexy: + rmdir(self, os.path.join(self.source_folder, "3rdparty", "lexy")) + save(self, os.path.join(self.source_folder, "3rdparty", "lexy", "CMakeLists.txt"), "") + # Unvendor minitrace + if self._with_minitrace: + rmdir(self, os.path.join(self.source_folder, "3rdparty", "minitrace")) + replace_in_file(self, cmakelists, "3rdparty/minitrace/minitrace.cpp", "") + replace_in_file(self, os.path.join(self.source_folder, "src", "loggers", "bt_minitrace_logger.cpp"), + "minitrace/minitrace.h", "minitrace.h") + # Unvendor tinyxml2 + if self._with_tinyxml2: + rmdir(self, os.path.join(self.source_folder, "3rdparty", "tinyxml2")) + replace_in_file(self, cmakelists, "3rdparty/tinyxml2/tinyxml2.cpp", "") + replace_in_file(self, os.path.join(self.source_folder, "src", "xml_parsing.cpp"), + "tinyxml2/tinyxml2.h", "tinyxml2.h") + # Ensure ZeroMQ and other packages are provided by Conan + rm(self, "Find*.cmake", os.path.join(self.source_folder, "cmake")) + def build(self): - apply_conandata_patches(self) + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -125,39 +253,48 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - if Version(self.version) < "4.0": - self.cpp_info.set_property("cmake_file_name", "BehaviorTreeV3") + if Version(self.version) >= "4.0": + cmake_file_name = "BehaviorTree" + libname = "behaviortree_cpp" else: - self.cpp_info.set_property("cmake_file_name", "BehaviorTree") - - libname = "behaviortree_cpp_v3" if Version(self.version) < "4.0" else "behaviortree_cpp" + cmake_file_name = "BehaviorTreeV3" + libname = "behaviortree_cpp_v3" + self.cpp_info.set_property("cmake_file_name", cmake_file_name) self.cpp_info.set_property("cmake_target_name", f"BT::{libname}") + requires = [] + if self._with_boost: + requires.append("boost::coroutine") + if self._with_lexy: + requires.append("foonathan-lexy::foonathan-lexy") + if self._with_minitrace: + requires.append("minitrace::minitrace") + if self._with_ncurses: + requires.append("ncurses::ncurses") + if self._with_sqlite3: + requires.append("sqlite3::sqlite3") + if self._with_tinyxml2: + requires.append("tinyxml2::tinyxml2") + if self._with_zeromq: + requires.append("zeromq::zeromq") + postfix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" # TODO: back to global scope in conan v2 once cmake_find_package* generators removed self.cpp_info.components[libname].libs = [f"{libname}{postfix}"] - self.cpp_info.components[libname].requires = ["zeromq::zeromq", "cppzmq::cppzmq", "ncurses::ncurses"] - if self.options.with_coroutines: - self.cpp_info.components[libname].requires.append("boost::coroutine") + self.cpp_info.components[libname].requires = requires if self.settings.os in ("Linux", "FreeBSD"): - self.cpp_info.components[libname].system_libs.append("pthread") + self.cpp_info.components[libname].system_libs.extend(["pthread", "dl"]) if Version(self.version) >= "4.0" and \ self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": self.cpp_info.components[libname].system_libs.append("stdc++fs") if self.options.with_tools: bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env var with : {}".format(bin_path)) self.env_info.PATH.append(bin_path) # TODO: to remove in conan v2 once cmake_find_package* generators removed - if Version(self.version) < "4.0": - self.cpp_info.filenames["cmake_find_package"] = "BehaviorTreeV3" - self.cpp_info.filenames["cmake_find_package_multi"] = "BehaviorTreeV3" - else: - self.cpp_info.filenames["cmake_find_package"] = "BehaviorTree" - self.cpp_info.filenames["cmake_find_package_multi"] = "BehaviorTree" - + self.cpp_info.filenames["cmake_find_package"] = cmake_file_name + self.cpp_info.filenames["cmake_find_package_multi"] = cmake_file_name self.cpp_info.names["cmake_find_package"] = "BT" self.cpp_info.names["cmake_find_package_multi"] = "BT" self.cpp_info.components[libname].names["cmake_find_package"] = libname diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0001-remove-fpic.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0001-remove-fpic.patch deleted file mode 100644 index 7cb2daad955aa..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0001-remove-fpic.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a390aed..aff91ec 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -36,7 +36,6 @@ if(NOT DEFINED BT_COROUTINES) - add_definitions(-DBT_NO_COROUTINES) - endif() - --set(CMAKE_POSITION_INDEPENDENT_CODE ON) - - #---- project configuration ---- - option(BUILD_EXAMPLES "Build tutorials and examples" ON) diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0002-find-zmq.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0002-find-zmq.patch deleted file mode 100644 index c717020c8e00a..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0002-find-zmq.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index aff91ec..242c214 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -45,14 +45,14 @@ option(BUILD_SHARED_LIBS "Build shared libraries" ON) - - #---- Find other packages ---- - find_package(Threads) --find_package(ZMQ) -+find_package(ZeroMQ) - - list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES - ${CMAKE_THREAD_LIBS_INIT} - ${CMAKE_DL_LIBS} - ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - message(STATUS "ZeroMQ found.") - add_definitions( -DZMQ_FOUND ) - list(APPEND BT_SOURCE src/loggers/bt_zmq_publisher.cpp) -@@ -202,8 +202,8 @@ if (WIN32) - add_library(${BEHAVIOR_TREE_LIBRARY} STATIC ${BT_SOURCE} ) - endif() - --if( ZMQ_FOUND ) -- list(APPEND BUILD_TOOL_INCLUDE_DIRS ${ZMQ_INCLUDE_DIRS}) -+if( ZeroMQ_FOUND ) -+ list(APPEND BUILD_TOOL_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIRS}) - endif() - - target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC -@@ -211,7 +211,7 @@ target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC - - target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PRIVATE - ${Boost_LIBRARIES} -- ${ZMQ_LIBRARIES}) -+ ${ZeroMQ_LIBRARIES}) - - #get_target_property(my_libs ${BEHAVIOR_TREE_LIBRARY} INTERFACE_LINK_LIBRARIES) - #list(REMOVE_ITEM _libs X) -@@ -227,8 +227,8 @@ target_include_directories(${BEHAVIOR_TREE_LIBRARY} PUBLIC - $ - ${BUILD_TOOL_INCLUDE_DIRS}) - --if( ZMQ_FOUND ) -- target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZMQ_FOUND) -+if( ZeroMQ_FOUND ) -+ target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZeroMQ_FOUND) - endif() - - if(MSVC) -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 0801850..153b447 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -6,9 +6,9 @@ target_link_libraries(bt3_log_cat ${BEHAVIOR_TREE_LIBRARY} ) - install(TARGETS bt3_log_cat - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - add_executable(bt3_recorder bt_recorder.cpp ) -- target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZMQ_LIBRARIES}) -+ target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZeroMQ_LIBRARIES}) - install(TARGETS bt3_recorder - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - endif() diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0003-no-werror.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0003-no-werror.patch deleted file mode 100644 index 4996714060f93..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0003-no-werror.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 242c214..cb8d77a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -232,10 +232,10 @@ if( ZeroMQ_FOUND ) - endif() - - if(MSVC) -- target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE /W3 /WX) -+ target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE /W3) - else() - target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE -- -Wall -Wextra -Werror=return-type) -+ -Wall -Wextra) - endif() - - ###################################################### diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0004-win-sigaction.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0004-win-sigaction.patch deleted file mode 100644 index 75f9c74e55e10..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0004-win-sigaction.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/tools/bt_recorder.cpp b/tools/bt_recorder.cpp -index 3aa6740..4b36414 100644 ---- a/tools/bt_recorder.cpp -+++ b/tools/bt_recorder.cpp -@@ -16,12 +16,17 @@ static void s_signal_handler(int) - - static void CatchSignals(void) - { -+#ifdef _WIN32 -+ signal(SIGINT, s_signal_handler); -+ signal(SIGTERM, s_signal_handler); -+#else - struct sigaction action; - action.sa_handler = s_signal_handler; - action.sa_flags = 0; - sigemptyset(&action.sa_mask); - sigaction(SIGINT, &action, NULL); - sigaction(SIGTERM, &action, NULL); -+#endif - } - - int main(int argc, char* argv[]) diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0005-stdc-format.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0005-stdc-format.patch deleted file mode 100644 index d1b1b47051f32..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0005-stdc-format.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/3rdparty/minitrace/minitrace.h b/3rdparty/minitrace/minitrace.h -index c7d5b31..d68dc52 100644 ---- a/3rdparty/minitrace/minitrace.h -+++ b/3rdparty/minitrace/minitrace.h -@@ -21,6 +21,7 @@ - // More: - // http://www.altdevblogaday.com/2012/08/21/using-chrometracing-to-view-your-inline-profiling-data/ - -+#define __STDC_FORMAT_MACROS - #include - - #define MTR_ENABLED diff --git a/recipes/behaviortree.cpp/all/patches/3.7.0-0001-remove-fpic.patch b/recipes/behaviortree.cpp/all/patches/3.7.0-0001-remove-fpic.patch deleted file mode 100644 index b1bd9fd89538c..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.7.0-0001-remove-fpic.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cd490a5..843045e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -15,8 +15,6 @@ else() - add_definitions(-Wpedantic) - endif() - --set(CMAKE_POSITION_INDEPENDENT_CODE ON) -- - #---- project configuration ---- - option(BUILD_EXAMPLES "Build tutorials and examples" ON) - option(BUILD_SAMPLES "Build sample nodes" ON) diff --git a/recipes/behaviortree.cpp/all/patches/3.7.0-0002-find-zmq.patch b/recipes/behaviortree.cpp/all/patches/3.7.0-0002-find-zmq.patch deleted file mode 100644 index 7290476cc8726..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.7.0-0002-find-zmq.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 843045e..471c00e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -54,14 +54,14 @@ endif() - - #---- Find other packages ---- - find_package(Threads) --find_package(ZMQ) -+find_package(ZeroMQ) - - list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES - ${CMAKE_THREAD_LIBS_INIT} - ${CMAKE_DL_LIBS} - ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - message(STATUS "ZeroMQ found.") - add_definitions( -DZMQ_FOUND ) - list(APPEND BT_SOURCE src/loggers/bt_zmq_publisher.cpp) -@@ -193,8 +193,8 @@ else() - add_library(${BEHAVIOR_TREE_LIBRARY} STATIC ${BT_SOURCE}) - endif() - --if( ZMQ_FOUND ) -- list(APPEND BUILD_TOOL_INCLUDE_DIRS ${ZMQ_INCLUDE_DIRS}) -+if( ZeroMQ_FOUND ) -+ list(APPEND BUILD_TOOL_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIRS}) - endif() - - target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC -@@ -202,7 +202,7 @@ target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC - - target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PRIVATE - ${Boost_LIBRARIES} -- ${ZMQ_LIBRARIES}) -+ ${ZeroMQ_LIBRARIES}) - - #get_target_property(my_libs ${BEHAVIOR_TREE_LIBRARY} INTERFACE_LINK_LIBRARIES) - #list(REMOVE_ITEM _libs X) -@@ -218,8 +218,8 @@ target_include_directories(${BEHAVIOR_TREE_LIBRARY} PUBLIC - $ - ${BUILD_TOOL_INCLUDE_DIRS}) - --if( ZMQ_FOUND ) -- target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZMQ_FOUND) -+if( ZeroMQ_FOUND ) -+ target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZeroMQ_FOUND) - endif() - - if(MSVC) -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 2ad33b3..2dc969d 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -6,9 +6,9 @@ target_link_libraries(bt3_log_cat ${BEHAVIOR_TREE_LIBRARY} ) - install(TARGETS bt3_log_cat - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - add_executable(bt3_recorder bt_recorder.cpp ) -- target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZMQ_LIBRARIES}) -+ target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZeroMQ_LIBRARIES}) - install(TARGETS bt3_recorder - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - endif() diff --git a/recipes/behaviortree.cpp/all/patches/3.7.0-0003-no-werror.patch b/recipes/behaviortree.cpp/all/patches/3.7.0-0003-no-werror.patch deleted file mode 100644 index 5bf8893db1770..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.7.0-0003-no-werror.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 471c00e..7245461 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -225,7 +225,7 @@ endif() - if(MSVC) - else() - target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE -- -Wall -Wextra -Werror=return-type) -+ -Wall -Wextra) - endif() - - ############################################################# diff --git a/recipes/behaviortree.cpp/all/patches/4.0.1-0001-remove-fpic.patch b/recipes/behaviortree.cpp/all/patches/4.0.1-0001-remove-fpic.patch deleted file mode 100644 index 23931bd446392..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/4.0.1-0001-remove-fpic.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d03b8a7..a2f23cf 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -15,8 +15,6 @@ else() - add_definitions(-Wpedantic) - endif() - --set(CMAKE_POSITION_INDEPENDENT_CODE ON) -- - #---- project configuration ---- - option(BTCPP_SHARED_LIBS "Build shared libraries" ON) - option(BTCPP_ENABLE_COROUTINES "Enable boost coroutines" ON) diff --git a/recipes/behaviortree.cpp/all/patches/4.0.1-0002-find-zmq.patch b/recipes/behaviortree.cpp/all/patches/4.0.1-0002-find-zmq.patch deleted file mode 100644 index 6753b06f564d0..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/4.0.1-0002-find-zmq.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a2f23cf..d427d37 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -67,14 +67,14 @@ endif() - - #---- Find other packages ---- - find_package(Threads) --find_package(ZMQ) -+find_package(ZeroMQ) - - list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES - ${CMAKE_THREAD_LIBS_INIT} - ${CMAKE_DL_LIBS} - ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - message(STATUS "ZeroMQ found.") - add_definitions( -DZMQ_FOUND ) - list(APPEND BT_SOURCE src/loggers/bt_zmq_publisher.cpp) -@@ -221,7 +221,7 @@ target_link_libraries(${BEHAVIOR_TREE_LIBRARY} - ${BEHAVIOR_TREE_PUBLIC_LIBRARIES} - PRIVATE - ${Boost_LIBRARIES} -- ${ZMQ_LIBRARIES} -+ ${ZeroMQ_LIBRARIES} - $ - ) - -@@ -243,8 +243,8 @@ target_include_directories(${BEHAVIOR_TREE_LIBRARY} PRIVATE - $ - ) - --if( ZMQ_FOUND ) -- target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZMQ_FOUND) -+if( ZeroMQ_FOUND ) -+ target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZeroMQ_FOUND) - endif() - - if(MSVC) -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 163e703..b98f525 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -7,9 +7,9 @@ target_link_libraries(bt3_log_cat ${BEHAVIOR_TREE_LIBRARY} ) - install(TARGETS bt3_log_cat - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - add_executable(bt3_recorder bt_recorder.cpp ) -- target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZMQ_LIBRARIES}) -+ target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZeroMQ_LIBRARIES}) - install(TARGETS bt3_recorder - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - endif() diff --git a/recipes/behaviortree.cpp/all/patches/4.0.1-0003-no-werror.patch b/recipes/behaviortree.cpp/all/patches/4.0.1-0003-no-werror.patch deleted file mode 100644 index b69541449eb87..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/4.0.1-0003-no-werror.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d427d37..0c10f52 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -250,7 +250,7 @@ endif() - if(MSVC) - else() - target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE -- -Wall -Wextra -Werror=return-type) -+ -Wall -Wextra) - endif() - - ############################################################# diff --git a/recipes/behaviortree.cpp/config.yml b/recipes/behaviortree.cpp/config.yml index e1234d5535a8c..6056a1ddad488 100644 --- a/recipes/behaviortree.cpp/config.yml +++ b/recipes/behaviortree.cpp/config.yml @@ -1,7 +1,13 @@ versions: + "4.6.1": + folder: all + "4.6.0": + folder: all + "4.5.2": + folder: all "4.0.1": folder: all - "3.7.0": + "3.8.6": folder: all - "3.5.6": + "3.7.0": folder: all diff --git a/recipes/benchmark/all/conandata.yml b/recipes/benchmark/all/conandata.yml index 8a3c24a77b927..102609d9c75c2 100644 --- a/recipes/benchmark/all/conandata.yml +++ b/recipes/benchmark/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.4": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.4.tar.gz" + sha256: "3e7059b6b11fb1bbe28e33e02519398ca94c1818874ebed18e504dc6f709be45" "1.8.3": url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.3.tar.gz" sha256: "6bc180a57d23d4d9515519f92b0c83d61b05b5bab188961f36ac7b06b0d9e9ce" diff --git a/recipes/benchmark/all/conanfile.py b/recipes/benchmark/all/conanfile.py index 4143dd1a1d5dd..65bfbc736fc66 100644 --- a/recipes/benchmark/all/conanfile.py +++ b/recipes/benchmark/all/conanfile.py @@ -113,7 +113,6 @@ def package_info(self): self.cpp_info.components["_benchmark"].system_libs.append("kstat") if self.options.get_safe("enable_libpfm"): self.cpp_info.components["_benchmark"].requires.append("libpfm4::libpfm4") - self.cpp_info.components["benchmark_main"].set_property("cmake_target_name", "benchmark::benchmark_main") self.cpp_info.components["benchmark_main"].libs = ["benchmark_main"] diff --git a/recipes/benchmark/config.yml b/recipes/benchmark/config.yml index f3ed1f1e95743..13430070c7797 100644 --- a/recipes/benchmark/config.yml +++ b/recipes/benchmark/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.4": + folder: all "1.8.3": folder: all "1.8.2": diff --git a/recipes/binutils/all/conandata.yml b/recipes/binutils/all/conandata.yml index 92a40425b2590..f0dd0d5db997f 100644 --- a/recipes/binutils/all/conandata.yml +++ b/recipes/binutils/all/conandata.yml @@ -1,26 +1,16 @@ sources: + "2.42": + url: "https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz" + sha256: "f6e4d41fd5fc778b06b7891457b3620da5ecea1006c6a4a41ae998109f85a800" "2.41": - url: "https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.gz" - sha256: "48d00a8dc73aa7d2394a7dc069b96191d95e8de8f0da6dc91da5cce655c20e45" - "2.40": - url: "https://ftp.gnu.org/gnu/binutils/binutils-2.40.tar.gz" - sha256: "d7f82c4047decf43a6f769ac32456a92ddb6932409a585c633cdd4e9df23d956" - "2.38": # 2022-02-09 - url: "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" - sha256: "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052" - "2.37": - url: "https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.gz" - sha256: "c44968b97cd86499efbc4b4ab7d98471f673e5414c554ef54afa930062dbbfcb" + url: "https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.xz" + sha256: "ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450" patches: + "2.42": + - patch_file: "patches/2.42-0001-no-texinfo.patch" + patch_type: "conan" + patch_description: "disable texinfo" "2.41": - patch_file: "patches/2.41-0001-no-texinfo.patch" - patch_type: conan - patch_description: "disable texinfo" - "2.40": - - patch_file: "patches/2.40-0001-no-texinfo.patch" - patch_type: conan - patch_description: "disable texinfo" - "2.38": - - patch_file: "patches/2.38-0001-no-texinfo.patch" - patch_type: conan + patch_type: "conan" patch_description: "disable texinfo" diff --git a/recipes/binutils/all/conanfile.py b/recipes/binutils/all/conanfile.py index 1e04fbc03a87b..09d66fc511d1f 100644 --- a/recipes/binutils/all/conanfile.py +++ b/recipes/binutils/all/conanfile.py @@ -132,10 +132,8 @@ def build_requirements(self): self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type="str"): self.tool_requires("msys2/cci.latest") - - if self.version >= "2.39": - self.tool_requires("bison/3.8.2") - self.tool_requires("flex/2.6.4") + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") def requirements(self): self.requires("zlib/[>=1.2.11 <2]") @@ -199,8 +197,6 @@ def package_info(self): # v2 exports self.buildenv_info.append_path("PATH", bindir) self.buildenv_info.append_path("PATH", absolute_target_bindir) - self.conf_info.define("user.binutils:gnu_triplet", self.options.target_triplet) - self.conf_info.define("user.binutils:prefix", self.options.prefix) # Add recipe path to enable running the self test in the test package. # Don't use this property in production code. It's unsupported. diff --git a/recipes/binutils/all/patches/2.38-0001-no-texinfo.patch b/recipes/binutils/all/patches/2.38-0001-no-texinfo.patch deleted file mode 100644 index 1e0698965c0de..0000000000000 --- a/recipes/binutils/all/patches/2.38-0001-no-texinfo.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- gas/Makefile.in -+++ gas/Makefile.in -@@ -1778,7 +1778,7 @@ - check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU - check: check-recursive --all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(SCRIPTS) $(MANS) config.h -+all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) config.h - installdirs: installdirs-recursive - installdirs-am: - for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \ -@@ -1854,7 +1854,7 @@ info: info-recursive - - info-am: $(INFO_DEPS) info-local - --install-data-am: install-data-local install-info-am install-man -+install-data-am: install-man - - install-dvi: install-dvi-recursive - diff --git a/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch b/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch deleted file mode 100644 index fbd00f17e49e4..0000000000000 --- a/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- 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/patches/2.42-0001-no-texinfo.patch b/recipes/binutils/all/patches/2.42-0001-no-texinfo.patch new file mode 100644 index 0000000000000..231668a13cce4 --- /dev/null +++ b/recipes/binutils/all/patches/2.42-0001-no-texinfo.patch @@ -0,0 +1,51 @@ +--- bfd/Makefile.in ++++ bfd/Makefile.in +@@ -259,7 +259,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 +@@ -2050,7 +2050,7 @@ + check-am: all-am + check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +-all-am: Makefile $(INFO_DEPS) $(LTLIBRARIES) $(HEADERS) config.h ++all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h + installdirs: installdirs-recursive + installdirs-am: + for dir in "$(DESTDIR)$(bfdlibdir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(bfdincludedir)"; do \ +@@ -2117,8 +2117,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 + + +--- gas/Makefile.in ++++ gas/Makefile.in +@@ -1825,7 +1825,7 @@ + check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU + check: check-recursive +-all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(SCRIPTS) $(MANS) config.h ++all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) config.h + installdirs: installdirs-recursive + installdirs-am: + for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \ +@@ -1901,7 +1901,7 @@ + + info-am: $(INFO_DEPS) info-local + +-install-data-am: install-info-am install-man ++install-data-am: install-man + + install-dvi: install-dvi-recursive + diff --git a/recipes/binutils/config.yml b/recipes/binutils/config.yml index 97d0d2ecab157..58766488a2584 100644 --- a/recipes/binutils/config.yml +++ b/recipes/binutils/config.yml @@ -1,9 +1,5 @@ versions: - "2.41": - folder: all - "2.40": + "2.42": folder: all - "2.38": - folder: all - "2.37": + "2.41": folder: all diff --git a/recipes/bitserializer/all/conandata.yml b/recipes/bitserializer/all/conandata.yml index 1571f9c56284c..26d9d94803f91 100644 --- a/recipes/bitserializer/all/conandata.yml +++ b/recipes/bitserializer/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.70": + url: "https://github.com/PavelKisliak/BitSerializer/archive/v0.70.tar.gz" + sha256: "094b12c729b35bf2cede8b55e8193db7793482646f0307c17bcc736de6cce7c9" "0.65": url: "https://github.com/PavelKisliak/BitSerializer/archive/v0.65.tar.gz" sha256: "b4d90f13dd424faebe3ee57ee0cb86ff304e893990afd259c6a29d1f8533b2ef" diff --git a/recipes/bitserializer/all/conanfile.py b/recipes/bitserializer/all/conanfile.py index 5acbd3659a4cb..183dc170d9b0f 100644 --- a/recipes/bitserializer/all/conanfile.py +++ b/recipes/bitserializer/all/conanfile.py @@ -12,8 +12,8 @@ class BitserializerConan(ConanFile): name = "bitserializer" - description = "C++ 17 library for serialization to multiple output formats (JSON, XML, YAML, CSV)" - topics = ("serialization", "json", "xml", "yaml", "csv") + description = "C++ 17 library for serialization to multiple output formats (JSON, XML, YAML, CSV, MsgPack)" + topics = ("serialization", "json", "xml", "yaml", "csv", "msgpack") url = "https://github.com/conan-io/conan-center-index" homepage = "https://bitbucket.org/Pavel_Kisliak/bitserializer" license = "MIT" @@ -26,6 +26,7 @@ class BitserializerConan(ConanFile): "with_pugixml": [True, False], "with_rapidyaml": [True, False], "with_csv": [True, False], + "with_msgpack": [True, False], } default_options = { "fPIC": True, @@ -34,6 +35,7 @@ class BitserializerConan(ConanFile): "with_pugixml": False, "with_rapidyaml": False, "with_csv": False, + "with_msgpack": False, } no_copy_source = True @@ -55,9 +57,9 @@ def _compilers_minimum_version(self): def _is_header_only(self, info=False): if Version(self.version) < "0.50": return True - # All components of library are header-only except csv-archive + # All components of library are header-only except csv-archive and msgpack-archive options = self.info.options if info else self.options - return not options.with_csv + return not (options.with_csv or options.get_safe("with_msgpack")) def config_options(self): if self.settings.os == "Windows" or Version(self.version) < "0.50": @@ -65,6 +67,8 @@ def config_options(self): if Version(self.version) < "0.50": del self.options.with_rapidyaml del self.options.with_csv + if Version(self.version) < "0.70": + del self.options.with_msgpack def configure(self): if self._is_header_only(): @@ -80,13 +84,13 @@ def layout(self): def requirements(self): if self.options.with_cpprestsdk: - self.requires("cpprestsdk/2.10.18", transitive_headers=True, transitive_libs=True) + self.requires("cpprestsdk/2.10.19", transitive_headers=True, transitive_libs=True) if self.options.with_rapidjson: - self.requires("rapidjson/cci.20220822", transitive_headers=True, transitive_libs=True) + self.requires("rapidjson/1.1.0", transitive_headers=True, transitive_libs=True) if self.options.with_pugixml: - self.requires("pugixml/1.13", transitive_headers=True, transitive_libs=True) + self.requires("pugixml/1.14", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_rapidyaml"): - self.requires("rapidyaml/0.4.1", transitive_headers=True, transitive_libs=True) + self.requires("rapidyaml/0.5.0", transitive_headers=True, transitive_libs=True) def package_id(self): if self._is_header_only(info=True): @@ -121,6 +125,7 @@ def generate(self): tc.variables["BUILD_PUGIXML_ARCHIVE"] = self.options.with_pugixml tc.variables["BUILD_RAPIDYAML_ARCHIVE"] = self.options.with_rapidyaml tc.variables["BUILD_CSV_ARCHIVE"] = self.options.with_csv + tc.variables["BUILD_MSGPACK_ARCHIVE"] = self.options.get_safe("with_msgpack") tc.generate() deps = CMakeDeps(self) deps.generate() @@ -197,6 +202,13 @@ def package_info(self): self.cpp_info.components["bitserializer-csv"].bindirs = [] self.cpp_info.components["bitserializer-csv"].libs = [f"csv-archive{lib_suffix}"] + # msgpack-archive + if self.options.get_safe("with_msgpack"): + self.cpp_info.components["bitserializer-msgpack"].set_property("cmake_target_name", "BitSerializer::msgpack-archive") + self.cpp_info.components["bitserializer-msgpack"].requires = ["bitserializer-core"] + self.cpp_info.components["bitserializer-msgpack"].bindirs = [] + self.cpp_info.components["bitserializer-msgpack"].libs = [f"msgpack-archive{lib_suffix}"] + # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "bitserializer" self.cpp_info.filenames["cmake_find_package_multi"] = "bitserializer" @@ -219,3 +231,6 @@ def package_info(self): if self.options.get_safe("with_csv"): self.cpp_info.components["bitserializer-csv"].names["cmake_find_package"] = "csv-archive" self.cpp_info.components["bitserializer-csv"].names["cmake_find_package_multi"] = "csv-archive" + if self.options.get_safe("with_msgpack"): + self.cpp_info.components["bitserializer-msgpack"].names["cmake_find_package"] = "msgpack-archive" + self.cpp_info.components["bitserializer-msgpack"].names["cmake_find_package_multi"] = "msgpack-archive" diff --git a/recipes/bitserializer/all/test_package/CMakeLists.txt b/recipes/bitserializer/all/test_package/CMakeLists.txt index b092458d1e2ae..d09d8d9b17554 100644 --- a/recipes/bitserializer/all/test_package/CMakeLists.txt +++ b/recipes/bitserializer/all/test_package/CMakeLists.txt @@ -17,6 +17,9 @@ endif() if(WITH_CSV) list(APPEND BITSERIALIZER_COMPONENTS csv-archive) endif() +if(WITH_MSGPACK) + list(APPEND BITSERIALIZER_COMPONENTS msgpack-archive) +endif() find_package(bitserializer CONFIG REQUIRED COMPONENTS ${BITSERIALIZER_COMPONENTS} @@ -31,6 +34,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE $<$:BitSerializer::pugixml-archive> $<$:BitSerializer::rapidyaml-archive> $<$:BitSerializer::csv-archive> + $<$:BitSerializer::msgpack-archive> ) target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:"WITH_CPPRESTSDK"> @@ -38,4 +42,5 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:"WITH_PUGIXML"> $<$:"WITH_RAPIDYAML"> $<$:"WITH_CSV"> + $<$:"WITH_MSGPACK"> ) diff --git a/recipes/bitserializer/all/test_package/conanfile.py b/recipes/bitserializer/all/test_package/conanfile.py index abab9f750547c..86588bf359b36 100644 --- a/recipes/bitserializer/all/test_package/conanfile.py +++ b/recipes/bitserializer/all/test_package/conanfile.py @@ -23,6 +23,7 @@ def generate(self): tc.variables["WITH_PUGIXML"] = bitserializerOptions.with_pugixml tc.variables["WITH_RAPIDYAML"] = bitserializerOptions.get_safe("with_rapidyaml", False) tc.variables["WITH_CSV"] = bitserializerOptions.get_safe("with_csv", False) + tc.variables["WITH_MSGPACK"] = bitserializerOptions.get_safe("with_msgpack", False) tc.generate() def build(self): diff --git a/recipes/bitserializer/all/test_package/test_package.cpp b/recipes/bitserializer/all/test_package/test_package.cpp index aba11c808ba19..e3fd28d5e32b4 100644 --- a/recipes/bitserializer/all/test_package/test_package.cpp +++ b/recipes/bitserializer/all/test_package/test_package.cpp @@ -18,6 +18,9 @@ #ifdef WITH_CSV #include #endif +#ifdef WITH_MSGPACK +#include +#endif #include #include @@ -33,12 +36,28 @@ class CTest template void Serialize(TArchive& archive) { +#if BITSERIALIZER_VERSION >= 7000 + archive << BitSerializer::KeyValue("Message", mMessage); +#else archive << BitSerializer::MakeAutoKeyValue("Message", mMessage); +#endif } std::string mMessage; }; +std::string PrintAsHexString(const std::string& data) +{ + constexpr char hexChars[] = "0123456789ABCDEF"; + std::string result; + for (const char ch : data) + { + if (!result.empty()) result.push_back(' '); + result.append({ hexChars[(ch & 0xF0) >> 4], hexChars[(ch & 0x0F) >> 0] }); + } + return result; +} + template void TestArchive(const std::string& message) { @@ -47,21 +66,34 @@ void TestArchive(const std::string& message) BitSerializer::SerializationOptions serializationOptions; serializationOptions.streamOptions.writeBom = false; - CTest testObj[1] = { message }; + CTest testObj[1] = { message }; std::stringstream outputStream; BitSerializer::SaveObject(testObj, outputStream, serializationOptions); - std::cout << outputStream.str() << std::endl; +#if BITSERIALIZER_VERSION >= 7000 + const std::string result = TArchive::is_binary ? PrintAsHexString(outputStream.str()) : outputStream.str(); +#else + const std::string result = outputStream.str(); +#endif + std::cout << result<< std::endl; } int main() { std::cout << "BitSerializer version: " +#ifdef BITSERIALIZER_VERSION + << BitSerializer::Convert::To(BITSERIALIZER_VERSION_MAJOR) << "." + << BitSerializer::Convert::To(BITSERIALIZER_VERSION_MINOR) << "." + << BitSerializer::Convert::To(BITSERIALIZER_VERSION_PATCH) +#else << BitSerializer::Convert::To(BitSerializer::Version::Major) << "." << BitSerializer::Convert::To(BitSerializer::Version::Minor) << "." << BitSerializer::Convert::To(BitSerializer::Version::Maintenance) +#endif << std::endl; +#if !defined BITSERIALIZER_VERSION || BITSERIALIZER_HAS_FILESYSTEM // Some compilers does not link filesystem automatically std::cout << "Testing the link of C++17 filesystem: " << std::filesystem::temp_directory_path() << std::endl; +#endif #ifdef WITH_CPPRESTSDK TestArchive("Implementation based on cpprestsdk"); @@ -78,4 +110,7 @@ int main() { #ifdef WITH_CSV TestArchive("CSV archive (built-in implementation)"); #endif +#ifdef WITH_MSGPACK + TestArchive("MsgPack archive (built-in implementation)"); +#endif } diff --git a/recipes/bitserializer/all/test_v1_package/conanfile.py b/recipes/bitserializer/all/test_v1_package/conanfile.py index 599ba5557b9dc..cc693be1ab4b9 100644 --- a/recipes/bitserializer/all/test_v1_package/conanfile.py +++ b/recipes/bitserializer/all/test_v1_package/conanfile.py @@ -20,6 +20,7 @@ def build(self): cmake.definitions["WITH_PUGIXML"] = self.options["bitserializer"].with_pugixml cmake.definitions["WITH_RAPIDYAML"] = self._bitserializer_option("with_rapidyaml", False) cmake.definitions["WITH_CSV"] = self._bitserializer_option("with_csv", False) + cmake.definitions["WITH_MSGPACK"] = self._bitserializer_option("with_msgpack", False) cmake.configure() cmake.build() diff --git a/recipes/bitserializer/config.yml b/recipes/bitserializer/config.yml index 7319ee088f906..a645049195724 100644 --- a/recipes/bitserializer/config.yml +++ b/recipes/bitserializer/config.yml @@ -1,4 +1,6 @@ versions: + "0.70": + folder: "all" "0.65": folder: "all" "0.50": diff --git a/recipes/bitsery/all/conandata.yml b/recipes/bitsery/all/conandata.yml index 6d53e1633d5bf..5af8798ccd4e5 100644 --- a/recipes/bitsery/all/conandata.yml +++ b/recipes/bitsery/all/conandata.yml @@ -5,12 +5,3 @@ sources: "5.2.2": url: "https://github.com/fraillt/bitsery/archive/v5.2.2.tar.gz" sha256: "5e932c463f16db15228b2546632a5851a502c68e605a1e313b0f1a35c061e4ae" - "5.2.1": - url: "https://github.com/fraillt/bitsery/archive/v5.2.1.tar.gz" - sha256: "1e2ee66827c55ef82eaf6ef4c87a2c5b3a010dfe6c770eb0feeb3f0c35254d00" - "5.2.0": - url: "https://github.com/fraillt/bitsery/archive/v5.2.0.tar.gz" - sha256: "99f47bca227abb6b9e8030703dcc402ab930ff3bf0a87c89c3f0fb9536cad448" - "5.1.0": - url: "https://github.com/fraillt/bitsery/archive/v5.1.0.tar.gz" - sha256: "8f46667db5d0b62fdaab33612108498bcbcbe9cfa48d2cd220b2129734440a8d" diff --git a/recipes/bitsery/all/conanfile.py b/recipes/bitsery/all/conanfile.py index dd2f676b3757f..2e0ffa53b2c89 100644 --- a/recipes/bitsery/all/conanfile.py +++ b/recipes/bitsery/all/conanfile.py @@ -17,9 +17,13 @@ class BitseryConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/fraillt/bitsery" license = "MIT" + 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() @@ -27,12 +31,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 @@ -44,11 +44,8 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "Bitsery") self.cpp_info.set_property("cmake_target_name", "Bitsery::bitsery") - # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["bitserylib"].bindirs = [] - self.cpp_info.components["bitserylib"].frameworkdirs = [] - self.cpp_info.components["bitserylib"].libdirs = [] - self.cpp_info.components["bitserylib"].resdirs = [] + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "Bitsery" @@ -56,3 +53,5 @@ def package_info(self): self.cpp_info.components["bitserylib"].names["cmake_find_package"] = "bitsery" self.cpp_info.components["bitserylib"].names["cmake_find_package_multi"] = "bitsery" self.cpp_info.components["bitserylib"].set_property("cmake_target_name", "Bitsery::bitsery") + self.cpp_info.components["bitserylib"].bindirs = [] + self.cpp_info.components["bitserylib"].libdirs = [] diff --git a/recipes/bitsery/config.yml b/recipes/bitsery/config.yml index 07e67c2710fe5..383bfb1cfff8d 100644 --- a/recipes/bitsery/config.yml +++ b/recipes/bitsery/config.yml @@ -3,9 +3,3 @@ versions: folder: all "5.2.2": folder: all - "5.2.1": - folder: all - "5.2.0": - folder: all - "5.1.0": - folder: all diff --git a/recipes/blend2d/all/conandata.yml b/recipes/blend2d/all/conandata.yml index 06ef79b273e89..d6a075271dc7f 100644 --- a/recipes/blend2d/all/conandata.yml +++ b/recipes/blend2d/all/conandata.yml @@ -1,28 +1,30 @@ sources: + "0.11.3": + url: "https://blend2d.com/download/blend2d-0.11.3.tar.gz" + sha256: "6dfb2c0260073f2af6c3dfe6c30a31da637e6facf7802f6b2836cc3c4e74fdd8" + "0.11.1": + url: "https://blend2d.com/download/blend2d-0.11.1.tar.gz" + sha256: "f46d61b6aa477fea1a353a41f5906d4e861817ae059ed22fc6ecdd50ff859dd2" + # When upstream will have new release, tarball may be deleted. + # Use following url: https://github.com/blend2d/blend2d/archive/a7f947677e85441abe1769586d3bb935b4086a07.tar.gz "0.10.6": - url: "https://blend2d.com/download/blend2d-0.10.6.tar.xz" - sha256: "0377f747b76d5602874351501bbbd648ba73b486273a5dcabfd6dc85c4d289b4" + url: "https://github.com/blend2d/blend2d/archive/df124784fd3e9765251c74d412d88c625e3587e9.tar.gz" + sha256: "d8a91745c79beeab29d781357308b49ef51d009237b342ce50304ea618e977ad" "0.10.5": - url: "https://blend2d.com/download/blend2d-0.10.5.tar.xz" - sha256: "fff5a7b1a6b16c986f3d02052a9a030f138fbae3a9c16bf07915416515d6b9cd" + url: "https://github.com/blend2d/blend2d/archive/99fc3aa9a1d113e913df67166d40d2a81bef1dcb.tar.gz" + sha256: "cb7426a483156721c02b28cf65969bdeeb13ffed6cf9bc4a9493d7ec4d5de8c3" "0.10.4": - url: "https://blend2d.com/download/blend2d-0.10.4.tar.xz" - sha256: "6363e5c13c1c9e4709f949585a6af772ee13a16f75b0084f91b3918dece2fff3" + url: "https://github.com/blend2d/blend2d/archive/d60f62b9d008be096daff329dfe9b8409c344651.tar.gz" + sha256: "ce197422ae8ec0d0310895bebed396091e0144ec09482439d24040196957e740" "0.10": - url: "https://blend2d.com/download/blend2d-0.10.tar.xz" - sha256: "eaed6cc5f1fc33061a99d70cf166836994d952f75762bfacb397ee388e13ccc9" + url: "https://github.com/blend2d/blend2d/archive/000d55c75994fa88efcb7a31ae32be9ec8435f7d.tar.gz" + sha256: "7a986e14d08d687bfc7510bd762a29f01b1c2449b4e60f85268dd0072c65b698" "0.9": - url: "https://blend2d.com/download/blend2d-0.9.tar.xz" - sha256: "a70a2a57c67017afa1067a11807fef9808788c69b4012ba4d56a5c47a5ba87c3" + url: "https://github.com/blend2d/blend2d/archive/346555924752f085a2a06265858bc63c8987bf98.tar.gz" + sha256: "89639d60320e8d684c3708b849ede9ac660cbd2acc33de6baa846ee7fbed24b8" "0.8": - url: "https://blend2d.com/download/blend2d-0.8.zip" - sha256: "0c1e2cc94cd4aa054c527b2dc51d533c8783a8e31779de3ba7bb49f8bd9afca1" - "0.0.18": - url: "https://blend2d.com/download/blend2d-beta18.zip" - sha256: "02d23b185183705215241d7b161937bbda5b427c54cc5aa4c03238ef8dd1e60b" - "0.0.17": - url: "https://blend2d.com/download/blend2d-beta17.zip" - sha256: "06ee8fb0bea281d09291e498900093139426501a1a7f09dba0ec801dd340635e" + url: "https://github.com/blend2d/blend2d/archive/2910c87c5e8ddedcf80bbf4871bb59d70e1170c1.tar.gz" + sha256: "34ff6f0f2dd10b39e1e6a3b07c5f76844b38f780c6849a65a34351e76e36cd3d" patches: "0.10.6": - patch_file: "patches/0.10.6-0001-disable-embed-asmjit.patch" @@ -48,15 +50,3 @@ patches: - patch_file: "patches/0.8-0001-disable-embed-asmjit.patch" patch_description: "use asmjit cci package" patch_type: "conan" - "0.0.18": - - patch_file: "patches/0.0.17-0001-disable-embed-asmjit.patch" - patch_description: "use asmjit cci package" - patch_type: "conan" - - patch_file: "patches/0.0.18-0002-fix-gcc12-compilationerror.patch" - patch_description: "fix gcc12 compilation error, backport from upstream" - patch_type: "portability" - patch_source: "https://github.com/blend2d/blend2d/commit/2574d90ebc61b5195491cc79bfa6da162084242b" - "0.0.17": - - patch_file: "patches/0.0.17-0001-disable-embed-asmjit.patch" - patch_description: "use asmjit cci package" - patch_type: "conan" diff --git a/recipes/blend2d/all/conanfile.py b/recipes/blend2d/all/conanfile.py index adbef317cace4..5663998a64f81 100644 --- a/recipes/blend2d/all/conanfile.py +++ b/recipes/blend2d/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm import Version from conan.tools.microsoft import check_min_vs +from conan.tools.env import VirtualBuildEnv import os required_conan_version = ">=1.53.0" @@ -45,7 +46,7 @@ def layout(self): def requirements(self): if self.options.with_jit: - self.requires("asmjit/cci.20230325") + self.requires("asmjit/cci.20240531") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -56,6 +57,10 @@ def validate(self): # https://github.com/blend2d/blend2d/commit/63db360c7eb2c1c3ca9cd92a867dbb23dc95ca7d check_min_vs(self, 192) + def build_requirements(self): + if Version(self.version) >= "0.11.1": + self.tool_requires("cmake/[>=3.18 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -67,15 +72,17 @@ def generate(self): tc.variables["BLEND2D_STATIC"] = not self.options.shared tc.variables["BLEND2D_NO_STDCXX"] = False tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["BLEND2D_EXTERNAL_ASMJIT"] = True if not valid_min_cppstd(self, 11): tc.variables["CMAKE_CXX_STANDARD"] = 11 if not self.options.shared: tc.preprocessor_definitions["BL_STATIC"] = "1" tc.variables["BLEND2D_NO_JIT"] = not self.options.with_jit tc.generate() - deps = CMakeDeps(self) deps.generate() + venv = VirtualBuildEnv(self) + venv.generate(scope="build") def build(self): apply_conandata_patches(self) diff --git a/recipes/blend2d/all/patches/0.0.17-0001-disable-embed-asmjit.patch b/recipes/blend2d/all/patches/0.0.17-0001-disable-embed-asmjit.patch deleted file mode 100644 index 6a3ccd1e255b1..0000000000000 --- a/recipes/blend2d/all/patches/0.0.17-0001-disable-embed-asmjit.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 52d295a..b1a78a5 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -398,10 +398,10 @@ if (NOT BLEND2D_NO_JIT) - set(ASMJIT_EMBED TRUE CACHE BOOL "") - endif() - -- include("${ASMJIT_DIR}/CMakeLists.txt") -- list(APPEND BLEND2D_DEPS ${ASMJIT_LIBS}) -- list(APPEND BLEND2D_PRIVATE_CFLAGS ${ASMJIT_CFLAGS}) -- list(APPEND BLEND2D_PRIVATE_CFLAGS -DASMJIT_NO_STDCXX) -+ find_package(asmjit CONFIG REQUIRED) -+ list(APPEND BLEND2D_DEPS asmjit::asmjit) -+ list(APPEND BLEND2D_PRIVATE_CFLAGS ${asmjit_DEFINITIONS_DEBUG}${asmjit_DEFINITIONS_RELEASE}) -+ - - # A possibility to reduce the resulting binary size by disabling asmjit logging. - if (BLEND2D_NO_JIT_LOGGING) diff --git a/recipes/blend2d/all/patches/0.0.18-0002-fix-gcc12-compilationerror.patch b/recipes/blend2d/all/patches/0.0.18-0002-fix-gcc12-compilationerror.patch deleted file mode 100644 index b089c5a2e867f..0000000000000 --- a/recipes/blend2d/all/patches/0.0.18-0002-fix-gcc12-compilationerror.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/src/blend2d/support/arenaallocator_p.h b/src/blend2d/support/arenaallocator_p.h -index d09b6da..eebd854 100644 ---- a/src/blend2d/support/arenaallocator_p.h -+++ b/src/blend2d/support/arenaallocator_p.h -@@ -445,7 +445,7 @@ public: - template - class BLArenaAllocatorTmp : public BLArenaAllocator { - public: -- BL_NONCOPYABLE(BLArenaAllocatorTmp) -+ BL_NONCOPYABLE(BLArenaAllocatorTmp) - - BL_INLINE explicit BLArenaAllocatorTmp(size_t blockSize, size_t blockAlignment = 1) noexcept - : BLArenaAllocator(blockSize, blockAlignment, _storage.data, N) {} -diff --git a/src/blend2d/support/arenahashmap_p.h b/src/blend2d/support/arenahashmap_p.h -index 29882e1..911d985 100644 ---- a/src/blend2d/support/arenahashmap_p.h -+++ b/src/blend2d/support/arenahashmap_p.h -@@ -185,7 +185,7 @@ public: - template - class BLArenaHashMap : public BLArenaHashMapBase { - public: -- BL_NONCOPYABLE(BLArenaHashMap) -+ BL_NONCOPYABLE(BLArenaHashMap) - - typedef NodeT Node; - -diff --git a/src/blend2d/support/scopedbuffer_p.h b/src/blend2d/support/scopedbuffer_p.h -index e14df50..379f519 100644 ---- a/src/blend2d/support/scopedbuffer_p.h -+++ b/src/blend2d/support/scopedbuffer_p.h -@@ -82,7 +82,7 @@ public: - template - class BLScopedBufferTmp : public BLScopedBuffer { - public: -- BL_NONCOPYABLE(BLScopedBufferTmp) -+ BL_NONCOPYABLE(BLScopedBufferTmp) - - uint8_t _storage[N]; - diff --git a/recipes/blend2d/config.yml b/recipes/blend2d/config.yml index 219f4d22f536c..d02e5977a476a 100644 --- a/recipes/blend2d/config.yml +++ b/recipes/blend2d/config.yml @@ -1,4 +1,8 @@ versions: + "0.11.3": + folder: all + "0.11.1": + folder: all "0.10.6": folder: all "0.10.5": @@ -11,7 +15,3 @@ versions: folder: all "0.8": folder: all - "0.0.18": - folder: all - "0.0.17": - folder: all diff --git a/recipes/bmx/all/conandata.yml b/recipes/bmx/all/conandata.yml new file mode 100644 index 0000000000000..0b6f6445f92a3 --- /dev/null +++ b/recipes/bmx/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "1.2": + url: "https://github.com/bbc/bmx/archive/refs/tags/v1.2.tar.gz" + sha256: "e64d91b2d27478d6b892d72183e1ecf79c99880b079ce04442432f3caed1e259" + "cci.20240517": + url: "https://github.com/bbc/bmx/archive/52c7517923dde6e4de881fe1e47fbae5e60df731.tar.gz" + sha256: "b4a0545e2fa33bd7c25adce3b61fd4b06a68a192d037dd0e5eb14defd0b2c936" +patches: + "1.2": + - patch_file: "patches/1.2-cmake-fixes.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + - patch_file: "patches/1.2-fix-cpp20.patch" + patch_description: "Fix a compilation problem with C++20" + patch_type: "portability" + patch_source: "https://github.com/bbc/bmx/pull/69" + "cci.20240517": + - patch_file: "patches/cci.20240517-cmake-fixes.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" diff --git a/recipes/bmx/all/conanfile.py b/recipes/bmx/all/conanfile.py new file mode 100644 index 0000000000000..2a7415f432502 --- /dev/null +++ b/recipes/bmx/all/conanfile.py @@ -0,0 +1,140 @@ +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, export_conandata_patches, copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class BmxConan(ConanFile): + name = "bmx" + description = ( + "Library for handling broadcast/production oriented media file formats. " + "Allows reading, modifying and writing media metadata and file essences." + ) + topics = ("vfx", "image", "picture", "video", "multimedia", "mxf") + license = "BSD-3-Clause" + homepage = "https://github.com/bbc/bmx" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libcurl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libcurl": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def requirements(self): + # Required libraries + self.requires("uriparser/0.9.8") + self.requires("expat/[>=2.6.2 <3]") + + if not (self.settings.os == 'Windows' or self.settings.os == 'Macos'): + self.requires('libuuid/1.0.3') + + # Configuration dependent requirements + if self.options.with_libcurl: + self.requires("libcurl/[>=7.78.0 <9]") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + # Symbol export is currently not working properly on Windows so shared + # libraries are currently deactivated. This can later be revisited based + # on https://github.com/bbc/bmx/issues/80 + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration( + "Building as a shared library currently not supported on Windows!" + ) + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BMX_BUILD_WITH_LIBCURL"] = self.options.with_libcurl + tc.generate() + + cd = CMakeDeps(self) + cd.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + @staticmethod + def _conan_comp(name): + return f"bmx_{name.lower()}" + + def _add_component(self, name): + component = self.cpp_info.components[self._conan_comp(name)] + component.set_property("cmake_target_name", f"bmx::{name}") + component.names["cmake_find_package"] = name + component.names["cmake_find_package_multi"] = name + return component + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "bmx") + self.cpp_info.set_property("pkg_config_name", "bmx") + + self.cpp_info.names["cmake_find_package"] = "bmx" + self.cpp_info.names["cmake_find_package_multi"] = "bmx" + + # bbc-bmx::MXF + libmxf = self._add_component("MXF") + libmxf.libs = ["MXF"] + libmxf.requires = [] + if not (self.settings.os == 'Windows' or self.settings.os == 'Macos'): + libmxf.requires.append("libuuid::libuuid") + + # bbc-bmx::MXF++ + libmxfpp = self._add_component("MXF++") + libmxfpp.libs = ["MXF++"] + libmxfpp.requires = [ + "bmx_mxf" + ] + + # bbc-bmx::bmx + libbmx = self._add_component("bmx") + libbmx.libs = ["bmx"] + libbmx.requires = [ + "bmx_mxf", + "bmx_mxf++", + "expat::expat", + "uriparser::uriparser", + ] + if not (self.settings.os == 'Windows' or self.settings.os == 'Macos'): + libbmx.requires.append("libuuid::libuuid") + + if self.options.with_libcurl: + libbmx.requires.append("libcurl::libcurl") diff --git a/recipes/bmx/all/patches/1.2-cmake-fixes.patch b/recipes/bmx/all/patches/1.2-cmake-fixes.patch new file mode 100644 index 0000000000000..29a8742dbedbb --- /dev/null +++ b/recipes/bmx/all/patches/1.2-cmake-fixes.patch @@ -0,0 +1,141 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 6fe9540e7..8b2578852 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -34,7 +34,7 @@ if(BUILD_SHARED_LIBS OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() + +-set(CMAKE_CXX_STANDARD 11) ++#set(CMAKE_CXX_STANDARD 11) + + # Set the test samples output directory + if(BMX_TEST_SAMPLES_DIR STREQUAL "") +@@ -75,7 +75,7 @@ if(MSVC) + endforeach() + endif() + else() +- add_compile_options(-W -Wall -O2) ++ add_compile_options(-W -Wall) + + # Enable large file support on 32-bit systems. + add_definitions( +@@ -93,11 +93,25 @@ add_custom_target(bmx_test_data) + + include("${PROJECT_SOURCE_DIR}/cmake/libmxf.cmake") + include("${PROJECT_SOURCE_DIR}/cmake/libmxfpp.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_expat.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_uriparser.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_expat.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_uriparser.cmake") ++#if(BMX_BUILD_WITH_LIBCURL) ++# include("${PROJECT_SOURCE_DIR}/cmake/ext_libcurl.cmake") ++#endif() ++ ++find_package(expat REQUIRED) ++find_package(uriparser REQUIRED) ++if(UNIX AND NOT APPLE) ++ find_package(libuuid REQUIRED) ++ set(uuid_link_lib libuuid::libuuid) ++else() ++ # MSVC: "ole" will already be linked in ++ # APPLE: doesn't require uuid library ++ set(uuid_link_lib) ++endif() + if(BMX_BUILD_WITH_LIBCURL) +- include("${PROJECT_SOURCE_DIR}/cmake/ext_libcurl.cmake") ++ find_package(CURL REQUIRED) + endif() + + configure_file(config.h.in config.h) +diff --git deps/libMXF/CMakeLists.txt deps/libMXF/CMakeLists.txt +index d36fde6c0..6a1af100b 100644 +--- deps/libMXF/CMakeLists.txt ++++ deps/libMXF/CMakeLists.txt +@@ -35,7 +35,7 @@ if(BUILD_SHARED_LIBS OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() + +-set(CMAKE_CXX_STANDARD 11) ++#set(CMAKE_CXX_STANDARD 11) + + # Set the test samples output directory + if(LIBMXF_TEST_SAMPLES_DIR STREQUAL "") +@@ -76,7 +76,7 @@ if(MSVC) + endforeach() + endif() + else() +- add_compile_options(-W -Wall -O2) ++ add_compile_options(-W -Wall) + + # Enable large file support on 32-bit systems. + add_definitions( +diff --git deps/libMXFpp/CMakeLists.txt deps/libMXFpp/CMakeLists.txt +index 2272a2709..924fdf770 100644 +--- deps/libMXFpp/CMakeLists.txt ++++ deps/libMXFpp/CMakeLists.txt +@@ -35,7 +35,7 @@ if(BUILD_SHARED_LIBS OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() + +-set(CMAKE_CXX_STANDARD 11) ++#set(CMAKE_CXX_STANDARD 11) + + if(MSVC) + add_compile_options(/W3 /EHsc) +@@ -61,7 +61,7 @@ if(MSVC) + endforeach() + endif() + else() +- add_compile_options(-W -Wall -O2) ++ add_compile_options(-W -Wall) + + # Enable large file support on 32-bit systems. + add_definitions( +diff --git deps/libMXFpp/libMXF++/CMakeLists.txt deps/libMXFpp/libMXF++/CMakeLists.txt +index 94d48c905..e6c6a63f9 100644 +--- deps/libMXFpp/libMXF++/CMakeLists.txt ++++ deps/libMXFpp/libMXF++/CMakeLists.txt +@@ -32,6 +32,8 @@ add_library(MXFpp + ${MXFpp_sources} + ) + ++target_compile_features(MXFpp PUBLIC cxx_std_11) ++ + target_include_directories(MXFpp PUBLIC + ${PROJECT_SOURCE_DIR} + ) +diff --git src/CMakeLists.txt src/CMakeLists.txt +index 1c0824d8a..94f9c00d6 100644 +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -26,6 +26,8 @@ target_include_directories(bmx PUBLIC + ${PROJECT_SOURCE_DIR}/include + ) + ++target_compile_features(bmx PUBLIC cxx_std_11) ++ + # Add path to header files if not included in MSVC distribution + if(MSVC) + include(CheckIncludeFile) +@@ -65,13 +67,14 @@ target_link_libraries(bmx + ${MXFpp_link_lib} + PRIVATE + ${uuid_link_lib} +- ${expat_link_lib} +- ${uriparser_link_lib} ++ expat::expat ++ uriparser::uriparser + ) + + if(BMX_BUILD_WITH_LIBCURL) +- target_link_libraries(bmx PRIVATE +- ${libcurl_link_lib} ++ # Linking public to see if the shared library for curls dependencies correctly link ++ target_link_libraries(bmx PUBLIC ++ CURL::libcurl + ) + endif() + diff --git a/recipes/bmx/all/patches/1.2-fix-cpp20.patch b/recipes/bmx/all/patches/1.2-fix-cpp20.patch new file mode 100644 index 0000000000000..862806a6a30d2 --- /dev/null +++ b/recipes/bmx/all/patches/1.2-fix-cpp20.patch @@ -0,0 +1,26 @@ +diff --git deps/libMXFpp/libMXF++/MXFVersion.cpp deps/libMXFpp/libMXF++/MXFVersion.cpp +index 333d5871..bb247a32 100644 +--- deps/libMXFpp/libMXF++/MXFVersion.cpp ++++ deps/libMXFpp/libMXF++/MXFVersion.cpp +@@ -33,6 +33,8 @@ + #include "config.h" + #endif + ++#include ++ + #include "git.h" + #include "fallback_git_version.h" + +diff --git src/common/Version.cpp src/common/Version.cpp +index a4f00e14..d51da64a 100644 +--- src/common/Version.cpp ++++ src/common/Version.cpp +@@ -219,7 +219,7 @@ mxfProductVersion bmx::get_bmx_mxf_product_version() + // Set the patch version value to the commit offset from the release tag. + // The commit offset is part of the git describe tag string which has the + // format "--g" +- string describe = bmx_git::DescribeTag(); ++ string describe = std::string(bmx_git::DescribeTag()); + #ifdef PACKAGE_GIT_VERSION_STRING + if (describe.empty() || describe == "unknown") + describe = PACKAGE_GIT_VERSION_STRING; diff --git a/recipes/bmx/all/patches/cci.20240517-cmake-fixes.patch b/recipes/bmx/all/patches/cci.20240517-cmake-fixes.patch new file mode 100644 index 0000000000000..51915e0cc5aa0 --- /dev/null +++ b/recipes/bmx/all/patches/cci.20240517-cmake-fixes.patch @@ -0,0 +1,57 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 3139ef78e..a08fbb589 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -91,11 +91,26 @@ add_custom_target(bmx_test_data) + + include("${PROJECT_SOURCE_DIR}/cmake/libmxf.cmake") + include("${PROJECT_SOURCE_DIR}/cmake/libmxfpp.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_expat.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_uriparser.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_expat.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_uriparser.cmake") ++#if(BMX_BUILD_WITH_LIBCURL) ++# include("${PROJECT_SOURCE_DIR}/cmake/ext_libcurl.cmake") ++#endif() ++ ++find_package(expat REQUIRED) ++find_package(uriparser REQUIRED) ++if(UNIX AND NOT APPLE) ++ find_package(libuuid REQUIRED) ++ set(uuid_link_lib libuuid::libuuid) ++else() ++ # MSVC: "ole" will already be linked in ++ # APPLE: doesn't require uuid library ++ set(uuid_link_lib) ++endif() + if(BMX_BUILD_WITH_LIBCURL) + include("${PROJECT_SOURCE_DIR}/cmake/ext_libcurl.cmake") ++ find_package(CURL REQUIRED) + endif() + + configure_file(config.h.in config.h) +diff --git src/CMakeLists.txt src/CMakeLists.txt +index 59c94b8b9..94f9c00d6 100644 +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -67,13 +67,14 @@ target_link_libraries(bmx + ${MXFpp_link_lib} + PRIVATE + ${uuid_link_lib} +- ${expat_link_lib} +- ${uriparser_link_lib} ++ expat::expat ++ uriparser::uriparser + ) + + if(BMX_BUILD_WITH_LIBCURL) +- target_link_libraries(bmx PRIVATE +- ${libcurl_link_lib} ++ # Linking public to see if the shared library for curls dependencies correctly link ++ target_link_libraries(bmx PUBLIC ++ CURL::libcurl + ) + endif() + diff --git a/recipes/bmx/all/test_package/CMakeLists.txt b/recipes/bmx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e178912ec45f8 --- /dev/null +++ b/recipes/bmx/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(bmx REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) +target_link_libraries(${PROJECT_NAME} PRIVATE bmx::bmx) diff --git a/recipes/bmx/all/test_package/conanfile.py b/recipes/bmx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/bmx/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/bmx/all/test_package/test_package.cpp b/recipes/bmx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..708a858acfc27 --- /dev/null +++ b/recipes/bmx/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include + +#include + +int main() { + std::cout << bmx::get_bmx_library_name() << " library version " << bmx::get_bmx_version_string() << std::endl; + + const auto mxf_version = mxf_get_version(); + std::cout << "MXF library version " + << mxf_version->major << '.' << mxf_version->minor << '.' << mxf_version->patch << std::endl; + + return 0; +} diff --git a/recipes/bmx/config.yml b/recipes/bmx/config.yml new file mode 100644 index 0000000000000..67c5069aa3fb3 --- /dev/null +++ b/recipes/bmx/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2": + folder: all + "cci.20240517": + folder: all diff --git a/recipes/boost/all/conandata.yml b/recipes/boost/all/conandata.yml index f0c416fba2531..b60976ce52867 100644 --- a/recipes/boost/all/conandata.yml +++ b/recipes/boost/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "1.85.0": + url: + - "https://boostorg.jfrog.io/artifactory/main/release/1.85.0/source/boost_1_85_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.85.0/boost_1_85_0.tar.bz2" + sha256: "7009fe1faa1697476bdc7027703a2badb84e849b7b0baad5086b087b971f8617" "1.84.0": url: - "https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.bz2" @@ -68,6 +73,14 @@ sources: url: "https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2" sha256: "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee" patches: + "1.85.0": + - patch_file: "patches/1.82.0-locale-iconv-library-option.patch" + patch_description: "Optional flag to specify iconv from either libc of libiconv" + patch_type: "conan" + - patch_file: "patches/1.85.0-container-aliasing-violation-fix.patch" + patch_description: "Fix aliasing violation in boost::container" + patch_type: "official" + patch_source: "https://github.com/boostorg/container/commit/20ad12f20e661978e90dc7f36d8ab8ac05e5a5a9" "1.84.0": - patch_file: "patches/1.82.0-locale-iconv-library-option.patch" patch_description: "Optional flag to specify iconv from either libc of libiconv" diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index f2f1c3f6feecd..3237b40de8ad1 100644 --- a/recipes/boost/all/conanfile.py +++ b/recipes/boost/all/conanfile.py @@ -23,11 +23,11 @@ required_conan_version = ">=1.53.0" - # When adding (or removing) an option, also add this option to the list in # `rebuild-dependencies.yml` and re-run that script. CONFIGURE_OPTIONS = ( "atomic", + "charconv", "chrono", "cobalt", "container", @@ -233,6 +233,21 @@ def _min_compiler_version_default_cxx11(self): "msvc": 190, # guess }.get(str(self.settings.compiler)) + @property + def _min_compiler_version_default_cxx14(self): + """ Minimum compiler version having c++ standard >= 14 + https://gcc.gnu.org/gcc-6/changes.html + https://releases.llvm.org/6.0.0/tools/clang/docs/ReleaseNotes.html#id9 + https://learn.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=msvc-150#remarks + """ + return { + "gcc": 6, + "clang": 6, + "apple-clang": 99, # still uses C++98 by default. XCode does not reflect apple-clang + "Visual Studio": 15, # guess + "msvc": 191, # guess + }.get(str(self.settings.compiler)) + @property def _min_compiler_version_default_cxx20(self): return { @@ -252,11 +267,61 @@ def _has_cppstd_11_supported(self): if compiler_version: return (Version(self.settings.compiler.version) >= compiler_version) or "11" in supported_cppstd(self) + @property + def _has_cppstd_14_supported(self): + cppstd = self.settings.compiler.get_safe("cppstd") + if cppstd: + return valid_min_cppstd(self, 14) + required_compiler_version = self._min_compiler_version_default_cxx14 + if required_compiler_version: + msvc_versions = {14: 190, 15: 191, 16: 192, 17: 193} + compiler_version = Version(self.settings.compiler.version) + is_visual_studio = str(self.settings.compiler) == "Visual Studio" + # supported_cppstd only supports msvc, but not Visual Studio as compiler + supported_cxx14 = "14" in supported_cppstd(self, "msvc", msvc_versions.get(compiler_version)) if is_visual_studio else "14" in supported_cppstd(self) + # supported_cppstd: lists GCC 5 due partial support for C++14, but not enough for Boost + return (compiler_version >= required_compiler_version) and supported_cxx14 + + @property + def _has_cppstd_20_supported(self): + cppstd = self.settings.compiler.get_safe("cppstd") + if cppstd: + return valid_min_cppstd(self, 20) + required_compiler_version = self._min_compiler_version_default_cxx20 + if required_compiler_version: + msvc_versions = {14: 190, 15: 191, 16: 192, 17: 193} + compiler_version = Version(self.settings.compiler.version) + is_visual_studio = str(self.settings.compiler) == "Visual Studio" + # supported_cppstd only supports msvc, but not Visual Studio as compiler + supported_cxx20 = "20" in supported_cppstd(self, "msvc", msvc_versions.get(compiler_version)) if is_visual_studio else "20" in supported_cppstd(self) + # We still dont have a compiler using C++20 by default + return (compiler_version >= required_compiler_version) or supported_cxx20 + + @property + def _has_coroutine_supported(self): + cppstd = self.settings.compiler.get_safe("cppstd") + cppstd_20_supported = True + if cppstd: + cppstd_20_supported = valid_min_cppstd(self, 20) + # https://en.cppreference.com/w/cpp/compiler_support#cpp20 + # https://releases.llvm.org/14.0.0/tools/clang/docs/ReleaseNotes.html#clang-format: before is experimental header + # https://gcc.gnu.org/gcc-10/changes.html: requires -fcoroutines + min_compiler_versions = { + "apple-clang": "12", + "clang": "14", + "gcc": "10", + "msvc": "192", + "Visual Studio": "16",} + required_compiler_version = min_compiler_versions.get(str(self.settings.compiler)) + if not required_compiler_version: + return cppstd_20_supported + return cppstd_20_supported and Version(self.settings.compiler.version) >= required_compiler_version + @property def _min_compiler_version_nowide(self): # Nowide needs c++11 + swappable std::fstream return { - "gcc": 5, + "gcc": 4.8, "clang": 5, "Visual Studio": 14, # guess "msvc": 190, # guess @@ -365,6 +430,8 @@ def config_options(self): self.options.without_json = True self.options.without_nowide = True self.options.without_url = True + if Version(self.version) >= "1.85.0" and not self._has_cppstd_14_supported: + self.options.without_math = True # iconv is off by default on Windows and Solaris if self._is_windows_platform or self.settings.os == "SunOS": @@ -382,18 +449,17 @@ def config_options(self): if dep_name not in self._configure_options: delattr(self.options, f"without_{dep_name}") + def disable_math(): + super_modules = self._all_super_modules("math") + for smod in super_modules: + try: + setattr(self.options, f"without_{smod}", True) + except ConanException: + pass + if Version(self.version) >= "1.76.0": # Starting from 1.76.0, Boost.Math requires a c++11 capable compiler # ==> disable it by default for older compilers or c++ standards - - def disable_math(): - super_modules = self._all_super_modules("math") - for smod in super_modules: - try: - setattr(self.options, f"without_{smod}", True) - except ConanException: - pass - if self.settings.compiler.get_safe("cppstd"): if not valid_min_cppstd(self, 11): disable_math() @@ -403,6 +469,9 @@ def disable_math(): self.output.warning("Assuming the compiler supports c++11 by default") elif not self._has_cppstd_11_supported: disable_math() + # Boost.Math is not built when the compiler is GCC < 5 and uses C++11 + elif self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + disable_math() if Version(self.version) >= "1.79.0": # Starting from 1.79.0, Boost.Wave requires a c++11 capable compiler @@ -425,6 +494,9 @@ def disable_wave(): self.output.warning("Assuming the compiler supports c++11 by default") elif not self._has_cppstd_11_supported: disable_wave() + # Boost.Wave is not built when the compiler is GCC < 5 and uses C++11 + elif self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + disable_wave() if Version(self.version) >= "1.81.0": # Starting from 1.81.0, Boost.Locale requires a c++11 capable compiler @@ -447,6 +519,9 @@ def disable_locale(): self.output.warning("Assuming the compiler supports c++11 by default") elif not self._has_cppstd_11_supported: disable_locale() + # Boost.Locale is not built when the compiler is GCC < 5 and uses C++11 + elif self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + disable_locale() if Version(self.version) >= "1.84.0": # Starting from 1.84.0, Boost.Cobalt requires a c++20 capable compiler @@ -460,7 +535,9 @@ def disable_cobalt(): except ConanException: pass - if self.settings.compiler.get_safe("cppstd"): + if not self._has_coroutine_supported: + disable_cobalt() + elif self.settings.compiler.get_safe("cppstd"): if not valid_min_cppstd(self, 20): disable_cobalt() else: @@ -474,6 +551,21 @@ def disable_cobalt(): if is_msvc(self): self.options.without_fiber = True + if Version(self.version) >= "1.85.0": + # Starting from 1.85.0, Boost.Math requires a c++14 capable compiler + # https://github.com/boostorg/math/blob/boost-1.85.0/README.md + # ==> disable it by default for older compilers or c++ standards + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 14): + disable_math() + else: + min_compiler_version = self._min_compiler_version_default_cxx14 + if min_compiler_version is None: + self.output.warning("Assuming the compiler supports c++14 by default") + elif not self._has_cppstd_14_supported: + disable_math() + + @property def _configure_options(self): return self._dependencies["configure_options"] @@ -493,6 +585,11 @@ def _stacktrace_addr2line_available(self): return False return not self.options.header_only and not self.options.without_stacktrace and self.settings.os != "Windows" + @property + def _stacktrace_from_exception_available(self): + if Version(self.version) >= "1.85.0": + return not self.options.header_only and not self.options.without_stacktrace and self.settings.os != "Windows" + def configure(self): if self.options.header_only: self.options.rm_safe("shared") @@ -534,6 +631,11 @@ def configure(self): if self.options.without_fiber: self.options.rm_safe("numa") + # Use verbosity from [conf] if specified + verbosity = self.conf.get("tools.build:verbosity", default="quiet") + if verbosity == "verbose" and int(self.options.debug_level) < 2: + self.options.debug_level.value = 2 + def layout(self): basic_layout(self, src_folder="src") @@ -554,8 +656,28 @@ def _cxx11_boost_libraries(self): libraries.append("stacktrace") libraries.append("test") libraries.append("thread") + if Version(self.version) >= "1.85.0": + libraries.append("system") + libraries.sort() + return list(filter(lambda library: f"without_{library}" in self.options, libraries)) + + @property + def _cxx14_boost_libraries(self): + libraries = [] + if Version(self.version) >= "1.85.0": + # https://github.com/boostorg/math/blob/develop/README.md#boost-math-library + libraries.append("math") + libraries.sort() + return list(filter(lambda library: f"without_{library}" in self.options, libraries)) + + @property + def _cxx20_boost_libraries(self): + libraries = [] + if Version(self.version) >= "1.84.0": + # https://github.com/boostorg/cobalt/blob/boost-1.84.0/build/Jamfile#L54 + libraries.append("cobalt") libraries.sort() - return filter(lambda library: f"without_{library}" in self.options, libraries) + return list(filter(lambda library: f"without_{library}" in self.options, libraries)) def validate(self): if not self.options.multithreading: @@ -597,15 +719,20 @@ def validate(self): if mincompiler_version and Version(self.settings.compiler.version) < mincompiler_version: raise ConanInvalidConfiguration("This compiler is too old to build Boost.nowide.") - if any([not self.options.get_safe(f"without_{library}", True) for library in self._cxx11_boost_libraries]): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) - else: - if not self._has_cppstd_11_supported: + for cxx_standard, boost_libraries, has_cppstd_supported in [ + (11, self._cxx11_boost_libraries, self._has_cppstd_11_supported), + (14, self._cxx14_boost_libraries, self._has_cppstd_14_supported), + (20, self._cxx20_boost_libraries, self._has_cppstd_20_supported)]: + if any([not self.options.get_safe(f"without_{library}", True) for library in boost_libraries]): + if (self.settings.compiler.get_safe("cppstd") and not valid_min_cppstd(self, cxx_standard)) or \ + not has_cppstd_supported: raise ConanInvalidConfiguration( - f"Boost.{{{','.join(self._cxx11_boost_libraries)}}} requires a c++11 compiler " - "(please set compiler.cppstd or use a newer compiler)" + f"Boost libraries {', '.join(boost_libraries)} requires a C++{cxx_standard} compiler. " + "Please, set compiler.cppstd or use a newer compiler version or disable from building." ) + if not self.options.get_safe("without_cobalt", True) and not self._has_coroutine_supported: + raise ConanInvalidConfiguration("Boost.Cobalt requires a C++20 capable compiler. " + "Please, set compiler.cppstd and use a newer compiler version, or disable from building.") def _with_dependency(self, dependency): """ @@ -677,7 +804,7 @@ def package_id(self): def build_requirements(self): if not self.options.header_only: - self.tool_requires("b2/4.10.1") + self.tool_requires("b2/[>=5.2 <6]") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -1172,6 +1299,9 @@ def add_defines(library): flags.append(f"cxxstd={cppstd_version}") if "gnu" in safe_cppstd: flags.append("cxxstd-dialect=gnu") + elif Version(self.version) >= "1.85.0" and self._has_cppstd_14_supported: + cppstd_version = self._cppstd_flag("14") + flags.append(f"cxxstd={cppstd_version}") elif self._has_cppstd_11_supported: cppstd_version = self._cppstd_flag("11") flags.append(f"cxxstd={cppstd_version}") @@ -1241,6 +1371,10 @@ def add_defines(library): cxx_flags.append("-fembed-bitcode") if self._with_stacktrace_backtrace: flags.append(f"-sLIBBACKTRACE_PATH={self.dependencies['libbacktrace'].package_folder}") + if self._stacktrace_from_exception_available and "x86" not in str(self.settings.arch): + # https://github.com/boostorg/stacktrace/blob/boost-1.85.0/src/from_exception.cpp#L29 + # This feature is guarded by BOOST_STACKTRACE_ALWAYS_STORE_IN_PADDING, but that is only enabled on x86. + flags.append("define=BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK=1") if self._with_iconv: flags.append(f"-sICONV_PATH={self.dependencies['libiconv'].package_folder}") if self._with_icu: @@ -1260,6 +1394,10 @@ def add_defines(library): if self.options.get_safe("addr2line_location"): cxx_flags.append(f"-DBOOST_STACKTRACE_ADDR2LINE_LOCATION={self.options.addr2line_location}") + if not self.options.get_safe('without_cobalt', True) and \ + (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) == "10"): + cxx_flags.append("-fcoroutines") + cxx_flags = f'cxxflags="{" ".join(cxx_flags)}"' flags.append(cxx_flags) @@ -1344,6 +1482,9 @@ def _create_user_config_jam(self, folder): def create_library_config(deps_name, name): aggregated_cpp_info = self.dependencies[deps_name].cpp_info.aggregated_components() + if len(aggregated_cpp_info.libs) == 0: + return "" + includedir = aggregated_cpp_info.includedirs[0].replace("\\", "/") includedir = f"\"{includedir}\"" libdir = aggregated_cpp_info.libdirs[0].replace("\\", "/") @@ -1460,7 +1601,7 @@ def _toolset(self): return str(self.settings.compiler) if self.settings.compiler == "sun-cc": return "sunpro" - if self.settings.compiler == "intel": + if "intel" in str(self.settings.compiler): return { "Macos": "intel-darwin", "Windows": "intel-win", @@ -1749,7 +1890,9 @@ def filter_transform_module_libraries(names): for name in names: if name in ("boost_stacktrace_windbg", "boost_stacktrace_windbg_cached") and self.settings.os != "Windows": continue - if name in ("boost_stacktrace_addr2line", "boost_stacktrace_backtrace", "boost_stacktrace_basic",) and self.settings.os == "Windows": + if name in ("boost_math_c99l", "boost_math_tr1l") and str(self.settings.arch).startswith("ppc"): + continue + if name in ("boost_stacktrace_addr2line", "boost_stacktrace_backtrace", "boost_stacktrace_basic", "boost_stacktrace_from_exception",) and self.settings.os == "Windows": continue if name == "boost_stacktrace_addr2line" and not self._stacktrace_addr2line_available: continue @@ -1833,6 +1976,8 @@ def filter_transform_module_libraries(names): self.cpp_info.components["stacktrace_addr2line"].system_libs.append("dl") if self._with_stacktrace_backtrace: self.cpp_info.components["stacktrace_backtrace"].system_libs.append("dl") + if self._stacktrace_from_exception_available: + self.cpp_info.components["stacktrace_from_exception"].system_libs.append("dl") if self._stacktrace_addr2line_available: self.cpp_info.components["stacktrace_addr2line"].defines.extend([ @@ -1891,6 +2036,11 @@ def filter_transform_module_libraries(names): self.cpp_info.components["headers"].defines.append("BOOST_SP_USE_SPINLOCK") else: self.cpp_info.components["headers"].defines.extend(["BOOST_AC_DISABLE_THREADS", "BOOST_SP_DISABLE_THREADS"]) + + if not self.options.get_safe('without_cobalt', True) and \ + (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) == "10"): + self.cpp_info.components["cobalt"].cxxflags.append("-fcoroutines") + #TODO: remove in the future, user_info deprecated in conan2, but kept for compatibility while recipe is cross-compatible. self.user_info.stacktrace_addr2line_available = self._stacktrace_addr2line_available self.conf_info.define("user.boost:stacktrace_addr2line_available", self._stacktrace_addr2line_available) diff --git a/recipes/boost/all/dependencies/dependencies-1.85.0.yml b/recipes/boost/all/dependencies/dependencies-1.85.0.yml new file mode 100644 index 0000000000000..2306346f43372 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.85.0.yml @@ -0,0 +1,291 @@ +configure_options: +- atomic +- charconv +- chrono +- cobalt +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- url +- wave +dependencies: + atomic: [] + charconv: [] + chrono: + - system + cobalt: + - container + - system + container: [] + context: [] + contract: + - exception + - thread + coroutine: + - context + - exception + - system + date_time: [] + exception: [] + fiber: + - context + - filesystem + fiber_numa: + - fiber + filesystem: + - atomic + - system + graph: + - math + - random + - regex + - serialization + graph_parallel: + - filesystem + - graph + - mpi + - random + - serialization + iostreams: + - random + - regex + json: + - container + - system + locale: + - thread + log: + - atomic + - date_time + - exception + - filesystem + - random + - regex + - system + - thread + log_setup: + - log + math: [] + math_c99: + - math + math_c99f: + - math + math_c99l: + - math + math_tr1: + - math + math_tr1f: + - math + math_tr1l: + - math + mpi: + - graph + - serialization + mpi_python: + - mpi + - python + nowide: + - filesystem + numpy: + - python + prg_exec_monitor: + - test + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_from_exception: + - stacktrace + stacktrace_noop: + - stacktrace + stacktrace_windbg: + - stacktrace + stacktrace_windbg_cached: + - stacktrace + system: [] + test: + - exception + test_exec_monitor: + - test + thread: + - atomic + - chrono + - container + - date_time + - exception + - system + timer: [] + type_erasure: + - thread + unit_test_framework: + - prg_exec_monitor + - test + - test_exec_monitor + url: + - system + wave: + - filesystem + - serialization + wserialization: + - serialization +libs: + atomic: + - boost_atomic + charconv: + - boost_charconv + chrono: + - boost_chrono + cobalt: + - boost_cobalt + container: + - boost_container + context: + - boost_context + contract: + - boost_contract + coroutine: + - boost_coroutine + date_time: + - boost_date_time + exception: + - boost_exception + fiber: + - boost_fiber + fiber_numa: + - boost_fiber_numa + filesystem: + - boost_filesystem + graph: + - boost_graph + graph_parallel: + - boost_graph_parallel + iostreams: + - boost_iostreams + json: + - boost_json + locale: + - boost_locale + log: + - boost_log + log_setup: + - boost_log_setup + math: [] + math_c99: + - boost_math_c99 + math_c99f: + - boost_math_c99f + math_c99l: + - boost_math_c99l + math_tr1: + - boost_math_tr1 + math_tr1f: + - boost_math_tr1f + math_tr1l: + - boost_math_tr1l + mpi: + - boost_mpi + mpi_python: + - boost_mpi_python + nowide: + - boost_nowide + numpy: + - boost_numpy{py_major}{py_minor} + prg_exec_monitor: + - boost_prg_exec_monitor + program_options: + - boost_program_options + python: + - boost_python{py_major}{py_minor} + random: + - boost_random + regex: + - boost_regex + serialization: + - boost_serialization + stacktrace: [] + stacktrace_addr2line: + - boost_stacktrace_addr2line + stacktrace_backtrace: + - boost_stacktrace_backtrace + stacktrace_basic: + - boost_stacktrace_basic + stacktrace_from_exception: + - boost_stacktrace_from_exception + stacktrace_noop: + - boost_stacktrace_noop + stacktrace_windbg: + - boost_stacktrace_windbg + stacktrace_windbg_cached: + - boost_stacktrace_windbg_cached + system: + - boost_system + test: [] + test_exec_monitor: + - boost_test_exec_monitor + thread: + - boost_thread + timer: + - boost_timer + type_erasure: + - boost_type_erasure + unit_test_framework: + - boost_unit_test_framework + url: + - boost_url + wave: + - boost_wave + wserialization: + - boost_wserialization +requirements: + iostreams: + - bzip2 + - lzma + - zlib + - zstd + locale: + - iconv + - icu + python: + - python + regex: + - icu + stacktrace: + - backtrace +static_only: +- boost_exception +- boost_test_exec_monitor +version: 1.85.0 diff --git a/recipes/boost/all/patches/1.85.0-container-aliasing-violation-fix.patch b/recipes/boost/all/patches/1.85.0-container-aliasing-violation-fix.patch new file mode 100644 index 0000000000000..aa3c821fde524 --- /dev/null +++ b/recipes/boost/all/patches/1.85.0-container-aliasing-violation-fix.patch @@ -0,0 +1,417 @@ +From a92131b34b78f7f010881750ecb8b4ce274511d2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= +Date: Sun, 28 Apr 2024 23:29:59 +0200 +Subject: [PATCH 1/1] Remove UB in flat_map implementation when the + implementation has a movable std::pair + +--- + boost/container/allocator_traits.hpp | 144 +++++++++++++++++- + boost/container/detail/construct_in_place.hpp | 36 ++++- + boost/container/flat_map.hpp | 67 ++++++-- + 3 files changed, 229 insertions(+), 18 deletions(-) + +diff --git a/boost/container/allocator_traits.hpp b/boost/container/allocator_traits.hpp +index cdb6683e8..8e2fafa7f 100644 +--- a/boost/container/allocator_traits.hpp ++++ b/boost/container/allocator_traits.hpp +@@ -32,6 +32,8 @@ + #include + #include //is_empty + #include ++#include ++#include + #ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP + #include + #endif +@@ -81,6 +83,144 @@ + + namespace boost { + namespace container { ++namespace dtl { ++ ++#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) ++ ++template ++BOOST_CONTAINER_FORCEINLINE void construct_type(T *p, BOOST_FWD_REF(Args) ...args) ++{ ++ ::new((void*)p, boost_container_new_t()) T(::boost::forward(args)...); ++} ++ ++template < class Pair, class KeyType, class ... Args> ++typename dtl::enable_if< dtl::is_pair, void >::type ++construct_type ++ (Pair* p, try_emplace_t, BOOST_FWD_REF(KeyType) k, BOOST_FWD_REF(Args) ...args) ++{ ++ construct_type(dtl::addressof(p->first), ::boost::forward(k)); ++ BOOST_CONTAINER_TRY{ ++ construct_type(dtl::addressof(p->second), ::boost::forward(args)...); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename Pair::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++#else ++ ++#define BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPEJ(N) \ ++template\ ++BOOST_CONTAINER_FORCEINLINE \ ++ typename dtl::disable_if_c::value, void >::type \ ++construct_type(T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ ++{\ ++ ::new((void*)p, boost_container_new_t()) T( BOOST_MOVE_FWD##N );\ ++}\ ++// ++BOOST_MOVE_ITERATE_0TO8(BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPEJ) ++#undef BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPEJ ++ ++#define BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPE(N) \ ++template < class Pair, class KeyType BOOST_MOVE_I##N BOOST_MOVE_CLASS##N>\ ++typename dtl::enable_if< dtl::is_pair, void >::type construct_type\ ++ (Pair* p, try_emplace_t, BOOST_FWD_REF(KeyType) k BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ ++{\ ++ construct_type(dtl::addressof(p->first), ::boost::forward(k));\ ++ BOOST_CONTAINER_TRY{\ ++ construct_type(dtl::addressof(p->second) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\ ++ }\ ++ BOOST_CONTAINER_CATCH(...) {\ ++ typedef typename Pair::first_type first_type;\ ++ dtl::addressof(p->first)->~first_type();\ ++ BOOST_CONTAINER_RETHROW\ ++ }\ ++ BOOST_CONTAINER_CATCH_END\ ++}\ ++// ++BOOST_MOVE_ITERATE_0TO8(BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPE) ++#undef BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPE ++ ++#endif ++ ++template ++inline ++typename dtl::enable_if, void >::type ++construct_type(T* p) ++{ ++ dtl::construct_type(dtl::addressof(p->first)); ++ BOOST_CONTAINER_TRY{ ++ dtl::construct_type(dtl::addressof(p->second)); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename T::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++ ++template ++inline ++typename dtl::enable_if_c ++ < dtl::is_pair::value ++ , void >::type ++construct_type(T* p, U &u) ++{ ++ dtl::construct_type(dtl::addressof(p->first), u.first); ++ BOOST_CONTAINER_TRY{ ++ dtl::construct_type(dtl::addressof(p->second), u.second); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename T::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++template ++inline ++typename dtl::enable_if_c ++ < dtl::is_pair::type>::value && ++ !boost::move_detail::is_reference::value //This is needed for MSVC10 and ambiguous overloads ++ , void >::type ++construct_type(T* p, BOOST_RV_REF(U) u) ++{ ++ dtl::construct_type(dtl::addressof(p->first), ::boost::move(u.first)); ++ BOOST_CONTAINER_TRY{ ++ dtl::construct_type(dtl::addressof(p->second), ::boost::move(u.second)); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename T::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++template ++inline ++typename dtl::enable_if, void >::type ++construct_type(T* p, BOOST_FWD_REF(U) x, BOOST_FWD_REF(V) y) ++{ ++ dtl::construct_type(dtl::addressof(p->first), ::boost::forward(x)); ++ BOOST_CONTAINER_TRY{ ++ dtl::construct_type(dtl::addressof(p->second), ::boost::forward(y)); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename T::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++} //namespace dtl + + #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED + +@@ -419,7 +559,7 @@ struct allocator_traits + + template + inline static void priv_construct(dtl::false_type, Allocator &, T *p, BOOST_FWD_REF(Args) ...args) +- { ::new((void*)p, boost_container_new_t()) T(::boost::forward(args)...); } ++ { dtl::construct_type(p, ::boost::forward(args)...); } + #else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + public: + +@@ -450,7 +590,7 @@ struct allocator_traits + \ + template\ + inline static void priv_construct(dtl::false_type, Allocator &, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ +- { ::new((void*)p, boost_container_new_t()) T(BOOST_MOVE_FWD##N); }\ ++ { dtl::construct_type(p BOOST_MOVE_I##N BOOST_MOVE_FWD##N); }\ + // + BOOST_MOVE_ITERATE_0TO8(BOOST_CONTAINER_ALLOCATOR_TRAITS_PRIV_CONSTRUCT_IMPL) + #undef BOOST_CONTAINER_ALLOCATOR_TRAITS_PRIV_CONSTRUCT_IMPL +diff --git a/boost/container/detail/construct_in_place.hpp b/boost/container/detail/construct_in_place.hpp +index d824d814a..bfdf05c2e 100644 +--- a/boost/container/detail/construct_in_place.hpp ++++ b/boost/container/detail/construct_in_place.hpp +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + namespace boost { + namespace container { +@@ -62,9 +63,42 @@ BOOST_CONTAINER_FORCEINLINE void construct_in_place(Allocator &a, T *dest, empla + + //Assignment + ++template ++BOOST_CONTAINER_FORCEINLINE ++ typename dtl::disable_if_c ++ < dtl::is_pair::type>::value ++ && dtl::is_pair::type>::value ++ , void>::type ++assign_in_place_ref(T &t, BOOST_FWD_REF(U) u) ++{ t = ::boost::forward(u); } ++ ++template ++BOOST_CONTAINER_FORCEINLINE ++ typename dtl::enable_if_c ++ < dtl::is_pair::type>::value ++ && dtl::is_pair::type>::value ++ , void>::type ++assign_in_place_ref(T &t, const U &u) ++{ ++ assign_in_place_ref(t.first, u.first); ++ assign_in_place_ref(t.second, u.second); ++} ++ ++template ++BOOST_CONTAINER_FORCEINLINE ++ typename dtl::enable_if_c ++ < dtl::is_pair::type>::value ++ && dtl::is_pair::type>::value ++ , void>::type ++assign_in_place_ref(T &t, BOOST_RV_REF(U) u) ++{ ++ assign_in_place_ref(t.first, ::boost::move(u.first)); ++ assign_in_place_ref(t.second, ::boost::move(u.second)); ++} ++ + template + BOOST_CONTAINER_FORCEINLINE void assign_in_place(DstIt dest, InpIt source) +-{ *dest = *source; } ++{ assign_in_place_ref(*dest, *source); } + + template + BOOST_CONTAINER_FORCEINLINE void assign_in_place(DstIt dest, value_init_construct_iterator) +diff --git a/boost/container/flat_map.hpp b/boost/container/flat_map.hpp +index b092fb212..e4843f566 100644 +--- a/boost/container/flat_map.hpp ++++ b/boost/container/flat_map.hpp +@@ -48,6 +48,11 @@ + #include + #endif + ++#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) ++#define BOOST_CONTAINER_STD_PAIR_IS_MOVABLE ++#endif ++ ++ + namespace boost { + namespace container { + +@@ -58,21 +63,37 @@ class flat_multimap; + + namespace dtl{ + ++#if defined(BOOST_CONTAINER_STD_PAIR_IS_MOVABLE) + template + BOOST_CONTAINER_FORCEINLINE static D &force(S &s) +-{ return *move_detail::force_ptr(&s); } ++{ return s; } + + template + BOOST_CONTAINER_FORCEINLINE static const D &force(const S &s) +-{ return *move_detail::force_ptr(&s); } ++{ return s; } ++ ++template ++BOOST_CONTAINER_FORCEINLINE static D force_copy(D s) ++{ return s; } ++ ++#else //!BOOST_CONTAINER_DOXYGEN_INVOKED ++ ++template ++BOOST_CONTAINER_FORCEINLINE static D &force(S &s) ++{ return *move_detail::launder_cast(&s); } ++ ++template ++BOOST_CONTAINER_FORCEINLINE static const D &force(const S &s) ++{ return *move_detail::launder_cast(&s); } + + template + BOOST_CONTAINER_FORCEINLINE static D force_copy(const S &s) + { +- const D *const vp = move_detail::force_ptr(&s); ++ const D *const vp = move_detail::launder_cast(&s); + D ret_val(*vp); + return ret_val; + } ++#endif //BOOST_CONTAINER_DOXYGEN_INVOKED + + } //namespace dtl{ + +@@ -118,18 +139,27 @@ class flat_map + private: + BOOST_COPYABLE_AND_MOVABLE(flat_map) + //This is the tree that we should store if pair was movable ++ typedef std::pair std_pair_t; + typedef dtl::flat_tree< +- std::pair, ++ std_pair_t, + dtl::select1st, + Compare, + AllocatorOrContainer> tree_t; + + //This is the real tree stored here. It's based on a movable pair ++ typedef dtl::pair dtl_pair_t; ++ ++ #ifdef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE ++ typedef std_pair_t impl_pair_t; ++ #else ++ typedef dtl_pair_t impl_pair_t; ++ #endif ++ + typedef dtl::flat_tree< +- dtl::pair, ++ impl_pair_t, + dtl::select1st, + Compare, +- typename dtl::container_or_allocator_rebind >::type ++ typename dtl::container_or_allocator_rebind::type + > impl_tree_t; + impl_tree_t m_flat_tree; // flat tree representing flat_map + +@@ -851,7 +881,7 @@ class flat_map + //! @copydoc ::boost::container::flat_set::nth(size_type) const + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + const_iterator nth(size_type n) const BOOST_NOEXCEPT_OR_NOTHROW +- { return dtl::force_copy(m_flat_tree.nth(n)); } ++ { return dtl::force_copy(m_flat_tree.nth(n)); } + + //! @copydoc ::boost::container::flat_set::index_of(iterator) + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline +@@ -1099,7 +1129,7 @@ class flat_map + template + inline BOOST_CONTAINER_DOC1ST + ( std::pair +- , typename dtl::enable_if_c::value ++ , typename dtl::enable_if_c::value + BOOST_MOVE_I std::pair >::type) + insert(BOOST_FWD_REF(Pair) x) + { +@@ -1153,7 +1183,7 @@ class flat_map + template + inline BOOST_CONTAINER_DOC1ST + ( iterator +- , typename dtl::enable_if_c::value ++ , typename dtl::enable_if_c::value + BOOST_MOVE_I iterator>::type) + insert(const_iterator p, BOOST_FWD_REF(Pair) x) + { +@@ -1777,17 +1807,24 @@ class flat_multimap + #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED + private: + BOOST_COPYABLE_AND_MOVABLE(flat_multimap) ++ typedef std::pair std_pair_t; + typedef dtl::flat_tree< +- std::pair, ++ std_pair_t, + dtl::select1st, + Compare, + AllocatorOrContainer> tree_t; + //This is the real tree stored here. It's based on a movable pair ++ typedef dtl::pair dtl_pair_t; ++ #ifdef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE ++ typedef std_pair_t impl_pair_t; ++ #else ++ typedef dtl_pair_t impl_pair_t; ++ #endif + typedef dtl::flat_tree< +- dtl::pair, ++ impl_pair_t, + dtl::select1st, + Compare, +- typename dtl::container_or_allocator_rebind >::type ++ typename dtl::container_or_allocator_rebind::type + > impl_tree_t; + impl_tree_t m_flat_tree; // flat tree representing flat_map + +@@ -2388,7 +2425,7 @@ class flat_multimap + //! @copydoc ::boost::container::flat_set::nth(size_type) const + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + const_iterator nth(size_type n) const BOOST_NOEXCEPT_OR_NOTHROW +- { return dtl::force_copy(m_flat_tree.nth(n)); } ++ { return dtl::force_copy(m_flat_tree.nth(n)); } + + //! @copydoc ::boost::container::flat_set::index_of(iterator) + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline +@@ -2477,7 +2514,7 @@ class flat_multimap + template + inline BOOST_CONTAINER_DOC1ST + ( iterator +- , typename dtl::enable_if_c::value ++ , typename dtl::enable_if_c::value + BOOST_MOVE_I iterator >::type) + insert(BOOST_FWD_REF(Pair) x) + { return dtl::force_copy(m_flat_tree.emplace_equal(boost::forward(x))); } +@@ -2514,7 +2551,7 @@ class flat_multimap + template + inline BOOST_CONTAINER_DOC1ST + ( iterator +- , typename dtl::enable_if_c::value ++ , typename dtl::enable_if_c::value + BOOST_MOVE_I iterator>::type) + insert(const_iterator p, BOOST_FWD_REF(Pair) x) + { +-- +2.31.1 + diff --git a/recipes/boost/all/rebuild-dependencies.py b/recipes/boost/all/rebuild-dependencies.py index 8bbfc5c8280fa..d9f286b2135d6 100755 --- a/recipes/boost/all/rebuild-dependencies.py +++ b/recipes/boost/all/rebuild-dependencies.py @@ -25,6 +25,7 @@ # `conanfile.py` and re-run this script. CONFIGURE_OPTIONS = ( "atomic", + "charconv", "chrono", "cobalt", "container", diff --git a/recipes/boost/all/test_package/CMakeLists.txt b/recipes/boost/all/test_package/CMakeLists.txt index 5311cfc4c17e7..07afcb4019d69 100644 --- a/recipes/boost/all/test_package/CMakeLists.txt +++ b/recipes/boost/all/test_package/CMakeLists.txt @@ -34,6 +34,7 @@ if(NOT HEADER_ONLY) find_package(Boost COMPONENTS unit_test_framework REQUIRED) add_executable(test_exe test.cpp) target_link_libraries(test_exe PRIVATE Boost::unit_test_framework) + set_property(TARGET test_exe PROPERTY CXX_STANDARD 11) add_test(NAME boost_test COMMAND test_exe) endif() @@ -41,6 +42,7 @@ if(NOT HEADER_ONLY) find_package(Boost COMPONENTS coroutine REQUIRED) add_executable(coroutine_exe coroutine.cpp) target_link_libraries(coroutine_exe PRIVATE Boost::coroutine) + set_property(TARGET coroutine_exe PROPERTY CXX_STANDARD 11) add_test(NAME coroutine_test COMMAND coroutine_exe) endif() diff --git a/recipes/boost/config.yml b/recipes/boost/config.yml index 0b6963fec8f23..3363c84d6a537 100644 --- a/recipes/boost/config.yml +++ b/recipes/boost/config.yml @@ -1,4 +1,6 @@ versions: + "1.85.0": + folder: all "1.84.0": folder: all "1.83.0": diff --git a/recipes/botan/all/conandata.yml b/recipes/botan/all/conandata.yml index 67a7d6257434c..3472b4e6e2200 100644 --- a/recipes/botan/all/conandata.yml +++ b/recipes/botan/all/conandata.yml @@ -32,6 +32,9 @@ sources: "3.3.0": url: "https://github.com/randombit/botan/archive/3.3.0.tar.gz" sha256: "57fefda7b9ab6f8409329620cdaf26d2d7e962b6a10eb321d331e9ecb796f804" + "3.4.0": + url: "https://github.com/randombit/botan/archive/3.4.0.tar.gz" + sha256: "6ef2a16a0527b1cfc9648a644877f7b95c4d07e8ef237273b030c623418c5e5b" patches: "2.18.2": - patch_file: "patches/fix-amalgamation-build.patch" diff --git a/recipes/botan/all/conanfile.py b/recipes/botan/all/conanfile.py index d211b39ca041f..082f448005d3f 100644 --- a/recipes/botan/all/conanfile.py +++ b/recipes/botan/all/conanfile.py @@ -193,7 +193,7 @@ def validate(self): minimum_version = self._compilers_minimum_version.get(compiler_name, 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 C++{self._min_cppstd}, which your compiler does not support (minimum {compiler_name} {minimum_version})." ) if not minimum_version: self.output.warning(f"{self.name} recipe lacks information about the {compiler_name} compiler support.") @@ -457,7 +457,7 @@ def _configure_cmd(self): ' --extra-cxxflags="{cxxflags}"' ' --cc={compiler}' ' --cpu={cpu}' - ' --prefix={prefix}' + ' --prefix="{prefix}"' ' --os={os}' ' {build_flags}').format( python_call=call_python, @@ -516,6 +516,8 @@ def _is_glibc_older_than_2_25_on_linux(self): # https://github.com/conan-io/conan-center-index/pull/18079#issuecomment-1919206949 # https://github.com/conan-io/conan-center-index/pull/18079#issuecomment-1919486839 + if self.settings.os != 'Linux': + return False libver = platform.libc_ver() return ( self.settings.os == 'Linux' and diff --git a/recipes/botan/config.yml b/recipes/botan/config.yml index 9230bceaba6c6..97827ec9a391e 100644 --- a/recipes/botan/config.yml +++ b/recipes/botan/config.yml @@ -21,3 +21,5 @@ versions: folder: all "3.3.0": folder: all + "3.4.0": + folder: all diff --git a/recipes/box2d/2.4.x/conanfile.py b/recipes/box2d/2.4.x/conanfile.py index ae09ce435deda..cc297963ae36d 100644 --- a/recipes/box2d/2.4.x/conanfile.py +++ b/recipes/box2d/2.4.x/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.scm import Version -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class Box2dConan(ConanFile): @@ -14,27 +14,27 @@ class Box2dConan(ConanFile): homepage = "http://box2d.org/" url = "https://github.com/conan-io/conan-center-index" topics = ("physics-engine", "graphic", "2d", "collision") + package_type = "library" settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], - "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True,} + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } def export_sources(self): export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") 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/bredis/all/conandata.yml b/recipes/bredis/all/conandata.yml new file mode 100644 index 0000000000000..b75947b37ddc5 --- /dev/null +++ b/recipes/bredis/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.12": + url: "https://github.com/basiliscos/cpp-bredis/archive/refs/tags/v0.12.tar.gz" + sha256: "c5a6aa58835d5ef8cd97c4ae7e677f6237ef4ee01ae4a609293e2351c01db6cc" diff --git a/recipes/bredis/all/conanfile.py b/recipes/bredis/all/conanfile.py new file mode 100644 index 0000000000000..c73f99338488a --- /dev/null +++ b/recipes/bredis/all/conanfile.py @@ -0,0 +1,57 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + +class BredisConan(ConanFile): + name = "bredis" + description = "Boost::ASIO low-level redis client (connector)" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/basiliscos/cpp-bredis" + topics = ("redis", "network", "asio", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.85.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) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + copy( + self, + pattern="*.ipp", + 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/bredis/all/test_package/CMakeLists.txt b/recipes/bredis/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ede594d5b149f --- /dev/null +++ b/recipes/bredis/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(bredis REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE bredis::bredis) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bredis/all/test_package/conanfile.py b/recipes/bredis/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/bredis/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/bredis/all/test_package/test_package.cpp b/recipes/bredis/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9a85a98f4bd7f --- /dev/null +++ b/recipes/bredis/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +#include "bredis/Connection.hpp" +#include "bredis/MarkerHelpers.hpp" + +int main(int argc, const char **argv) { + // Basic test avoiding any kind of access to network layer + bredis::bredis_category category; + std::cout << category.name() << '\n'; + return 0; +} diff --git a/recipes/bredis/config.yml b/recipes/bredis/config.yml new file mode 100644 index 0000000000000..f30ab3fc58bb9 --- /dev/null +++ b/recipes/bredis/config.yml @@ -0,0 +1,3 @@ +versions: + "0.12": + folder: all diff --git a/recipes/bshoshany-thread-pool/all/conandata.yml b/recipes/bshoshany-thread-pool/all/conandata.yml index 3f31e9885d1c3..679f32bc31769 100644 --- a/recipes/bshoshany-thread-pool/all/conandata.yml +++ b/recipes/bshoshany-thread-pool/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.1.0": + sha256: "be7abecbc420bb87919eeef729b13ff7c29d5ce547bdae284923296c695415bd" + url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v4.1.0.tar.gz" "4.0.1": sha256: "34d25503e17e58198613d9306313f8358cfaaa9320f2b7694dc599b90a1858a7" url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v4.0.1.tar.gz" diff --git a/recipes/bshoshany-thread-pool/config.yml b/recipes/bshoshany-thread-pool/config.yml index 31ec3f0d00429..56c2c868cfbdf 100644 --- a/recipes/bshoshany-thread-pool/config.yml +++ b/recipes/bshoshany-thread-pool/config.yml @@ -1,4 +1,6 @@ versions: + "4.1.0": + folder: all "4.0.1": folder: all "3.5.0": diff --git a/recipes/bvdberg-ctest/all/conandata.yml b/recipes/bvdberg-ctest/all/conandata.yml index c756f17b12c18..31bd2b82ba362 100644 --- a/recipes/bvdberg-ctest/all/conandata.yml +++ b/recipes/bvdberg-ctest/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://github.com/bvdberg/ctest/archive/1.1.0.tar.gz" + sha256: "6792d7a21f62ec9caa64fc5106c8c8eed9201f1d98571917d370d0b5af721f49" "1.0.0": - sha256: 80c5899f529dc57c1eb44113fe452cd90fd69cd1ab3a0431635282f56837205c - url: https://github.com/bvdberg/ctest/archive/1.0.0.tar.gz + url: "https://github.com/bvdberg/ctest/archive/1.0.0.tar.gz" + sha256: "80c5899f529dc57c1eb44113fe452cd90fd69cd1ab3a0431635282f56837205c" diff --git a/recipes/bvdberg-ctest/all/conanfile.py b/recipes/bvdberg-ctest/all/conanfile.py index 7786a8fb5c6c8..28b74d733c02a 100644 --- a/recipes/bvdberg-ctest/all/conanfile.py +++ b/recipes/bvdberg-ctest/all/conanfile.py @@ -6,14 +6,13 @@ required_conan_version = ">=1.50.0" - class BvdbergCtestConan(ConanFile): name = "bvdberg-ctest" + description = "ctest is a unit test framework for software written in C." license = "Apache-2.0" - homepage = "https://github.com/bvdberg/ctest" url = "https://github.com/conan-io/conan-center-index" - description = "ctest is a unit test framework for software written in C." - topics = ("testing", "testing-framework", "unit-testing") + homepage = "https://github.com/bvdberg/ctest" + topics = ("testing", "testing-framework", "unit-testing", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -26,14 +25,11 @@ def package_id(self): def validate(self): if self.settings.os == "Windows": - raise ConanInvalidConfiguration("Windows not supported") + raise ConanInvalidConfiguration(f"{self.ref} does not support Windows.") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build(self): - pass - def package(self): 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")) diff --git a/recipes/bvdberg-ctest/all/test_package/conanfile.py b/recipes/bvdberg-ctest/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/bvdberg-ctest/all/test_package/conanfile.py +++ b/recipes/bvdberg-ctest/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/bvdberg-ctest/all/test_v1_package/CMakeLists.txt b/recipes/bvdberg-ctest/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index fd0d83ce8ad41..0000000000000 --- a/recipes/bvdberg-ctest/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(bvdberg-ctest REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE bvdberg-ctest::bvdberg-ctest) diff --git a/recipes/bvdberg-ctest/all/test_v1_package/conanfile.py b/recipes/bvdberg-ctest/all/test_v1_package/conanfile.py deleted file mode 100644 index f2243371b7f1d..0000000000000 --- a/recipes/bvdberg-ctest/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - - 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") - bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/bvdberg-ctest/config.yml b/recipes/bvdberg-ctest/config.yml index c7f13630776fb..fcbfca5b9011e 100644 --- a/recipes/bvdberg-ctest/config.yml +++ b/recipes/bvdberg-ctest/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.0": + folder: "all" "1.0.0": folder: "all" diff --git a/recipes/c-ares/all/conandata.yml b/recipes/c-ares/all/conandata.yml index 3833dbb894ff0..4085cf579ede7 100644 --- a/recipes/c-ares/all/conandata.yml +++ b/recipes/c-ares/all/conandata.yml @@ -1,31 +1,27 @@ sources: + "1.32.1": + url: "https://github.com/c-ares/c-ares/releases/download/v1.32.1/c-ares-1.32.1.tar.gz" + sha256: "63be2c4ee121faa47e9766f735b4cde750fff2c563f81c11e572d3dc6401e5e7" + "1.31.0": + url: "https://github.com/c-ares/c-ares/releases/download/v1.31.0/c-ares-1.31.0.tar.gz" + sha256: "0167a33dba96ca8de29f3f598b1e6cabe531799269fd63d0153aa0e6f5efeabd" + "1.30.0": + url: "https://github.com/c-ares/c-ares/releases/download/v1.30.0/c-ares-1.30.0.tar.gz" + sha256: "4fea312112021bcef081203b1ea020109842feb58cd8a36a3d3f7e0d8bc1138c" + "1.28.1": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_28_1/c-ares-1.28.1.tar.gz" + sha256: "675a69fc54ddbf42e6830bc671eeb6cd89eeca43828eb413243fd2c0a760809d" "1.27.0": url: "https://github.com/c-ares/c-ares/releases/download/cares-1_27_0/c-ares-1.27.0.tar.gz" sha256: "0a72be66959955c43e2af2fbd03418e82a2bd5464604ec9a62147e37aceb420b" "1.26.0": url: "https://github.com/c-ares/c-ares/releases/download/cares-1_26_0/c-ares-1.26.0.tar.gz" sha256: "bed58c4f02b009080ebda6c2467ba469722ac6aebbf4497dc44a83d8c6194e50" + # keep 1.25.0 for libnghttp2, trantor, libcoro "1.25.0": url: "https://github.com/c-ares/c-ares/releases/download/cares-1_25_0/c-ares-1.25.0.tar.gz" sha256: "71832b93a48f5ff579c505f4869120c14e57b783275367207f1a98314aa724e5" - "1.22.1": - url: "https://github.com/c-ares/c-ares/releases/download/cares-1_22_1/c-ares-1.22.1.tar.gz" - sha256: "f67c180deb799c670d9dda995a18ce06f6c7320b6c6363ff8fa85b77d0da9db8" - "1.22.0": - url: "https://github.com/c-ares/c-ares/releases/download/cares-1_22_0/c-ares-1.22.0.tar.gz" - sha256: "ad2e205088083317147c9f9eab5f24b82c3d50927c381a7c963deeb1182dbc21" - "1.21.0": - url: "https://github.com/c-ares/c-ares/releases/download/cares-1_21_0/c-ares-1.21.0.tar.gz" - sha256: "cd7aa3af1d3ee780d6437039a7ddb7f1ec029f9c4f7aabb0197e384eb5bc2f2d" - "1.20.1": - url: "https://github.com/c-ares/c-ares/releases/download/cares-1_20_1/c-ares-1.20.1.tar.gz" - sha256: "de24a314844cb157909730828560628704f4f896d167dd7da0fa2fb93ea18b10" + # keep 1.19.1 for grpc "1.19.1": url: "https://github.com/c-ares/c-ares/releases/download/cares-1_19_1/c-ares-1.19.1.tar.gz" sha256: "321700399b72ed0e037d0074c629e7741f6b2ec2dda92956abe3e9671d3e268e" - "1.19.0": - url: "https://github.com/c-ares/c-ares/releases/download/cares-1_19_0/c-ares-1.19.0.tar.gz" - sha256: "bfceba37e23fd531293829002cac0401ef49a6dc55923f7f92236585b7ad1dd3" - "1.18.1": - url: "https://github.com/c-ares/c-ares/releases/download/cares-1_18_1/c-ares-1.18.1.tar.gz" - sha256: "1a7d52a8a84a9fbffb1be9133c0f6e17217d91ea5a6fa61f6b4729cda78ebbcf" diff --git a/recipes/c-ares/all/conanfile.py b/recipes/c-ares/all/conanfile.py index 48b02d5029162..635628761aed5 100644 --- a/recipes/c-ares/all/conanfile.py +++ b/recipes/c-ares/all/conanfile.py @@ -10,12 +10,11 @@ class CAresConan(ConanFile): name = "c-ares" + description = "A C library for asynchronous DNS requests" license = "MIT" url = "https://github.com/conan-io/conan-center-index" - description = "A C library for asynchronous DNS requests" - topics = ("dns", "resolver", "async") homepage = "https://c-ares.haxx.se/" - + topics = ("dns", "resolver", "async") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -83,8 +82,7 @@ def package_info(self): self.cpp_info.components["cares"].system_libs.append("pthread") elif self.settings.os == "Windows": self.cpp_info.components["cares"].system_libs.extend(["ws2_32", "advapi32"]) - if Version(self.version) >= "1.18.0": - self.cpp_info.components["cares"].system_libs.append("iphlpapi") + self.cpp_info.components["cares"].system_libs.append("iphlpapi") elif is_apple_os(self): self.cpp_info.components["cares"].system_libs.append("resolv") diff --git a/recipes/c-ares/all/test_package/test_package.c b/recipes/c-ares/all/test_package/test_package.c index 0023e9dae2282..0636b1f4dce35 100644 --- a/recipes/c-ares/all/test_package/test_package.c +++ b/recipes/c-ares/all/test_package/test_package.c @@ -103,7 +103,6 @@ main(void) return 1; } - ares_gethostbyname(channel, "google.com", AF_INET, callback, NULL); wait_ares(channel); ares_destroy(channel); ares_library_cleanup(); diff --git a/recipes/c-ares/config.yml b/recipes/c-ares/config.yml index 75dbe67cad1ac..32d339359feea 100644 --- a/recipes/c-ares/config.yml +++ b/recipes/c-ares/config.yml @@ -1,21 +1,17 @@ versions: - "1.27.0": + "1.32.1": folder: all - "1.26.0": + "1.31.0": folder: all - "1.25.0": + "1.30.0": folder: all - "1.22.1": + "1.28.1": folder: all - "1.22.0": + "1.27.0": folder: all - "1.21.0": + "1.26.0": folder: all - "1.20.1": + "1.25.0": folder: all "1.19.1": folder: all - "1.19.0": - folder: all - "1.18.1": - folder: all diff --git a/recipes/c-blosc2/all/conandata.yml b/recipes/c-blosc2/all/conandata.yml index 6975b1d26667a..5b441b6002794 100644 --- a/recipes/c-blosc2/all/conandata.yml +++ b/recipes/c-blosc2/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.15.0": + url: "https://github.com/Blosc/c-blosc2/archive/v2.15.0.tar.gz" + sha256: "1e7d9d099963ad0123ddd76b2b715b5aa1ea4b95c491d3a11508e487ebab7307" + "2.14.4": + url: "https://github.com/Blosc/c-blosc2/archive/v2.14.4.tar.gz" + sha256: "b5533c79aacc9ac152c80760ed1295a6608938780c3e1eecd7e53ea72ad986b0" "2.13.1": url: "https://github.com/Blosc/c-blosc2/archive/v2.13.1.tar.gz" sha256: "6e7f5940269acd54d8dfe87c2102a442ad0407b1a62266a6f916134bae234399" @@ -14,38 +20,32 @@ sources: "2.10.5": url: "https://github.com/Blosc/c-blosc2/archive/v2.10.5.tar.gz" sha256: "a88f94bf839c1371aab8207a6a43698ceb92c72f65d0d7fe5b6e59f24c138b4d" - "2.8.0": - url: "https://github.com/Blosc/c-blosc2/archive/v2.8.0.tar.gz" - sha256: "be608cdf68deb02e0d3ee62e183942a0fe5d5d3185375b9b6566e2ae35a9bdbd" - "2.6.1": - url: "https://github.com/Blosc/c-blosc2/archive/v2.6.1.tar.gz" - sha256: "514a793368093893c1a7cae030f7e31faca7f86465ae69dd576f256d8bf28c08" patches: + "2.15.0": + - patch_file: "patches/2.10.5-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + "2.14.4": + - patch_file: "patches/2.10.5-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "2.13.1": - - patch_file: "patches/2.11.1-0001-fix-cmake.patch" + - patch_file: "patches/2.10.5-0001-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" "2.13.0": - - patch_file: "patches/2.11.1-0001-fix-cmake.patch" + - patch_file: "patches/2.10.5-0001-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" "2.12.0": - - patch_file: "patches/2.11.1-0001-fix-cmake.patch" + - patch_file: "patches/2.10.5-0001-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" "2.11.3": - - patch_file: "patches/2.11.1-0001-fix-cmake.patch" + - patch_file: "patches/2.10.5-0001-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" "2.10.5": - patch_file: "patches/2.10.5-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" - patch_type: "conan" - "2.6.1": - - patch_file: "patches/2.6.0-0001-fix-cmake.patch" - patch_description: "use cci package" - patch_type: "conan" diff --git a/recipes/c-blosc2/all/conanfile.py b/recipes/c-blosc2/all/conanfile.py index 33223628423bf..f3c1a5b0b470f 100644 --- a/recipes/c-blosc2/all/conanfile.py +++ b/recipes/c-blosc2/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv -from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy, rm, rmdir +from conan.tools.files import get, copy, rm, rmdir, export_conandata_patches, apply_conandata_patches from conan.tools.microsoft import is_msvc from conan.tools.scm import Version @@ -114,6 +114,13 @@ def generate(self): tc.generate() deps = CMakeDeps(self) + if self.options.with_lz4: + deps.set_property("lz4", "cmake_file_name", "LZ4") + if self.options.with_zlib =="zlib-ng": + deps.set_property("zlib-ng", "cmake_file_name", "ZLIB_NG") + deps.set_property("zlib-ng", "cmake_target_name", "ZLIB_NG::ZLIB_NG") + if self.options.with_zstd: + deps.set_property("zstd", "cmake_file_name", "ZSTD") deps.generate() def _patch_sources(self): diff --git a/recipes/c-blosc2/all/patches/2.10.5-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.10.5-0001-fix-cmake.patch index 743a69c503d24..7b59364e4a949 100644 --- a/recipes/c-blosc2/all/patches/2.10.5-0001-fix-cmake.patch +++ b/recipes/c-blosc2/all/patches/2.10.5-0001-fix-cmake.patch @@ -1,138 +1,54 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 19e203a..aa6ccdd 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -167,26 +167,26 @@ else() - 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) -@@ -207,8 +207,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 8c7cf90..f7efbf5 100644 --- a/blosc/CMakeLists.txt +++ b/blosc/CMakeLists.txt -@@ -79,15 +79,15 @@ set(INTERNAL_LIBS ${PROJECT_SOURCE_DIR}/internal-complibs) +@@ -79,8 +79,8 @@ set(INTERNAL_LIBS ${PROJECT_SOURCE_DIR}/internal-complibs) # link dependencies # "link" dependent targets via target_link_libraries (preferred) and # manually add includes / libs for others -if(LZ4_FOUND) +if(lz4_FOUND) if(BUILD_SHARED) -- target_include_directories(blosc2_shared PUBLIC ${LZ4_INCLUDE_DIR}) -+ target_include_directories(blosc2_shared PUBLIC ${lz4_INCLUDE_DIR}) + target_include_directories(blosc2_shared PUBLIC ${LZ4_INCLUDE_DIR}) endif() if(BUILD_STATIC) -- target_include_directories(blosc2_static PUBLIC ${LZ4_INCLUDE_DIR}) -+ target_include_directories(blosc2_static PUBLIC ${lz4_INCLUDE_DIR}) - endif() - if(BUILD_TESTS) -- target_include_directories(blosc_testing PUBLIC ${LZ4_INCLUDE_DIR}) -+ target_include_directories(blosc_testing PUBLIC ${lz4_INCLUDE_DIR}) - endif() - else() - set(LZ4_LOCAL_DIR ${INTERNAL_LIBS}/lz4-1.9.4) -@@ -138,18 +138,18 @@ if(NOT DEACTIVATE_ZLIB) +@@ -138,8 +138,8 @@ if(NOT DEACTIVATE_ZLIB) endif() - + if(NOT DEACTIVATE_ZSTD) - if(ZSTD_FOUND) + if(zstd_FOUND) if(BUILD_SHARED) -- target_include_directories(blosc2_shared PUBLIC ${ZSTD_INCLUDE_DIR}) -- target_link_libraries(blosc2_shared PUBLIC ${ZSTD_LIBRARY}) -+ target_include_directories(blosc2_shared PUBLIC ${zstd_INCLUDE_DIR}) -+ target_link_libraries(blosc2_shared PUBLIC ${zstd_LIBRARY}) - endif() - if(BUILD_STATIC) - target_include_directories(blosc2_static PUBLIC ${ZSTD_INCLUDE_DIR}) -- target_link_libraries(blosc2_static PUBLIC ${ZSTD_LIBRARY}) -+ target_link_libraries(blosc2_static PUBLIC ${zstd_LIBRARY}) + target_include_directories(blosc2_shared PUBLIC ${ZSTD_INCLUDE_DIR}) + target_link_libraries(blosc2_shared PUBLIC ${ZSTD_LIBRARY}) endif() - if(BUILD_TESTS) -- target_include_directories(blosc_testing PUBLIC ${ZSTD_INCLUDE_DIR}) -- target_link_libraries(blosc_testing PUBLIC ${ZSTD_LIBRARY}) -+ target_include_directories(blosc_testing PUBLIC ${zstd_INCLUDE_DIR}) -+ target_link_libraries(blosc_testing PUBLIC ${zstd_LIBRARY}) - endif() - else() - set(ZSTD_LOCAL_DIR ${INTERNAL_LIBS}/zstd-1.5.5) @@ -184,8 +184,8 @@ if(NOT WIN32) set(LIBS ${LIBS} ${CMAKE_DL_LIBS}) endif() - + -if(LZ4_FOUND) -- set(LIBS ${LIBS} ${LZ4_LIBRARY}) +if(lz4_FOUND) -+ set(LIBS ${LIBS} ${lz4_LIBRARIES}) + set(LIBS ${LIBS} ${LZ4_LIBRARY}) else() file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) list(APPEND SOURCES ${LZ4_FILES}) @@ -193,8 +193,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}) + set(LIBS ${LIBS} ${ZLIB_NG_LIBRARY}) elseif(ZLIB_FOUND) set(LIBS ${LIBS} ${ZLIB_LIBRARIES}) else() @@ -206,8 +206,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}) + set(LIBS ${LIBS} ${ZSTD_LIBRARY}) 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 -@@ -262,7 +262,7 @@ list(APPEND SOURCES - blosc/directories.c - blosc/blosc2-stdio.c - blosc/b2nd.c -- blosc/b2nd_utils.c -+ blosc/b2nd_utils.c - ) - if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL arm64) - if(COMPILER_SUPPORT_SSE2) diff --git a/recipes/c-blosc2/all/patches/2.11.1-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.11.1-0001-fix-cmake.patch deleted file mode 100644 index 5a88b5696c4af..0000000000000 --- a/recipes/c-blosc2/all/patches/2.11.1-0001-fix-cmake.patch +++ /dev/null @@ -1,124 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bff2f36..581f189 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -171,26 +171,26 @@ else() - 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) -@@ -211,8 +211,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 bf8527d..d467346 100644 ---- a/blosc/CMakeLists.txt -+++ b/blosc/CMakeLists.txt -@@ -79,15 +79,15 @@ set(INTERNAL_LIBS ${PROJECT_SOURCE_DIR}/internal-complibs) - # link dependencies - # "link" dependent targets via target_link_libraries (preferred) and - # manually add includes / libs for others --if(LZ4_FOUND) -+if(lz4_FOUND) - if(BUILD_SHARED) -- target_include_directories(blosc2_shared PUBLIC ${LZ4_INCLUDE_DIR}) -+ target_include_directories(blosc2_shared PUBLIC ${lz4_INCLUDE_DIR}) - endif() - if(BUILD_STATIC) -- target_include_directories(blosc2_static PUBLIC ${LZ4_INCLUDE_DIR}) -+ target_include_directories(blosc2_static PUBLIC ${lz4_INCLUDE_DIR}) - endif() - if(BUILD_TESTS) -- target_include_directories(blosc_testing PUBLIC ${LZ4_INCLUDE_DIR}) -+ target_include_directories(blosc_testing PUBLIC ${lz4_INCLUDE_DIR}) - endif() - else() - set(LZ4_LOCAL_DIR ${INTERNAL_LIBS}/lz4-1.9.4) -@@ -138,14 +138,14 @@ if(NOT DEACTIVATE_ZLIB) - endif() - - if(NOT DEACTIVATE_ZSTD) -- if(ZSTD_FOUND) -+ if(zstd_FOUND) - if(BUILD_SHARED) -- target_include_directories(blosc2_shared PUBLIC ${ZSTD_INCLUDE_DIR}) -- target_link_libraries(blosc2_shared PUBLIC ${ZSTD_LIBRARY}) -+ target_include_directories(blosc2_shared PUBLIC ${zstd_INCLUDE_DIR}) -+ target_link_libraries(blosc2_shared PUBLIC ${zstd_LIBRARIES}) - endif() - if(BUILD_STATIC) -- target_include_directories(blosc2_static PUBLIC ${ZSTD_INCLUDE_DIR}) -- target_link_libraries(blosc2_static PUBLIC ${ZSTD_LIBRARY}) -+ target_include_directories(blosc2_static PUBLIC ${zstd_INCLUDE_DIR}) -+ target_link_libraries(blosc2_static PUBLIC ${zstd_LIBRARIES}) - endif() - if(BUILD_TESTS) - target_include_directories(blosc_testing PUBLIC ${ZSTD_INCLUDE_DIR}) -@@ -184,8 +184,8 @@ if(NOT WIN32) - 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) - list(APPEND SOURCES ${LZ4_FILES}) -@@ -193,8 +193,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() -@@ -206,8 +206,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/all/patches/2.6.0-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.6.0-0001-fix-cmake.patch deleted file mode 100644 index 5c30c1a180c48..0000000000000 --- a/recipes/c-blosc2/all/patches/2.6.0-0001-fix-cmake.patch +++ /dev/null @@ -1,122 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 43910d1..199ef1d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -144,26 +144,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) -- set(HAVE_ZLIB_NG TRUE) -+ 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) -@@ -184,9 +184,9 @@ endif() - - if(NOT DEACTIVATE_ZSTD) - if(PREFER_EXTERNAL_ZSTD) -- find_package(ZSTD) -- if(NOT ZSTD_FOUND) -- message(STATUS "No ZSTD library found. Using internal sources.") -+ find_package(zstd) -+ if(NOT zstd_FOUND) -+ message(STATUS "No ZSTD library found. Using internal sources.") - endif() - else() - message(STATUS "Using ZSTD internal sources.") -diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt -index 441bab6..f17e467 100644 ---- a/blosc/CMakeLists.txt -+++ b/blosc/CMakeLists.txt -@@ -10,16 +10,16 @@ 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}) - endif() - - if(NOT DEACTIVATE_ZLIB) -- if(ZLIB_NG_FOUND) -- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_NG_INCLUDE_DIR}) -+ if(zlib-ng_FOUND) -+ set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${zlib-ng_INCLUDE_DIR}) - elseif(ZLIB_FOUND) - set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) - else() -@@ -29,8 +29,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.2) - set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_LOCAL_DIR} -@@ -90,8 +90,8 @@ else() - endif() - 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}) -@@ -99,10 +99,10 @@ 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_LIBRARY}) -+ set(LIBS ${LIBS} ${ZLIB_LIBRARIES}) - else() - set(ZLIB_LOCAL_DIR ${INTERNAL_LIBS}/${ZLIB_NG_DIR}) - file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c) -@@ -112,8 +112,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/all/patches/2.8.0-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.8.0-0001-fix-cmake.patch deleted file mode 100644 index a0812cb90ffab..0000000000000 --- a/recipes/c-blosc2/all/patches/2.8.0-0001-fix-cmake.patch +++ /dev/null @@ -1,119 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bb7882f..92ac61c 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 365de33..74ed32e 100644 ---- a/blosc/CMakeLists.txt -+++ b/blosc/CMakeLists.txt -@@ -18,16 +18,16 @@ 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}) - endif() - - if(NOT DEACTIVATE_ZLIB) -- if(ZLIB_NG_FOUND) -- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_NG_INCLUDE_DIR}) -+ if(zlib-ng_FOUND) -+ set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${zlib-ng_INCLUDE_DIR}) - elseif(ZLIB_FOUND) - set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) - else() -@@ -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.4) - set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_LOCAL_DIR} -@@ -99,8 +99,8 @@ else() - endif() - 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}) -@@ -108,10 +108,10 @@ 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_LIBRARY}) - elseif(ZLIB_FOUND) -- set(LIBS ${LIBS} ${ZLIB_LIBRARY}) -+ set(LIBS ${LIBS} ${ZLIB_LIBRARIES}) - else() - set(ZLIB_LOCAL_DIR ${INTERNAL_LIBS}/${ZLIB_NG_DIR}) - file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c) -@@ -121,8 +121,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 44d877a4a4290..7d50a7f518889 100644 --- a/recipes/c-blosc2/config.yml +++ b/recipes/c-blosc2/config.yml @@ -1,4 +1,8 @@ versions: + "2.15.0": + folder: all + "2.14.4": + folder: all "2.13.1": folder: all "2.13.0": @@ -9,7 +13,3 @@ versions: folder: all "2.10.5": folder: all - "2.8.0": - folder: all - "2.6.1": - folder: all diff --git a/recipes/c4core/all/conandata.yml b/recipes/c4core/all/conandata.yml index ab9592ebfbdbe..742894bf86081 100644 --- a/recipes/c4core/all/conandata.yml +++ b/recipes/c4core/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.2.1": + url: "https://github.com/biojppm/c4core/releases/download/v0.2.1/c4core-0.2.1-src.tgz" + sha256: "6447896444c59002af58c8543d0bc64184b9a5c5992c8fc09d6d71935d039f89" + "0.2.0": + url: "https://github.com/biojppm/c4core/releases/download/v0.2.0/c4core-0.2.0-src.tgz" + sha256: "7843e6fb41c200fff69fc71105dbbf56bb410bdbab6b330e02cbe18430fe23bd" "0.1.11": url: "https://github.com/biojppm/c4core/releases/download/v0.1.11/c4core-0.1.11-src.tgz" sha256: "67f4443f3742424f42453594e26e656f616dddfcf225a1d810e00473a741408c" @@ -12,6 +18,14 @@ sources: url: "https://github.com/biojppm/c4core/releases/download/v0.1.8/c4core-0.1.8-src.tgz" sha256: "95c0663192c6bff7a098b50afcb05d22a34dd0fd8e6be2e1b61edad2b9675fde" patches: + "0.2.1": + - patch_file: "patches/0.2.0-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" + "0.2.0": + - patch_file: "patches/0.2.0-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" "0.1.11": - patch_file: "patches/0.1.11-0001-make-fast_float-external.patch" patch_description: "use cci's fast_float recipe" diff --git a/recipes/c4core/all/conanfile.py b/recipes/c4core/all/conanfile.py index d4620ffd7f7a8..91680b53adcd5 100644 --- a/recipes/c4core/all/conanfile.py +++ b/recipes/c4core/all/conanfile.py @@ -82,7 +82,7 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - rm(self, "*.natvis", os.path.join(self.package_folder, "include")) + rm(self, "*.natvis", os.path.join(self.package_folder, "include"), recursive=True) def package_info(self): self.cpp_info.libs = ["c4core"] diff --git a/recipes/c4core/all/patches/0.2.0-0001-make-fast_float-external.patch b/recipes/c4core/all/patches/0.2.0-0001-make-fast_float-external.patch new file mode 100644 index 0000000000000..2fbe458a72084 --- /dev/null +++ b/recipes/c4core/all/patches/0.2.0-0001-make-fast_float-external.patch @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f1d62be..cda061c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -76,7 +76,7 @@ set(C4CORE_SRC_FILES + if(C4CORE_WITH_FASTFLOAT) + list(APPEND C4CORE_SRC_FILES + c4/ext/fast_float.hpp +- c4/ext/fast_float_all.h ++# c4/ext/fast_float_all.h + ) + endif() + set(C4CORE_AMALGAMATED ${C4CORE_SRC_DIR}/../src_singleheader/c4/c4core_all.hpp) +@@ -95,7 +95,10 @@ c4_add_library(c4core + SOURCE_ROOT ${C4CORE_SRC_DIR} + SOURCES ${C4CORE_SRC_FILES} + ) +-if(NOT C4CORE_WITH_FASTFLOAT) ++if(C4CORE_WITH_FASTFLOAT) ++ find_package(FastFloat REQUIRED CONFIG) ++ target_link_libraries(c4core PUBLIC "FastFloat::fast_float") ++else() + target_compile_definitions(c4core PUBLIC -DC4CORE_NO_FAST_FLOAT) + endif() + if(C4CORE_NO_DEBUG_BREAK) +diff --git a/src/c4/ext/fast_float.hpp b/src/c4/ext/fast_float.hpp +index 77fac4f..db14534 100644 +--- a/src/c4/ext/fast_float.hpp ++++ b/src/c4/ext/fast_float.hpp +@@ -18,7 +18,7 @@ + # pragma GCC diagnostic ignored "-Wold-style-cast" + #endif + +-#include "c4/ext/fast_float_all.h" ++#include "fast_float/fast_float.h" + + #ifdef _MSC_VER + # pragma warning(pop) diff --git a/recipes/c4core/config.yml b/recipes/c4core/config.yml index b3f909b6c9664..afc5fb74fc180 100644 --- a/recipes/c4core/config.yml +++ b/recipes/c4core/config.yml @@ -1,4 +1,8 @@ versions: + "0.2.1": + folder: all + "0.2.0": + folder: all "0.1.11": folder: all "0.1.10": diff --git a/recipes/caf/all/conandata.yml b/recipes/caf/all/conandata.yml index 4b177005e2f51..ae0696f7a640b 100644 --- a/recipes/caf/all/conandata.yml +++ b/recipes/caf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.0": + url: "https://github.com/actor-framework/actor-framework/archive/1.0.0.tar.gz" + sha256: "602018239d23a1805d35ebda704fd5c969a0693fc513fcf7459063b628459e5b" "0.19.4": url: "https://github.com/actor-framework/actor-framework/archive/0.19.4.tar.gz" sha256: "114d43e3a7a2305ca1d2106cd0daeff471564f62b90db1e453ba9eb5c47c02f6" diff --git a/recipes/caf/all/conanfile.py b/recipes/caf/all/conanfile.py index 08713d4f8b3b0..a477d38bc4ce6 100644 --- a/recipes/caf/all/conanfile.py +++ b/recipes/caf/all/conanfile.py @@ -12,11 +12,10 @@ class CAFConan(ConanFile): name = "caf" description = "An open source implementation of the Actor Model in C++" + license = "BSD-3-Clause", "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/actor-framework/actor-framework" - topics = "actor-framework", "actor-model", "pattern-matching", "actors" - license = "BSD-3-Clause", "BSL-1.0" - + topics = ("actor-framework", "actor-model", "pattern-matching", "actors") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -41,7 +40,7 @@ def _minimum_compilers_version(self): return { "Visual Studio": "16", "msvc": "192", - "gcc": "7", + "gcc": "7" if Version(self.version) < "1.0.0" else "8", "clang": "6", # Should be 5 but clang 5 has a bug that breaks compiling CAF # see https://github.com/actor-framework/actor-framework/issues/1226 "apple-clang": "10", @@ -90,6 +89,8 @@ def generate(self): tc = CMakeToolchain(self) if not valid_min_cppstd(self, self._min_cppstd): tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + else: + tc.variables["CAF_CXX_VERSION"] = str(self.settings.compiler.cppstd).replace("gnu", "") tc.variables["CAF_ENABLE_OPENSSL_MODULE"] = self.options.with_openssl tc.variables["CAF_ENABLE_EXAMPLES"] = False tc.variables["CAF_ENABLE_TOOLS"] = False diff --git a/recipes/caf/config.yml b/recipes/caf/config.yml index 548a9345742d5..a133d776e2a27 100644 --- a/recipes/caf/config.yml +++ b/recipes/caf/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.0": + folder: all "0.19.4": folder: all "0.19.3": diff --git a/recipes/cairo/all/conandata.yml b/recipes/cairo/all/conandata.yml deleted file mode 100644 index a2d821e85845f..0000000000000 --- a/recipes/cairo/all/conandata.yml +++ /dev/null @@ -1,26 +0,0 @@ -sources: - "1.17.2": - sha256: "6b70d4655e2a47a22b101c666f4b29ba746eda4aa8a0f7255b32b2e9408801df" - url: - - "https://www.cairographics.org/snapshots/cairo-1.17.2.tar.xz" - - "https://www.mirrorservice.org/sites/tinycorelinux.net/11.x/x86_64/tcz/src/cairo/cairo-1.17.2.tar.xz" - "1.16.0": - sha256: "5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331" - url: - - "https://www.cairographics.org/releases/cairo-1.16.0.tar.xz" - - "https://mirror.koddos.net/blfs/conglomeration/cairo/cairo-1.16.0.tar.xz" -patches: - "1.17.2": - - patch_file: "patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch" - - patch_file: "patches/binutils-2.34-libbfd-fix.patch" - patch_description: "fix build with newer versions of bfd" - patch_type: backport - patch_source: https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/128 - base_path: "util/cairo-trace" - "1.16.0": - - patch_file: "patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch" - - patch_file: "patches/binutils-2.34-libbfd-fix.patch" - patch_description: "fix build with newer versions of bfd" - patch_type: backport - patch_source: https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/128 - base_path: "util/cairo-trace" diff --git a/recipes/cairo/all/conanfile.py b/recipes/cairo/all/conanfile.py deleted file mode 100644 index 1e8675e64a203..0000000000000 --- a/recipes/cairo/all/conanfile.py +++ /dev/null @@ -1,341 +0,0 @@ -import os - -from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import fix_apple_shared_install_name, is_apple_os -from conan.tools.build import cross_building -from conan.tools.env import VirtualBuildEnv, VirtualRunEnv -from conan.tools.files import ( - apply_conandata_patches, - copy, - export_conandata_patches, - get, - replace_in_file, - rename, - rm, - rmdir -) -from conan.tools.gnu import PkgConfigDeps, Autotools, AutotoolsDeps, AutotoolsToolchain -from conan.tools.layout import basic_layout -from conan.tools.microsoft import is_msvc, unix_path -from conan.tools.scm import Version - -required_conan_version = ">=1.54.0" - - -class CairoConan(ConanFile): - name = "cairo" - description = "Cairo is a 2D graphics library with support for multiple output devices" - topics = ("graphics") - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://cairographics.org/" - license = ("LGPL-2.1-only", "MPL-1.1") - package_type = "library" - settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - "with_freetype": [True, False], - "with_fontconfig": [True, False], - "with_xlib": [True, False], - "with_xlib_xrender": [True, False], - "with_xcb": [True, False], - "with_glib": [True, False], - } - default_options = { - "shared": False, - "fPIC": True, - "with_freetype": True, - "with_fontconfig": True, - "with_xlib": True, - "with_xlib_xrender": False, - "with_xcb": True, - "with_glib": True, - } - short_paths = True - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - def export_sources(self): - export_conandata_patches(self) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - del self.options.with_fontconfig - if is_msvc(self): - del self.options.with_freetype - del self.options.with_glib - if self.settings.os != "Linux": - del self.options.with_xlib - del self.options.with_xlib_xrender - del self.options.with_xcb - - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - self.settings.rm_safe("compiler.cppstd") - self.settings.rm_safe("compiler.libcxx") - - def layout(self): - basic_layout(self, src_folder="src") - - def requirements(self): - if self.options.get_safe("with_freetype", True): - self.requires("freetype/2.13.0") - if self.options.get_safe("with_fontconfig", False): - self.requires("fontconfig/2.14.2") - if self.settings.os == "Linux": - if self.options.with_xlib or self.options.with_xlib_xrender or self.options.with_xcb: - self.requires("xorg/system") - if self.options.get_safe("with_glib", True): - self.requires("glib/2.76.3") - self.requires("zlib/1.2.13") - self.requires("pixman/0.40.0") - self.requires("libpng/1.6.40") - - def package_id(self): - if self.options.get_safe("with_glib") and not self.dependencies["glib"].options.shared: - self.info.requires["glib"].full_package_mode() - - def validate(self): - if is_msvc(self): - # TODO autotools build results in LNK1127 error from a library in the WindowsSDK on CCI - # should be retested in case this is just a CCI environment issue - raise ConanInvalidConfiguration("MSVC autotools build is not supported. Use the Meson build instead.") - - def build_requirements(self): - self.tool_requires("libtool/2.4.7") - if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/1.9.3") - if self._settings_build.os == "Windows": - self.win_bash = True - if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=str): - self.tool_requires("msys2/cci.latest") - if is_msvc(self): - self.tool_requires("automake/1.16.5") - else: - self.tool_requires("gtk-doc-stub/cci.20181216") - - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) - - def _create_toolchain(self, namespace, directory): - def is_enabled(value): - return "yes" if value else "no" - - def dep_path(dependency): - return unix_path(self, self.deps_cpp_info[dependency].rootpath) - - tc = AutotoolsToolchain(self, namespace=namespace) - tc.configure_args += [ - f"--datarootdir={unix_path(self, os.path.join(self.package_folder, 'res'))}", - f"--enable-ft={is_enabled(self.options.get_safe('with_freetype', True))}", - f"--enable-gobject={is_enabled(self.options.get_safe('with_glib', True))}", - f"--enable-fc={is_enabled(self.options.get_safe('with_fontconfig'))}", - f"--enable-xlib={is_enabled(self.options.get_safe('with_xlib'))}", - f"--enable-xlib_xrender={is_enabled(self.options.get_safe('with_xlib_xrender'))}", - f"--enable-xcb={is_enabled(self.options.get_safe('xcb'))}", - "--disable-gtk-doc" - ] - if is_msvc(self): - tc.make_args += [ - "--directory", directory, - "-f", "Makefile.win32", - f"CFG={str(self.settings.build_type).lower()}", - "CAIRO_HAS_FC_FONT=0", - f"ZLIB_PATH={dep_path('zlib')}", - f"LIBPNG_PATH={dep_path('libpng')}", - f"PIXMAN_PATH={dep_path('pixman')}", - f"FREETYPE_PATH={dep_path('freetype')}", - f"GOBJECT_PATH={dep_path('glib')}" - ] - tc.extra_cflags += ["-FS"] - - if self.settings.compiler in ["gcc", "clang", "apple-clang"]: - tc.extra_cflags.append("-Wno-enum-conversion") - - return tc - - def generate(self): - VirtualBuildEnv(self).generate() - - if not cross_building(self): - VirtualRunEnv(self).generate(scope="build") - - tc_main = self._create_toolchain("main", unix_path(self, self.source_folder)) - tc_main.generate() - - if is_msvc(self): - tc_gobject = self._create_toolchain("gobject", unix_path(self, os.path.join(self.source_folder, "util", "cairo-gobject"))) - tc_gobject.generate() - - PkgConfigDeps(self).generate() - deps = AutotoolsDeps(self) - if is_msvc(self): - cppflags = deps.vars().get("CPPFLAGS") - deps.environment.append('CFLAGS', cppflags.replace("/I", "-I")) - ldflags = deps.vars().get("LDFLAGS") - deps.environment.define('LDFLAGS', ldflags.replace("/LIBPATH:", "-LIBPATH:")) - deps.environment.append('LDFLAGS', deps.vars().get("LIBS")) - - deps.generate() - - def _patch_sources(self): - apply_conandata_patches(self) - - def fix_freetype_version(): - replace_in_file( - self, - os.path.join(self.source_folder, "configure.ac"), - "FREETYPE_MIN_VERSION=9.7.3", - f"FREETYPE_MIN_VERSION={Version(self.dependencies['freetype'].ref.version)}" - ) - - def exclude_tests_and_docs_from_build(): - makefile_am = os.path.join(self.source_folder, "Makefile.am") - replace_in_file(self, makefile_am, "SUBDIRS += boilerplate test perf", "") - replace_in_file(self, makefile_am, "SUBDIRS = src doc util", "SUBDIRS = src util") - - fix_freetype_version() - exclude_tests_and_docs_from_build() - - if self.options.get_safe("with_freetype"): - replace_in_file(self, os.path.join(self.source_folder, "src", "cairo-ft-font.c"), - "#if HAVE_UNISTD_H", "#ifdef HAVE_UNISTD_H") - - if is_msvc(self): - # https://cairographics.org/end_to_end_build_for_win32/ - win32_common = os.path.join(self.source_folder, "build", "Makefile.win32.common") - replace_in_file(self, win32_common, "-MD ", f"-{self.settings.compiler.runtime} ") - replace_in_file(self, win32_common, "-MDd ", f"-{self.settings.compiler.runtime} ") - replace_in_file(self, win32_common, "$(PIXMAN_PATH)/lib/pixman-1.lib", - self.deps_cpp_info["pixman"].libs[0] + ".lib") - replace_in_file(self, win32_common, "$(FREETYPE_PATH)/lib/freetype.lib", - self.deps_cpp_info["freetype"].libs[0] + ".lib") - replace_in_file(self, win32_common, "$(ZLIB_PATH)/lib/zlib1.lib", - self.deps_cpp_info["zlib"].libs[0] + ".lib") - replace_in_file(self, win32_common, "$(LIBPNG_PATH)/lib/libpng16.lib", - self.deps_cpp_info["libpng"].libs[0] + ".lib") - - def build(self): - self._patch_sources() - autotools = Autotools(self, namespace="main") - if is_msvc(self): - autotools.make() - autotools_gobject = Autotools(self, namespace="gobject") - autotools_gobject.make() - else: - autotools.autoreconf() - autotools.configure() - autotools.make() - - def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - if is_msvc(self): - src = os.path.join(self.source_folder, "src") - inc = os.path.join(self.package_folder, "include", "cairo") - copy(self, "cairo-version.h", (src if Version(self.version) >= "1.17.4" else self.source_folder), inc) - copy(self, "cairo-features.h", src, inc) - copy(self, "cairo.h", src, inc) - copy(self, "cairo-deprecated.h", src, inc) - copy(self, "cairo-win32.h", src, inc) - copy(self, "cairo-script.h", src, inc) - copy(self, "cairo-ft.h", src, inc) - copy(self, "cairo-ps.h", src, inc) - copy(self, "cairo-pdf.h", src, inc) - copy(self, "cairo-svg.h", src, inc) - copy(self, "cairo-gobject.h", inc, os.path.join(self.source_folder, "util", "cairo-gobject")) - - config = str(self.settings.build_type).lower() - lib_src_path = os.path.join(self.source_folder, "src", config) - cairo_gobject_src_path = os.path.join(self.source_folder, "util", "cairo-gobject", config) - lib_dest_path = os.path.join(self.package_folder, "lib") - runtime_dest_path = os.path.join(self.package_folder, "bin") - - if self.options.shared: - copy(self, "*cairo.lib", lib_src_path, lib_dest_path) - copy(self, "*cairo.dll", lib_src_path, runtime_dest_path) - copy(self, "*cairo-gobject.lib", cairo_gobject_src_path, lib_dest_path) - copy(self, "*cairo-gobject.dll", cairo_gobject_src_path, runtime_dest_path) - else: - copy(self, "cairo-static.lib", lib_src_path, lib_dest_path) - copy(self, "cairo-gobject.lib", cairo_gobject_src_path, lib_dest_path) - rename(self, os.path.join(lib_dest_path, "cairo-static.lib"), os.path.join(lib_dest_path, "cairo.lib")) - else: - autotools = Autotools(self, namespace="main") - autotools.install() - - copy(self, "COPYING*", self.source_folder, os.path.join(self.package_folder, "licenses")) - rm(self, "*.la", self.package_folder, recursive=True) - rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - fix_apple_shared_install_name(self) - - def package_info(self): - self.cpp_info.set_property("pkg_config_name", "cairo-all-do-no-use") - - self.cpp_info.components["cairo_"].set_property("pkg_config_name", "cairo") - self.cpp_info.components["cairo_"].libs = ["cairo"] - self.cpp_info.components["cairo_"].includedirs.insert(0, os.path.join("include", "cairo")) - self.cpp_info.components["cairo_"].requires = ["pixman::pixman", "libpng::libpng", "zlib::zlib"] - - if self.options.get_safe("with_freetype", True): - self.cpp_info.components["cairo_"].requires.append("freetype::freetype") - - if self.settings.os == "Windows": - self.cpp_info.components["cairo_"].system_libs.extend(["gdi32", "msimg32", "user32"]) - if not self.options.shared: - self.cpp_info.components["cairo_"].defines.append("CAIRO_WIN32_STATIC_BUILD=1") - else: - if self.options.with_glib: - self.cpp_info.components["cairo_"].requires.extend(["glib::gobject-2.0", "glib::glib-2.0"]) - if self.options.with_fontconfig: - self.cpp_info.components["cairo_"].requires.append("fontconfig::fontconfig") - - if self.settings.os == "Linux": - self.cpp_info.components["cairo_"].system_libs = ["pthread", "rt"] - self.cpp_info.components["cairo_"].cflags = ["-pthread"] - self.cpp_info.components["cairo_"].cxxflags = ["-pthread"] - if self.options.with_xcb: - self.cpp_info.components["cairo_"].requires.extend(["xorg::xcb-shm", "xorg::xcb"]) - if self.options.with_xlib_xrender: - self.cpp_info.components["cairo_"].requires.extend(["xorg::xcb-render"]) - if self.options.with_xlib: - self.cpp_info.components["cairo_"].requires.extend(["xorg::x11", "xorg::xext"]) - - if is_apple_os(self): - self.cpp_info.components["cairo_"].frameworks.append("CoreGraphics") - - if self.settings.os == "Windows": - self.cpp_info.components["cairo-win32"].set_property("pkg_config_name", "cairo-win32") - self.cpp_info.components["cairo-win32"].requires = ["cairo_", "pixman::pixman", "libpng::libpng"] - - if self.options.get_safe("with_glib", True): - self.cpp_info.components["cairo-gobject"].set_property("pkg_config_name", "cairo-gobject") - self.cpp_info.components["cairo-gobject"].libs = ["cairo-gobject"] - self.cpp_info.components["cairo-gobject"].requires = ["cairo_", "glib::gobject-2.0", "glib::glib-2.0"] - if self.settings.os != "Windows": - if self.options.with_fontconfig: - self.cpp_info.components["cairo-fc"].set_property("pkg_config_name", "cairo-fc") - self.cpp_info.components["cairo-fc"].requires = ["cairo_", "fontconfig::fontconfig"] - if self.options.get_safe("with_freetype", True): - self.cpp_info.components["cairo-ft"].set_property("pkg_config_name", "cairo-ft") - self.cpp_info.components["cairo-ft"].requires = ["cairo_", "freetype::freetype"] - - self.cpp_info.components["cairo-pdf"].set_property("pkg_config_name", "cairo-pdf") - self.cpp_info.components["cairo-pdf"].requires = ["cairo_", "zlib::zlib"] - - if self.settings.os == "Linux": - if self.options.with_xlib: - self.cpp_info.components["cairo-xlib"].set_property("pkg_config_name", "cairo-xlib") - self.cpp_info.components["cairo-xlib"].requires = ["cairo_", "xorg::x11", "xorg::xext"] - - if is_apple_os(self): - self.cpp_info.components["cairo-quartz"].set_property("pkg_config_name", "cairo-quartz") - self.cpp_info.components["cairo-quartz"].requires = ["cairo_"] - self.cpp_info.components["cairo-quartz"].frameworks.extend(["CoreFoundation", "CoreGraphics", "ApplicationServices"]) - - self.cpp_info.components["cairo-quartz-font"].set_property("pkg_config_name", "cairo-quartz-font") - self.cpp_info.components["cairo-quartz-font"].requires = ["cairo_"] diff --git a/recipes/cairo/all/patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch b/recipes/cairo/all/patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch deleted file mode 100644 index 1554d7bb38ba6..0000000000000 --- a/recipes/cairo/all/patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch +++ /dev/null @@ -1,155 +0,0 @@ -From 2801a57b7dae8060f4b4c2dede65cf4ce79da62b Mon Sep 17 00:00:00 2001 -From: Ignacio Casal Quinteiro -Date: Tue, 28 Feb 2017 11:10:37 +0100 -Subject: [PATCH] msvc: update build scripts to compile with more features - -This also adds support to build cairo-gobject ---- - build/Makefile.win32.common | 52 +++++++++++++++++++++++++++++++-------- - build/Makefile.win32.features | 13 +++++----- - util/cairo-gobject/Makefile.win32 | 24 ++++++++++++++++++ - 3 files changed, 73 insertions(+), 16 deletions(-) - create mode 100644 util/cairo-gobject/Makefile.win32 - -diff --git a/build/Makefile.win32.common b/build/Makefile.win32.common -index 7d7e973..38063a7 100644 ---- a/build/Makefile.win32.common -+++ b/build/Makefile.win32.common -@@ -23,34 +23,66 @@ CFG_CFLAGS := -MD -O2 - CFG_LDFLAGS := - endif - -+ifeq ($(ARCH),) -+ARCH=Win32 -+endif -+ -+ifeq ($(INSTALL_DIR),) -+INSTALL_DIR=$(top_srcdir)/../../../../gtk/$(ARCH)/$(CFG) -+endif -+ - ifeq ($(PIXMAN_PATH),) --PIXMAN_PATH := $(top_builddir)/../pixman -+PIXMAN_PATH := $(INSTALL_DIR) - endif --PIXMAN_CFLAGS := -I$(PIXMAN_PATH)/pixman/ --PIXMAN_LIBS := $(PIXMAN_PATH)/pixman/$(CFG)/pixman-1.lib -+PIXMAN_CFLAGS := -I$(PIXMAN_PATH)/include/pixman-1 -+PIXMAN_LIBS := $(PIXMAN_PATH)/lib/pixman-1.lib - - CAIRO_LIBS = gdi32.lib msimg32.lib user32.lib - - ifeq ($(CAIRO_HAS_PNG_FUNCTIONS),1) - ifeq ($(LIBPNG_PATH),) --LIBPNG_PATH := $(top_builddir)/../libpng -+LIBPNG_PATH := $(INSTALL_DIR) - endif --LIBPNG_CFLAGS += -I$(LIBPNG_PATH)/ --CAIRO_LIBS += $(LIBPNG_PATH)/libpng.lib -+LIBPNG_CFLAGS += -I$(LIBPNG_PATH)/include -+CAIRO_LIBS += $(LIBPNG_PATH)/lib/libpng16.lib - endif - - ifeq ($(CAIRO_HAS_PS_SURFACE)$(CAIRO_HAS_PDF_SURFACE),00) - else - ifeq ($(ZLIB_PATH),) --ZLIB_PATH := $(top_builddir)/../zlib -+ZLIB_PATH := $(INSTALL_DIR) -+endif -+ZLIB_CFLAGS += -I$(ZLIB_PATH)/include -+CAIRO_LIBS += $(ZLIB_PATH)/lib/zlib1.lib -+endif -+ -+ifeq ($(CAIRO_HAS_FT_FONT),1) -+ifeq ($(FREETYPE_PATH),) -+FREETYPE_PATH := $(INSTALL_DIR) -+endif -+FREETYPE_CFLAGS += -I$(FREETYPE_PATH)/include -+CAIRO_LIBS += $(FREETYPE_PATH)/lib/freetype.lib -+endif -+ -+ifeq ($(CAIRO_HAS_FC_FONT),1) -+ifeq ($(FONTCONFIG_PATH),) -+FONTCONFIG_PATH := $(INSTALL_DIR) -+endif -+FONTCONFIG_CFLAGS += -I$(FONTCONFIG_PATH)/include -+CAIRO_LIBS += $(FONTCONFIG_PATH)/lib/fontconfig.lib -+endif -+ -+ifeq ($(CAIRO_HAS_GOBJECT_FUNCTIONS),1) -+ifeq ($(GOBJECT_PATH),) -+GOBJECT_PATH := $(INSTALL_DIR) - endif --ZLIB_CFLAGS += -I$(ZLIB_PATH)/ --CAIRO_LIBS += $(ZLIB_PATH)/zdll.lib -+GOBJECT_CFLAGS := -I$(GOBJECT_PATH)/include/glib-2.0 -I$(GOBJECT_PATH)/lib/glib-2.0/include -+GOBJECT_LIBS := $(GOBJECT_PATH)/lib/glib-2.0.lib $(GOBJECT_PATH)/lib/gobject-2.0.lib - endif - - DEFAULT_CFLAGS = -nologo $(CFG_CFLAGS) - DEFAULT_CFLAGS += -I. -I$(top_srcdir) -I$(top_srcdir)/src --DEFAULT_CFLAGS += $(PIXMAN_CFLAGS) $(LIBPNG_CFLAGS) $(ZLIB_CFLAGS) -+DEFAULT_CFLAGS += $(PIXMAN_CFLAGS) $(LIBPNG_CFLAGS) $(ZLIB_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) - - CAIRO_CFLAGS = $(DEFAULT_CFLAGS) $(CFLAGS) - -diff --git a/build/Makefile.win32.features b/build/Makefile.win32.features -index 8cb155d..db3f0ac 100644 ---- a/build/Makefile.win32.features -+++ b/build/Makefile.win32.features -@@ -26,16 +26,17 @@ CAIRO_HAS_EGL_FUNCTIONS=0 - CAIRO_HAS_GLX_FUNCTIONS=0 - CAIRO_HAS_WGL_FUNCTIONS=0 - CAIRO_HAS_SCRIPT_SURFACE=1 --CAIRO_HAS_FT_FONT=0 --CAIRO_HAS_FC_FONT=0 -+CAIRO_HAS_FT_FONT=1 -+CAIRO_HAS_FC_FONT=1 - CAIRO_HAS_PS_SURFACE=1 - CAIRO_HAS_PDF_SURFACE=1 - CAIRO_HAS_SVG_SURFACE=1 - CAIRO_HAS_TEST_SURFACES=0 --CAIRO_HAS_TEE_SURFACE=0 --CAIRO_HAS_XML_SURFACE=0 -+CAIRO_HAS_TEE_SURFACE=1 -+CAIRO_HAS_XML_SURFACE=1 - CAIRO_HAS_PTHREAD=0 --CAIRO_HAS_GOBJECT_FUNCTIONS=0 --CAIRO_HAS_TRACE=0 -+CAIRO_HAS_GOBJECT_FUNCTIONS=1 -+CAIRO_HAS_TRACE=1 - CAIRO_HAS_INTERPRETER=1 - CAIRO_HAS_SYMBOL_LOOKUP=0 -+CAIRO_HAS_IMAGE_SURFACE=1 -diff --git a/util/cairo-gobject/Makefile.win32 b/util/cairo-gobject/Makefile.win32 -new file mode 100644 -index 0000000..1f63511 ---- /dev/null -+++ b/util/cairo-gobject/Makefile.win32 -@@ -0,0 +1,24 @@ -+top_srcdir = ../.. -+include $(top_srcdir)/build/Makefile.win32.common -+ -+CAIRO_LIB = $(top_srcdir)/src/$(CFG)/cairo.lib -+SOURCES = \ -+ cairo-gobject-enums.c \ -+ cairo-gobject-structs.c -+ -+OBJECTS = $(patsubst %.c, $(CFG)/%.obj, $(SOURCES)) -+ -+dynamic: inform $(CFG)/cairo-gobject.dll -+ -+$(CFG)/%.obj: %.c $(top_srcdir)/src/cairo-features.h -+ @mkdir -p $(CFG)/`dirname $<` -+ @$(CC) $(CAIRO_CFLAGS) $(GOBJECT_CFLAGS) -c -Fo"$@" $< -+ -+$(CFG)/cairo-gobject.dll: $(OBJECTS) -+ @$(LD) $(CAIRO_LDFLAGS) $(GOBJECT_LDFLAGS) -DLL -OUT:$@ $(CAIRO_LIB) $(GOBJECT_LIBS) $(OBJECTS) -+ -+all: inform $(CFG)/cairo-gobject.dll -+ @echo "Built successfully!" -+ @echo "You should copy the following files to a proper place now:" -+ @echo "" -+ @echo " util/cairo-gobject/$(CFG)/cairo-gobject.dll" --- -2.9.3 - diff --git a/recipes/cairo/all/patches/binutils-2.34-libbfd-fix.patch b/recipes/cairo/all/patches/binutils-2.34-libbfd-fix.patch deleted file mode 100644 index 197f3fbc3cad0..0000000000000 --- a/recipes/cairo/all/patches/binutils-2.34-libbfd-fix.patch +++ /dev/null @@ -1,43 +0,0 @@ -The libbfd issues were fixed in upstream with following commit: - - From e30259f6237571c61992433c110bc6e1ef900244 Mon Sep 17 00:00:00 2001 - From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= - Date: Tue, 23 Feb 2021 11:36:24 +0000 - Subject: cairo-trace: fix build with newer versions of bfd - - https://cgit.freedesktop.org/cairo/commit/?id=e30259f6237571c61992433c110bc6e1ef900244 - -Note that the upstream commit was more comprehensive, but cannot be directly -applied to 1.17.4 version. Any new cairo version beyond 1.17.4 will likely -not need this fix. - ---- lookup-symbol.c.original 2021-08-05 22:21:15.819998378 +0300 -+++ lookup-symbol.c 2021-08-05 22:26:05.212448342 +0300 -@@ -145,14 +145,26 @@ - if (symbol->found) - return; - -+#ifdef bfd_get_section_flags - if ((bfd_get_section_flags (symtab->bfd, section) & SEC_ALLOC) == 0) -+#else -+ if ((bfd_section_flags (section) & SEC_ALLOC) == 0) -+#endif - return; - -+#ifdef bfd_get_section_vma - vma = bfd_get_section_vma (symtab->bfd, section); -+#else -+ vma = bfd_section_vma (section); -+#endif - if (symbol->pc < vma) - return; - -- size = bfd_section_size (symtab->bfd, section); -+#ifdef bfd_get_section_size -+ size = bfd_get_section_size (section); -+#else -+ size = bfd_section_size (section); -+#endif - if (symbol->pc >= vma + size) - return; - diff --git a/recipes/cairo/all/test_package/CMakeLists.txt b/recipes/cairo/all/test_package/CMakeLists.txt deleted file mode 100644 index 4f33d55898eb2..0000000000000 --- a/recipes/cairo/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(test_package C) - -find_package(cairo CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE cairo::cairo) diff --git a/recipes/cairo/all/test_package/conanfile.py b/recipes/cairo/all/test_package/conanfile.py deleted file mode 100644 index e904c93b97465..0000000000000 --- a/recipes/cairo/all/test_package/conanfile.py +++ /dev/null @@ -1,26 +0,0 @@ -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 = "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/cairo/all/test_package/test_package.c b/recipes/cairo/all/test_package/test_package.c deleted file mode 100644 index 5854291cea177..0000000000000 --- a/recipes/cairo/all/test_package/test_package.c +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include - -#if defined(WIN32) && CAIRO_HAS_WIN32_SURFACE && CAIRO_HAS_WIN32_FONT - -#include -#include - -#endif - -int main() -{ -#if defined(WIN32) && CAIRO_HAS_WIN32_SURFACE && CAIRO_HAS_WIN32_FONT - - HDC hDC = GetDC(0); - if (hDC) - { - cairo_surface_t * surface = cairo_win32_surface_create(hDC); - if (surface) - { - HFONT hFont = (HFONT)GetStockObject(SYSTEM_FONT); - cairo_font_face_t* font = cairo_win32_font_face_create_for_hfont(hFont); - if (font) - cairo_font_face_destroy(font); - - cairo_surface_destroy(surface); - } - ReleaseDC(0, hDC); - } -#endif - - printf("cairo version is %s\n", cairo_version_string()); - - return 0; -} diff --git a/recipes/cairo/all/test_v1_package/CMakeLists.txt b/recipes/cairo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 692a4909c85a7..0000000000000 --- a/recipes/cairo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cairo/all/test_v1_package/conanfile.py b/recipes/cairo/all/test_v1_package/conanfile.py deleted file mode 100644 index 24f9e474d6cd2..0000000000000 --- a/recipes/cairo/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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, skip_x64_x86=True): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - diff --git a/recipes/cairo/config.yml b/recipes/cairo/config.yml index 8e74221deaa9f..63606cbea47b1 100644 --- a/recipes/cairo/config.yml +++ b/recipes/cairo/config.yml @@ -7,7 +7,3 @@ versions: folder: meson "1.17.4": folder: meson - "1.17.2": - folder: all - "1.16.0": - folder: all diff --git a/recipes/cairo/meson/conanfile.py b/recipes/cairo/meson/conanfile.py index 9cddead167dbc..9b42f6bc4a8e0 100644 --- a/recipes/cairo/meson/conanfile.py +++ b/recipes/cairo/meson/conanfile.py @@ -86,9 +86,9 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("pixman/0.42.2") + self.requires("pixman/0.43.4") if self.options.with_zlib and self.options.with_png: - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.with_lzo: self.requires("lzo/2.10") if self.options.with_zlib: @@ -96,11 +96,11 @@ def requirements(self): if self.options.with_freetype: self.requires("freetype/2.13.2", transitive_headers=True, transitive_libs=True) if self.options.with_fontconfig: - self.requires("fontconfig/2.14.2", transitive_headers=True, transitive_libs=True) + self.requires("fontconfig/2.15.0", transitive_headers=True, transitive_libs=True) if self.options.with_png: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_glib: - self.requires("glib/2.78.1") + self.requires("glib/2.78.3") if self.settings.os in ["Linux", "FreeBSD"]: if self.options.with_xlib or self.options.with_xlib_xrender or self.options.with_xcb: self.requires("xorg/system", transitive_headers=True, transitive_libs=True) @@ -128,9 +128,9 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("meson/1.3.0") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/cairomm/all/conanfile.py b/recipes/cairomm/all/conanfile.py index 3b77adb9dbed4..4380e40cd818e 100644 --- a/recipes/cairomm/all/conanfile.py +++ b/recipes/cairomm/all/conanfile.py @@ -58,7 +58,7 @@ def layout(self): def requirements(self): self.requires("cairo/1.18.0", transitive_headers=True, transitive_libs=True) - self.requires("fontconfig/2.14.2", transitive_headers=True, transitive_libs=True) + self.requires("fontconfig/2.15.0", transitive_headers=True, transitive_libs=True) if self._abi_version == "1.16": self.requires("libsigcpp/3.0.7", transitive_headers=True, transitive_libs=True) else: @@ -76,9 +76,9 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("meson/1.2.3") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/capnproto/all/conandata.yml b/recipes/capnproto/all/conandata.yml index e635b41da8f05..6ecc4845785b6 100644 --- a/recipes/capnproto/all/conandata.yml +++ b/recipes/capnproto/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.2": + url: "https://github.com/capnproto/capnproto/archive/v1.0.2.tar.gz" + sha256: "3cfd0ed58080d78b3a3381305489f2175cdaf1ef1cb55425d8fc8246a76bdff3" "1.0.1": url: "https://github.com/capnproto/capnproto/archive/v1.0.1.tar.gz" sha256: "5bdb16f6b389a9e29b04214b9bae1759e8b7fe2b45049d7e3f1f286ba050a200" @@ -27,6 +30,10 @@ sources: url: "https://github.com/capnproto/capnproto/archive/v0.7.0.tar.gz" sha256: "76c7114a3d142ad08b7208b3964a26e72a6320ee81331d3f0b87569fc9c47a28" patches: + "1.0.2": + - patch_file: "patches/0015-disable-tests-for-1.0.0.patch" + patch_description: "disable test build" + patch_type: "conan" "1.0.1": - patch_file: "patches/0015-disable-tests-for-1.0.0.patch" patch_description: "disable test build" diff --git a/recipes/capnproto/all/test_package/CMakeLists.txt b/recipes/capnproto/all/test_package/CMakeLists.txt index 8ffc65e9ffa4b..5e0d93f57dde5 100644 --- a/recipes/capnproto/all/test_package/CMakeLists.txt +++ b/recipes/capnproto/all/test_package/CMakeLists.txt @@ -3,19 +3,9 @@ project(test_package LANGUAGES CXX) find_package(CapnProto REQUIRED capnp capnp-rpc CONFIG) -capnp_generate_cpp(addressbookSources addressbookHeaders addressbook.capnp) -add_executable(addressbook addressbook.c++ ${addressbookSources}) + +add_executable(addressbook test_package.c++ ${addressbookSources}) target_include_directories(addressbook PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(addressbook PRIVATE CapnProto::capnp) target_compile_features(addressbook PRIVATE cxx_std_14) -capnp_generate_cpp(calculatorSources calculatorHeaders calculator.capnp) -add_library(calculator_protocol STATIC ${calculatorSources}) -target_include_directories(calculator_protocol PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries(calculator_protocol PUBLIC CapnProto::capnp-rpc) -target_compile_features(calculator_protocol PUBLIC cxx_std_14) - -add_executable(calculator-client calculator-client.c++) -target_link_libraries(calculator-client PRIVATE calculator_protocol) -add_executable(calculator-server calculator-server.c++) -target_link_libraries(calculator-server PRIVATE calculator_protocol) diff --git a/recipes/capnproto/all/test_package/addressbook.c++ b/recipes/capnproto/all/test_package/addressbook.c++ deleted file mode 100644 index b2bece9472b88..0000000000000 --- a/recipes/capnproto/all/test_package/addressbook.c++ +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -// Licensed under the MIT License: -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// This sample code appears in the documentation for the C++ implementation. -// -// If Cap'n Proto is installed, build the sample like: -// capnp compile -oc++ addressbook.capnp -// c++ -std=c++14 -Wall addressbook.c++ addressbook.capnp.c++ `pkg-config --cflags --libs capnp` -o addressbook -// -// If Cap'n Proto is not installed, but the source is located at $SRC and has been -// compiled in $BUILD (often both are simply ".." from here), you can do: -// $BUILD/capnp compile -I$SRC/src -o$BUILD/capnpc-c++ addressbook.capnp -// c++ -std=c++14 -Wall addressbook.c++ addressbook.capnp.c++ -I$SRC/src -L$BUILD/.libs -lcapnp -lkj -o addressbook -// -// Run like: -// ./addressbook write | ./addressbook read -// Use "dwrite" and "dread" to use dynamic code instead. - -// TODO(test): Needs cleanup. - -#include "addressbook.capnp.h" -#include -#include -#include - -using addressbook::Person; -using addressbook::AddressBook; - -void writeAddressBook(int fd) { - ::capnp::MallocMessageBuilder message; - - AddressBook::Builder addressBook = message.initRoot(); - ::capnp::List::Builder people = addressBook.initPeople(2); - - Person::Builder alice = people[0]; - alice.setId(123); - alice.setName("Alice"); - alice.setEmail("alice@example.com"); - // Type shown for explanation purposes; normally you'd use auto. - ::capnp::List::Builder alicePhones = - alice.initPhones(1); - alicePhones[0].setNumber("555-1212"); - alicePhones[0].setType(Person::PhoneNumber::Type::MOBILE); - alice.getEmployment().setSchool("MIT"); - - Person::Builder bob = people[1]; - bob.setId(456); - bob.setName("Bob"); - bob.setEmail("bob@example.com"); - auto bobPhones = bob.initPhones(2); - bobPhones[0].setNumber("555-4567"); - bobPhones[0].setType(Person::PhoneNumber::Type::HOME); - bobPhones[1].setNumber("555-7654"); - bobPhones[1].setType(Person::PhoneNumber::Type::WORK); - bob.getEmployment().setUnemployed(); - - writePackedMessageToFd(fd, message); -} - -void printAddressBook(int fd) { - ::capnp::PackedFdMessageReader message(fd); - - AddressBook::Reader addressBook = message.getRoot(); - - for (Person::Reader person : addressBook.getPeople()) { - std::cout << person.getName().cStr() << ": " - << person.getEmail().cStr() << std::endl; - for (Person::PhoneNumber::Reader phone: person.getPhones()) { - const char* typeName = "UNKNOWN"; - switch (phone.getType()) { - case Person::PhoneNumber::Type::MOBILE: typeName = "mobile"; break; - case Person::PhoneNumber::Type::HOME: typeName = "home"; break; - case Person::PhoneNumber::Type::WORK: typeName = "work"; break; - } - std::cout << " " << typeName << " phone: " - << phone.getNumber().cStr() << std::endl; - } - Person::Employment::Reader employment = person.getEmployment(); - switch (employment.which()) { - case Person::Employment::UNEMPLOYED: - std::cout << " unemployed" << std::endl; - break; - case Person::Employment::EMPLOYER: - std::cout << " employer: " - << employment.getEmployer().cStr() << std::endl; - break; - case Person::Employment::SCHOOL: - std::cout << " student at: " - << employment.getSchool().cStr() << std::endl; - break; - case Person::Employment::SELF_EMPLOYED: - std::cout << " self-employed" << std::endl; - break; - } - } -} - -#if !CAPNP_LITE - -#include "addressbook.capnp.h" -#include -#include -#include -#include -#include - -using ::capnp::DynamicValue; -using ::capnp::DynamicStruct; -using ::capnp::DynamicEnum; -using ::capnp::DynamicList; -using ::capnp::List; -using ::capnp::Schema; -using ::capnp::StructSchema; -using ::capnp::EnumSchema; - -using ::capnp::Void; -using ::capnp::Text; -using ::capnp::MallocMessageBuilder; -using ::capnp::PackedFdMessageReader; - -void dynamicWriteAddressBook(int fd, StructSchema schema) { - // Write a message using the dynamic API to set each - // field by text name. This isn't something you'd - // normally want to do; it's just for illustration. - - MallocMessageBuilder message; - - // Types shown for explanation purposes; normally you'd - // use auto. - DynamicStruct::Builder addressBook = - message.initRoot(schema); - - DynamicList::Builder people = - addressBook.init("people", 2).as(); - - DynamicStruct::Builder alice = - people[0].as(); - alice.set("id", 123); - alice.set("name", "Alice"); - alice.set("email", "alice@example.com"); - auto alicePhones = alice.init("phones", 1).as(); - auto phone0 = alicePhones[0].as(); - phone0.set("number", "555-1212"); - phone0.set("type", "mobile"); - alice.get("employment").as() - .set("school", "MIT"); - - auto bob = people[1].as(); - bob.set("id", 456); - bob.set("name", "Bob"); - bob.set("email", "bob@example.com"); - - // Some magic: We can convert a dynamic sub-value back to - // the native type with as()! - List::Builder bobPhones = - bob.init("phones", 2).as>(); - bobPhones[0].setNumber("555-4567"); - bobPhones[0].setType(Person::PhoneNumber::Type::HOME); - bobPhones[1].setNumber("555-7654"); - bobPhones[1].setType(Person::PhoneNumber::Type::WORK); - bob.get("employment").as() - .set("unemployed", ::capnp::VOID); - - writePackedMessageToFd(fd, message); -} - -void dynamicPrintValue(DynamicValue::Reader value) { - // Print an arbitrary message via the dynamic API by - // iterating over the schema. Look at the handling - // of STRUCT in particular. - - switch (value.getType()) { - case DynamicValue::VOID: - std::cout << ""; - break; - case DynamicValue::BOOL: - std::cout << (value.as() ? "true" : "false"); - break; - case DynamicValue::INT: - std::cout << value.as(); - break; - case DynamicValue::UINT: - std::cout << value.as(); - break; - case DynamicValue::FLOAT: - std::cout << value.as(); - break; - case DynamicValue::TEXT: - std::cout << '\"' << value.as().cStr() << '\"'; - break; - case DynamicValue::LIST: { - std::cout << "["; - bool first = true; - for (auto element: value.as()) { - if (first) { - first = false; - } else { - std::cout << ", "; - } - dynamicPrintValue(element); - } - std::cout << "]"; - break; - } - case DynamicValue::ENUM: { - auto enumValue = value.as(); - KJ_IF_MAYBE(enumerant, enumValue.getEnumerant()) { - std::cout << - enumerant->getProto().getName().cStr(); - } else { - // Unknown enum value; output raw number. - std::cout << enumValue.getRaw(); - } - break; - } - case DynamicValue::STRUCT: { - std::cout << "("; - auto structValue = value.as(); - bool first = true; - for (auto field: structValue.getSchema().getFields()) { - if (!structValue.has(field)) continue; - if (first) { - first = false; - } else { - std::cout << ", "; - } - std::cout << field.getProto().getName().cStr() - << " = "; - dynamicPrintValue(structValue.get(field)); - } - std::cout << ")"; - break; - } - default: - // There are other types, we aren't handling them. - std::cout << "?"; - break; - } -} - -void dynamicPrintMessage(int fd, StructSchema schema) { - PackedFdMessageReader message(fd); - dynamicPrintValue(message.getRoot(schema)); - std::cout << std::endl; -} - -#endif // !CAPNP_LITE - -int main(int argc, char* argv[]) { - if (argc != 2) { - std::cerr << "Missing arg." << std::endl; - return 1; - } else if (strcmp(argv[1], "write") == 0) { - writeAddressBook(1); - } else if (strcmp(argv[1], "read") == 0) { - printAddressBook(0); -#if !CAPNP_LITE - } else if (strcmp(argv[1], "dwrite") == 0) { - StructSchema schema = Schema::from(); - dynamicWriteAddressBook(1, schema); - } else if (strcmp(argv[1], "dread") == 0) { - StructSchema schema = Schema::from(); - dynamicPrintMessage(0, schema); -#endif - } else { - std::cerr << "Invalid arg: " << argv[1] << std::endl; - return 1; - } - return 0; -} diff --git a/recipes/capnproto/all/test_package/addressbook.capnp b/recipes/capnproto/all/test_package/addressbook.capnp deleted file mode 100644 index 1a6c60937e8af..0000000000000 --- a/recipes/capnproto/all/test_package/addressbook.capnp +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -# Licensed under the MIT License: -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -@0x9eb32e19f86ee174; - -using Cxx = import "/capnp/c++.capnp"; -$Cxx.namespace("addressbook"); - -struct Person { - id @0 :UInt32; - name @1 :Text; - email @2 :Text; - phones @3 :List(PhoneNumber); - - struct PhoneNumber { - number @0 :Text; - type @1 :Type; - - enum Type { - mobile @0; - home @1; - work @2; - } - } - - employment :union { - unemployed @4 :Void; - employer @5 :Text; - school @6 :Text; - selfEmployed @7 :Void; - # We assume that a person is only one of these. - } -} - -struct AddressBook { - people @0 :List(Person); -} diff --git a/recipes/capnproto/all/test_package/calculator-client.c++ b/recipes/capnproto/all/test_package/calculator-client.c++ deleted file mode 100644 index 5d8452921cde9..0000000000000 --- a/recipes/capnproto/all/test_package/calculator-client.c++ +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -// Licensed under the MIT License: -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#include "calculator.capnp.h" -#include -#include -#include -#include - -class PowerFunction final: public Calculator::Function::Server { - // An implementation of the Function interface wrapping pow(). Note that - // we're implementing this on the client side and will pass a reference to - // the server. The server will then be able to make calls back to the client. - -public: - kj::Promise call(CallContext context) { - auto params = context.getParams().getParams(); - KJ_REQUIRE(params.size() == 2, "Wrong number of parameters."); - context.getResults().setValue(pow(params[0], params[1])); - return kj::READY_NOW; - } -}; - -int main(int argc, const char* argv[]) { - if (argc != 2) { - std::cerr << "usage: " << argv[0] << " HOST:PORT\n" - "Connects to the Calculator server at the given address and " - "does some RPCs." << std::endl; - return 1; - } - - capnp::EzRpcClient client(argv[1]); - Calculator::Client calculator = client.getMain(); - - // Keep an eye on `waitScope`. Whenever you see it used is a place where we - // stop and wait for the server to respond. If a line of code does not use - // `waitScope`, then it does not block! - auto& waitScope = client.getWaitScope(); - - { - // Make a request that just evaluates the literal value 123. - // - // What's interesting here is that evaluate() returns a "Value", which is - // another interface and therefore points back to an object living on the - // server. We then have to call read() on that object to read it. - // However, even though we are making two RPC's, this block executes in - // *one* network round trip because of promise pipelining: we do not wait - // for the first call to complete before we send the second call to the - // server. - - std::cout << "Evaluating a literal... "; - std::cout.flush(); - - // Set up the request. - auto request = calculator.evaluateRequest(); - request.getExpression().setLiteral(123); - - // Send it, which returns a promise for the result (without blocking). - auto evalPromise = request.send(); - - // Using the promise, create a pipelined request to call read() on the - // returned object, and then send that. - auto readPromise = evalPromise.getValue().readRequest().send(); - - // Now that we've sent all the requests, wait for the response. Until this - // point, we haven't waited at all! - auto response = readPromise.wait(waitScope); - KJ_ASSERT(response.getValue() == 123); - - std::cout << "PASS" << std::endl; - } - - { - // Make a request to evaluate 123 + 45 - 67. - // - // The Calculator interface requires that we first call getOperator() to - // get the addition and subtraction functions, then call evaluate() to use - // them. But, once again, we can get both functions, call evaluate(), and - // then read() the result -- four RPCs -- in the time of *one* network - // round trip, because of promise pipelining. - - std::cout << "Using add and subtract... "; - std::cout.flush(); - - Calculator::Function::Client add = nullptr; - Calculator::Function::Client subtract = nullptr; - - { - // Get the "add" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::ADD); - add = request.send().getFunc(); - } - - { - // Get the "subtract" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::SUBTRACT); - subtract = request.send().getFunc(); - } - - // Build the request to evaluate 123 + 45 - 67. - auto request = calculator.evaluateRequest(); - - auto subtractCall = request.getExpression().initCall(); - subtractCall.setFunction(subtract); - auto subtractParams = subtractCall.initParams(2); - subtractParams[1].setLiteral(67); - - auto addCall = subtractParams[0].initCall(); - addCall.setFunction(add); - auto addParams = addCall.initParams(2); - addParams[0].setLiteral(123); - addParams[1].setLiteral(45); - - // Send the evaluate() request, read() the result, and wait for read() to - // finish. - auto evalPromise = request.send(); - auto readPromise = evalPromise.getValue().readRequest().send(); - - auto response = readPromise.wait(waitScope); - KJ_ASSERT(response.getValue() == 101); - - std::cout << "PASS" << std::endl; - } - - { - // Make a request to evaluate 4 * 6, then use the result in two more - // requests that add 3 and 5. - // - // Since evaluate() returns its result wrapped in a `Value`, we can pass - // that `Value` back to the server in subsequent requests before the first - // `evaluate()` has actually returned. Thus, this example again does only - // one network round trip. - - std::cout << "Pipelining eval() calls... "; - std::cout.flush(); - - Calculator::Function::Client add = nullptr; - Calculator::Function::Client multiply = nullptr; - - { - // Get the "add" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::ADD); - add = request.send().getFunc(); - } - - { - // Get the "multiply" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::MULTIPLY); - multiply = request.send().getFunc(); - } - - // Build the request to evaluate 4 * 6 - auto request = calculator.evaluateRequest(); - - auto multiplyCall = request.getExpression().initCall(); - multiplyCall.setFunction(multiply); - auto multiplyParams = multiplyCall.initParams(2); - multiplyParams[0].setLiteral(4); - multiplyParams[1].setLiteral(6); - - auto multiplyResult = request.send().getValue(); - - // Use the result in two calls that add 3 and add 5. - - auto add3Request = calculator.evaluateRequest(); - auto add3Call = add3Request.getExpression().initCall(); - add3Call.setFunction(add); - auto add3Params = add3Call.initParams(2); - add3Params[0].setPreviousResult(multiplyResult); - add3Params[1].setLiteral(3); - auto add3Promise = add3Request.send().getValue().readRequest().send(); - - auto add5Request = calculator.evaluateRequest(); - auto add5Call = add5Request.getExpression().initCall(); - add5Call.setFunction(add); - auto add5Params = add5Call.initParams(2); - add5Params[0].setPreviousResult(multiplyResult); - add5Params[1].setLiteral(5); - auto add5Promise = add5Request.send().getValue().readRequest().send(); - - // Now wait for the results. - KJ_ASSERT(add3Promise.wait(waitScope).getValue() == 27); - KJ_ASSERT(add5Promise.wait(waitScope).getValue() == 29); - - std::cout << "PASS" << std::endl; - } - - { - // Our calculator interface supports defining functions. Here we use it - // to define two functions and then make calls to them as follows: - // - // f(x, y) = x * 100 + y - // g(x) = f(x, x + 1) * 2; - // f(12, 34) - // g(21) - // - // Once again, the whole thing takes only one network round trip. - - std::cout << "Defining functions... "; - std::cout.flush(); - - Calculator::Function::Client add = nullptr; - Calculator::Function::Client multiply = nullptr; - Calculator::Function::Client f = nullptr; - Calculator::Function::Client g = nullptr; - - { - // Get the "add" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::ADD); - add = request.send().getFunc(); - } - - { - // Get the "multiply" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::MULTIPLY); - multiply = request.send().getFunc(); - } - - { - // Define f. - auto request = calculator.defFunctionRequest(); - request.setParamCount(2); - - { - // Build the function body. - auto addCall = request.getBody().initCall(); - addCall.setFunction(add); - auto addParams = addCall.initParams(2); - addParams[1].setParameter(1); // y - - auto multiplyCall = addParams[0].initCall(); - multiplyCall.setFunction(multiply); - auto multiplyParams = multiplyCall.initParams(2); - multiplyParams[0].setParameter(0); // x - multiplyParams[1].setLiteral(100); - } - - f = request.send().getFunc(); - } - - { - // Define g. - auto request = calculator.defFunctionRequest(); - request.setParamCount(1); - - { - // Build the function body. - auto multiplyCall = request.getBody().initCall(); - multiplyCall.setFunction(multiply); - auto multiplyParams = multiplyCall.initParams(2); - multiplyParams[1].setLiteral(2); - - auto fCall = multiplyParams[0].initCall(); - fCall.setFunction(f); - auto fParams = fCall.initParams(2); - fParams[0].setParameter(0); - - auto addCall = fParams[1].initCall(); - addCall.setFunction(add); - auto addParams = addCall.initParams(2); - addParams[0].setParameter(0); - addParams[1].setLiteral(1); - } - - g = request.send().getFunc(); - } - - // OK, we've defined all our functions. Now create our eval requests. - - // f(12, 34) - auto fEvalRequest = calculator.evaluateRequest(); - auto fCall = fEvalRequest.initExpression().initCall(); - fCall.setFunction(f); - auto fParams = fCall.initParams(2); - fParams[0].setLiteral(12); - fParams[1].setLiteral(34); - auto fEvalPromise = fEvalRequest.send().getValue().readRequest().send(); - - // g(21) - auto gEvalRequest = calculator.evaluateRequest(); - auto gCall = gEvalRequest.initExpression().initCall(); - gCall.setFunction(g); - gCall.initParams(1)[0].setLiteral(21); - auto gEvalPromise = gEvalRequest.send().getValue().readRequest().send(); - - // Wait for the results. - KJ_ASSERT(fEvalPromise.wait(waitScope).getValue() == 1234); - KJ_ASSERT(gEvalPromise.wait(waitScope).getValue() == 4244); - - std::cout << "PASS" << std::endl; - } - - { - // Make a request that will call back to a function defined locally. - // - // Specifically, we will compute 2^(4 + 5). However, exponent is not - // defined by the Calculator server. So, we'll implement the Function - // interface locally and pass it to the server for it to use when - // evaluating the expression. - // - // This example requires two network round trips to complete, because the - // server calls back to the client once before finishing. In this - // particular case, this could potentially be optimized by using a tail - // call on the server side -- see CallContext::tailCall(). However, to - // keep the example simpler, we haven't implemented this optimization in - // the sample server. - - std::cout << "Using a callback... "; - std::cout.flush(); - - Calculator::Function::Client add = nullptr; - - { - // Get the "add" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::ADD); - add = request.send().getFunc(); - } - - // Build the eval request for 2^(4+5). - auto request = calculator.evaluateRequest(); - - auto powCall = request.getExpression().initCall(); - powCall.setFunction(kj::heap()); - auto powParams = powCall.initParams(2); - powParams[0].setLiteral(2); - - auto addCall = powParams[1].initCall(); - addCall.setFunction(add); - auto addParams = addCall.initParams(2); - addParams[0].setLiteral(4); - addParams[1].setLiteral(5); - - // Send the request and wait. - auto response = request.send().getValue().readRequest() - .send().wait(waitScope); - KJ_ASSERT(response.getValue() == 512); - - std::cout << "PASS" << std::endl; - } - - return 0; -} diff --git a/recipes/capnproto/all/test_package/calculator-server.c++ b/recipes/capnproto/all/test_package/calculator-server.c++ deleted file mode 100644 index c2593be3a9064..0000000000000 --- a/recipes/capnproto/all/test_package/calculator-server.c++ +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -// Licensed under the MIT License: -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#include "calculator.capnp.h" -#include -#include -#include -#include - -typedef unsigned int uint; - -kj::Promise readValue(Calculator::Value::Client value) { - // Helper function to asynchronously call read() on a Calculator::Value and - // return a promise for the result. (In the future, the generated code might - // include something like this automatically.) - - return value.readRequest().send() - .then([](capnp::Response result) { - return result.getValue(); - }); -} - -kj::Promise evaluateImpl( - Calculator::Expression::Reader expression, - capnp::List::Reader params = capnp::List::Reader()) { - // Implementation of CalculatorImpl::evaluate(), also shared by - // FunctionImpl::call(). In the latter case, `params` are the parameter - // values passed to the function; in the former case, `params` is just an - // empty list. - - switch (expression.which()) { - case Calculator::Expression::LITERAL: - return expression.getLiteral(); - - case Calculator::Expression::PREVIOUS_RESULT: - return readValue(expression.getPreviousResult()); - - case Calculator::Expression::PARAMETER: { - KJ_REQUIRE(expression.getParameter() < params.size(), - "Parameter index out-of-range."); - return params[expression.getParameter()]; - } - - case Calculator::Expression::CALL: { - auto call = expression.getCall(); - auto func = call.getFunction(); - - // Evaluate each parameter. - kj::Array> paramPromises = - KJ_MAP(param, call.getParams()) { - return evaluateImpl(param, params); - }; - - // Join the array of promises into a promise for an array. - kj::Promise> joinedParams = - kj::joinPromises(kj::mv(paramPromises)); - - // When the parameters are complete, call the function. - return joinedParams.then([KJ_CPCAP(func)](kj::Array&& paramValues) mutable { - auto request = func.callRequest(); - request.setParams(paramValues); - return request.send().then( - [](capnp::Response&& result) { - return result.getValue(); - }); - }); - } - - default: - // Throw an exception. - KJ_FAIL_REQUIRE("Unknown expression type."); - } -} - -class ValueImpl final: public Calculator::Value::Server { - // Simple implementation of the Calculator.Value Cap'n Proto interface. - -public: - ValueImpl(double value): value(value) {} - - kj::Promise read(ReadContext context) { - context.getResults().setValue(value); - return kj::READY_NOW; - } - -private: - double value; -}; - -class FunctionImpl final: public Calculator::Function::Server { - // Implementation of the Calculator.Function Cap'n Proto interface, where the - // function is defined by a Calculator.Expression. - -public: - FunctionImpl(uint paramCount, Calculator::Expression::Reader body) - : paramCount(paramCount) { - this->body.setRoot(body); - } - - kj::Promise call(CallContext context) { - auto params = context.getParams().getParams(); - KJ_REQUIRE(params.size() == paramCount, "Wrong number of parameters."); - - return evaluateImpl(body.getRoot(), params) - .then([KJ_CPCAP(context)](double value) mutable { - context.getResults().setValue(value); - }); - } - -private: - uint paramCount; - // The function's arity. - - capnp::MallocMessageBuilder body; - // Stores a permanent copy of the function body. -}; - -class OperatorImpl final: public Calculator::Function::Server { - // Implementation of the Calculator.Function Cap'n Proto interface, wrapping - // basic binary arithmetic operators. - -public: - OperatorImpl(Calculator::Operator op): op(op) {} - - kj::Promise call(CallContext context) { - auto params = context.getParams().getParams(); - KJ_REQUIRE(params.size() == 2, "Wrong number of parameters."); - - double result; - switch (op) { - case Calculator::Operator::ADD: result = params[0] + params[1]; break; - case Calculator::Operator::SUBTRACT:result = params[0] - params[1]; break; - case Calculator::Operator::MULTIPLY:result = params[0] * params[1]; break; - case Calculator::Operator::DIVIDE: result = params[0] / params[1]; break; - default: - KJ_FAIL_REQUIRE("Unknown operator."); - } - - context.getResults().setValue(result); - return kj::READY_NOW; - } - -private: - Calculator::Operator op; -}; - -class CalculatorImpl final: public Calculator::Server { - // Implementation of the Calculator Cap'n Proto interface. - -public: - kj::Promise evaluate(EvaluateContext context) override { - return evaluateImpl(context.getParams().getExpression()) - .then([KJ_CPCAP(context)](double value) mutable { - context.getResults().setValue(kj::heap(value)); - }); - } - - kj::Promise defFunction(DefFunctionContext context) override { - auto params = context.getParams(); - context.getResults().setFunc(kj::heap( - params.getParamCount(), params.getBody())); - return kj::READY_NOW; - } - - kj::Promise getOperator(GetOperatorContext context) override { - context.getResults().setFunc(kj::heap( - context.getParams().getOp())); - return kj::READY_NOW; - } -}; - -int main(int argc, const char* argv[]) { - if (argc != 2) { - std::cerr << "usage: " << argv[0] << " ADDRESS[:PORT]\n" - "Runs the server bound to the given address/port.\n" - "ADDRESS may be '*' to bind to all local addresses.\n" - ":PORT may be omitted to choose a port automatically." << std::endl; - return 1; - } - - // Set up a server. - capnp::EzRpcServer server(kj::heap(), argv[1]); - - // Write the port number to stdout, in case it was chosen automatically. - auto& waitScope = server.getWaitScope(); - uint port = server.getPort().wait(waitScope); - if (port == 0) { - // The address format "unix:/path/to/socket" opens a unix domain socket, - // in which case the port will be zero. - std::cout << "Listening on Unix socket..." << std::endl; - } else { - std::cout << "Listening on port " << port << "..." << std::endl; - } - - // Run forever, accepting connections and handling requests. - kj::NEVER_DONE.wait(waitScope); -} diff --git a/recipes/capnproto/all/test_package/calculator.capnp b/recipes/capnproto/all/test_package/calculator.capnp deleted file mode 100644 index adc8294e57578..0000000000000 --- a/recipes/capnproto/all/test_package/calculator.capnp +++ /dev/null @@ -1,118 +0,0 @@ -# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -# Licensed under the MIT License: -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -@0x85150b117366d14b; - -interface Calculator { - # A "simple" mathematical calculator, callable via RPC. - # - # But, to show off Cap'n Proto, we add some twists: - # - # - You can use the result from one call as the input to the next - # without a network round trip. To accomplish this, evaluate() - # returns a `Value` object wrapping the actual numeric value. - # This object may be used in a subsequent expression. With - # promise pipelining, the Value can actually be used before - # the evaluate() call that creates it returns! - # - # - You can define new functions, and then call them. This again - # shows off pipelining, but it also gives the client the - # opportunity to define a function on the client side and have - # the server call back to it. - # - # - The basic arithmetic operators are exposed as Functions, and - # you have to call getOperator() to obtain them from the server. - # This again demonstrates pipelining -- using getOperator() to - # get each operator and then using them in evaluate() still - # only takes one network round trip. - - evaluate @0 (expression :Expression) -> (value :Value); - # Evaluate the given expression and return the result. The - # result is returned wrapped in a Value interface so that you - # may pass it back to the server in a pipelined request. To - # actually get the numeric value, you must call read() on the - # Value -- but again, this can be pipelined so that it incurs - # no additional latency. - - struct Expression { - # A numeric expression. - - union { - literal @0 :Float64; - # A literal numeric value. - - previousResult @1 :Value; - # A value that was (or, will be) returned by a previous - # evaluate(). - - parameter @2 :UInt32; - # A parameter to the function (only valid in function bodies; - # see defFunction). - - call :group { - # Call a function on a list of parameters. - function @3 :Function; - params @4 :List(Expression); - } - } - } - - interface Value { - # Wraps a numeric value in an RPC object. This allows the value - # to be used in subsequent evaluate() requests without the client - # waiting for the evaluate() that returns the Value to finish. - - read @0 () -> (value :Float64); - # Read back the raw numeric value. - } - - defFunction @1 (paramCount :Int32, body :Expression) - -> (func :Function); - # Define a function that takes `paramCount` parameters and returns the - # evaluation of `body` after substituting these parameters. - - interface Function { - # An algebraic function. Can be called directly, or can be used inside - # an Expression. - # - # A client can create a Function that runs on the server side using - # `defFunction()` or `getOperator()`. Alternatively, a client can - # implement a Function on the client side and the server will call back - # to it. However, a function defined on the client side will require a - # network round trip whenever the server needs to call it, whereas - # functions defined on the server and then passed back to it are called - # locally. - - call @0 (params :List(Float64)) -> (value :Float64); - # Call the function on the given parameters. - } - - getOperator @2 (op :Operator) -> (func :Function); - # Get a Function representing an arithmetic operator, which can then be - # used in Expressions. - - enum Operator { - add @0; - subtract @1; - multiply @2; - divide @3; - } -} diff --git a/recipes/capnproto/all/test_package/conanfile.py b/recipes/capnproto/all/test_package/conanfile.py index d4d32590a51cc..85b7dcba030f5 100644 --- a/recipes/capnproto/all/test_package/conanfile.py +++ b/recipes/capnproto/all/test_package/conanfile.py @@ -14,11 +14,7 @@ def layout(self): cmake_layout(self) def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - if hasattr(self, "settings_build") and cross_building(self): - self.tool_requires(self.tested_reference_str) + self.requires(self.tested_reference_str, run=True) def generate(self): VirtualRunEnv(self).generate() @@ -34,5 +30,7 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "addressbook") - self.run(f"{bin_path} write", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "addressbook") + self.run(bin_path, env="conanrun") + + self.run("capnp id") diff --git a/recipes/capnproto/all/test_package/test_package.c++ b/recipes/capnproto/all/test_package/test_package.c++ new file mode 100644 index 0000000000000..8ed58079da0b0 --- /dev/null +++ b/recipes/capnproto/all/test_package/test_package.c++ @@ -0,0 +1,9 @@ +#include +#include + + +int main() { + capnp::MallocMessageBuilder message; + std::cout << sizeof(message) << std::endl; + return 0; +} diff --git a/recipes/capnproto/all/test_v1_package/CMakeLists.txt b/recipes/capnproto/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/capnproto/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/capnproto/all/test_v1_package/conanfile.py b/recipes/capnproto/all/test_v1_package/conanfile.py deleted file mode 100644 index 9c7aa58ab8868..0000000000000 --- a/recipes/capnproto/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,26 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires(self.tested_reference_str) - - def build(self): - with tools.no_op() if hasattr(self, "settings_build") else tools.run_environment(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "addressbook") - self.run(f"{bin_path} write", run_environment=True) diff --git a/recipes/capnproto/config.yml b/recipes/capnproto/config.yml index 887e41e533af8..7439163d18050 100644 --- a/recipes/capnproto/config.yml +++ b/recipes/capnproto/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.2": + folder: all "1.0.1": folder: all "1.0.0": diff --git a/recipes/cargs/all/conandata.yml b/recipes/cargs/all/conandata.yml index 01238c00f6a56..4947b6c17c0a0 100644 --- a/recipes/cargs/all/conandata.yml +++ b/recipes/cargs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.0": + url: "https://github.com/likle/cargs/archive/v1.2.0.tar.gz" + sha256: "0b33379e3d3c8cb3e22f33d3e1a260adcd366970868bc9b7c47237f24188ff25" "1.1.0": url: "https://github.com/likle/cargs/archive/v1.1.0.tar.gz" sha256: "87e7da5b539f574d48529870cb0620ef5a244a5ee2eac73cc7559dedc04128ca" diff --git a/recipes/cargs/config.yml b/recipes/cargs/config.yml index 24b8d6fbb0acc..f86b56ea8cf6a 100644 --- a/recipes/cargs/config.yml +++ b/recipes/cargs/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.0": folder: all "1.0.3": diff --git a/recipes/catch2/3.x.x/conandata.yml b/recipes/catch2/3.x.x/conandata.yml index cf3bf5f0495f5..bd54e7086e964 100644 --- a/recipes/catch2/3.x.x/conandata.yml +++ b/recipes/catch2/3.x.x/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.6.0": + url: "https://github.com/catchorg/Catch2/archive/v3.6.0.tar.gz" + sha256: "485932259a75c7c6b72d4b874242c489ea5155d17efa345eb8cc72159f49f356" + "3.5.4": + url: "https://github.com/catchorg/Catch2/archive/v3.5.4.tar.gz" + sha256: "b7754b711242c167d8f60b890695347f90a1ebc95949a045385114165d606dbb" "3.5.3": url: "https://github.com/catchorg/Catch2/archive/v3.5.3.tar.gz" sha256: "8d723b0535c94860ef8cf6231580fa47d67a3416757ecb10639e40d748ab6c71" diff --git a/recipes/catch2/3.x.x/conanfile.py b/recipes/catch2/3.x.x/conanfile.py index 6f59c5ce8e188..c87f83e06c752 100644 --- a/recipes/catch2/3.x.x/conanfile.py +++ b/recipes/catch2/3.x.x/conanfile.py @@ -7,7 +7,7 @@ import os import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class Catch2Conan(ConanFile): @@ -35,6 +35,9 @@ class Catch2Conan(ConanFile): "console_width": "80", "no_posix_signals": False, } + # disallow cppstd compatibility, as it affects the ABI in this library + # see https://github.com/conan-io/conan-center-index/issues/19008 + extension_properties = {"compatibility_cppstd": False} @property def _min_cppstd(self): diff --git a/recipes/catch2/config.yml b/recipes/catch2/config.yml index b24c301a17e49..51d1bba3d03b7 100644 --- a/recipes/catch2/config.yml +++ b/recipes/catch2/config.yml @@ -1,4 +1,8 @@ versions: + "3.6.0": + folder: 3.x.x + "3.5.4": + folder: 3.x.x "3.5.3": folder: 3.x.x "3.5.2": diff --git a/recipes/ccache/all/conandata.yml b/recipes/ccache/all/conandata.yml index 5c1cbd2adcc93..ff430e4765316 100644 --- a/recipes/ccache/all/conandata.yml +++ b/recipes/ccache/all/conandata.yml @@ -1,63 +1,10 @@ sources: + "4.10": + url: "https://github.com/ccache/ccache/releases/download/v4.10/ccache-4.10.tar.gz" + sha256: "16972ba62c8499045edc3ae7d7b8a0b419a961567f5ff0f01bf5a44194204775" "4.9.1": url: "https://github.com/ccache/ccache/releases/download/v4.9.1/ccache-4.9.1.tar.xz" sha256: "4c03bc840699127d16c3f0e6112e3f40ce6a230d5873daa78c60a59c7ef59d25" - "4.9": - url: "https://github.com/ccache/ccache/releases/download/v4.9/ccache-4.9.tar.xz" - sha256: "1ebc72324e3ab52af0b562bf54189d108e85eef6478d6304a345a3c2dc4018e0" "4.8.3": url: "https://github.com/ccache/ccache/releases/download/v4.8.3/ccache-4.8.3.tar.xz" sha256: "e47374c810b248cfca3665ee1d86c7c763ffd68d9944bc422d9c1872611f2b11" - "4.8.2": - url: "https://github.com/ccache/ccache/releases/download/v4.8.2/ccache-4.8.2.tar.xz" - sha256: "3d3fb3f888a5b16c4fa7ee5214cca76348afd6130e8443de5f6f2424f2076a49" - "4.8.1": - url: "https://github.com/ccache/ccache/releases/download/v4.8.1/ccache-4.8.1.tar.xz" - sha256: "87959b6819530b3dcaeb39992f585b9fc2c7120302809741378097774919fb6f" - "4.8": - url: "https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8.tar.xz" - sha256: "b963ee3bf88d7266b8a0565e4ba685d5666357f0a7e364ed98adb0dc1191fcbb" - "4.7.4": - url: "https://github.com/ccache/ccache/releases/download/v4.7.4/ccache-4.7.4.tar.xz" - sha256: "df0c64d15d3efaf0b4f6837dd6b1467e40eeaaa807db25ce79c3a08a46a84e36" -patches: - "4.9.1": - - patch_file: "patches/4.9-cmake-msvc-runtime.patch" - patch_description: "fixup MSVC runtime" - patch_type: "conan" - "4.9": - - patch_file: "patches/4.9-cmake-msvc-runtime.patch" - patch_description: "fixup MSVC runtime" - patch_type: "conan" - "4.8.3": - - patch_file: "patches/4.8-cmake-msvc-runtime.patch" - patch_description: "fixup MSVC runtime" - patch_type: "conan" - "4.8.2": - - patch_file: "patches/4.8-cmake-msvc-runtime.patch" - patch_description: "fixup MSVC runtime" - patch_type: "conan" - "4.8.1": - - 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/conanfile.py b/recipes/ccache/all/conanfile.py index 8234bde469ffe..8eb6bcbaa6c38 100644 --- a/recipes/ccache/all/conanfile.py +++ b/recipes/ccache/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps from conan.errors import ConanInvalidConfiguration -from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches +from conan.tools.files import copy, get from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.microsoft import check_min_vs, is_msvc @@ -12,6 +12,7 @@ class CcacheConan(ConanFile): name = "ccache" + package_type = "application" description = ( "Ccache (or “ccache”) is a compiler cache. It speeds up recompilation " "by caching previous compilations and detecting when the same " @@ -41,9 +42,6 @@ def _compilers_minimum_version(self): "apple-clang": "11", } - def export_sources(self): - export_conandata_patches(self) - def layout(self): cmake_layout(self, src_folder="src") @@ -52,6 +50,10 @@ def requirements(self): if self.options.redis_storage_backend: self.requires("hiredis/1.1.0") + if Version(self.version) >= "4.10": + self.requires("fmt/10.2.1") + self.requires("xxhash/[~0.8]") + def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) @@ -66,12 +68,15 @@ def validate(self): self.settings.compiler.libcxx == "libstdc++": raise ConanInvalidConfiguration(f"{self.ref} requires C++ filesystem library, that is not supported by Clang 11 + libstdc++.") + if self.settings.os == "Windows" and self.settings.arch == "armv8" and Version(self.version) < "4.10": + raise ConanInvalidConfiguration("ccache does not support ARMv8 on Windows before version 4.10") + def build_requirements(self): self.tool_requires("cmake/[>=3.15 <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], destination=self.source_folder, + strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -80,17 +85,26 @@ def generate(self): tc.variables["ZSTD_FROM_INTERNET"] = False tc.variables["ENABLE_DOCUMENTATION"] = False tc.variables["ENABLE_TESTING"] = False + tc.variables["STATIC_LINK"] = False # Don't link static runtimes and let Conan handle it tc.generate() deps = CMakeDeps(self) - deps.set_property("hiredis", "cmake_target_name", "HIREDIS::HIREDIS") - deps.set_property("hiredis", "cmake_find_mode", "module") - deps.set_property("zstd", "cmake_target_name", "ZSTD::ZSTD") + if Version(self.version) >= "4.10": + deps.set_property("fmt", "cmake_file_name", "Fmt") + deps.set_property("fmt", "cmake_find_mode", "module") + deps.set_property("fmt", "cmake_target_name", "dep_fmt") + deps.set_property("zstd", "cmake_file_name", "Zstd") + deps.set_property("zstd", "cmake_target_name", "dep_zstd") + deps.set_property("hiredis", "cmake_file_name", "Hiredis") + deps.set_property("hiredis", "cmake_target_name", "dep_hiredis") + else: + deps.set_property("hiredis", "cmake_target_name", "HIREDIS::HIREDIS") + deps.set_property("zstd", "cmake_target_name", "ZSTD::ZSTD") deps.set_property("zstd", "cmake_find_mode", "module") + deps.set_property("hiredis", "cmake_find_mode", "module") deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -101,7 +115,9 @@ def package(self): cmake.install() def package_info(self): + self.cpp_info.libdirs = [] + 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) - self.cpp_info.includedirs = [] diff --git a/recipes/ccache/all/patches/4.7.4-cmake-msvc-runtime.patch b/recipes/ccache/all/patches/4.7.4-cmake-msvc-runtime.patch deleted file mode 100644 index 0bc4c5ce8f995..0000000000000 --- a/recipes/ccache/all/patches/4.7.4-cmake-msvc-runtime.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -97,7 +97,7 @@ - - # Link MSVC runtime statically. - if(MSVC) -- set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") -+ - # Link MINGW runtime statically. - elseif(WIN32) - if((CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR (CMAKE_CXX_COMPILER_ID STREQUAL Clang)) 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 deleted file mode 100644 index f55e169ebc167..0000000000000 --- a/recipes/ccache/all/patches/4.7.4-use-intrinsics-if-msbuild.patch +++ /dev/null @@ -1,34 +0,0 @@ -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/ccache/all/patches/4.8-cmake-msvc-runtime.patch b/recipes/ccache/all/patches/4.8-cmake-msvc-runtime.patch deleted file mode 100644 index 0bc4c5ce8f995..0000000000000 --- a/recipes/ccache/all/patches/4.8-cmake-msvc-runtime.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -97,7 +97,7 @@ - - # Link MSVC runtime statically. - if(MSVC) -- set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") -+ - # Link MINGW runtime statically. - elseif(WIN32) - if((CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR (CMAKE_CXX_COMPILER_ID STREQUAL Clang)) diff --git a/recipes/ccache/all/patches/4.9-cmake-msvc-runtime.patch b/recipes/ccache/all/patches/4.9-cmake-msvc-runtime.patch deleted file mode 100644 index c0aa5be876cb8..0000000000000 --- a/recipes/ccache/all/patches/4.9-cmake-msvc-runtime.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- cmake/StaticLinkSupport.cmake -+++ cmake/StaticLinkSupport.cmake -@@ -18,7 +18,7 @@ - if(WIN32) - # Link MSVC runtime statically. - if(MSVC) -- set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") -+ - # Link MINGW runtime statically. - else() - if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang)\$") diff --git a/recipes/ccache/config.yml b/recipes/ccache/config.yml index c3b3ce18a0b2b..5a505084d4b8c 100644 --- a/recipes/ccache/config.yml +++ b/recipes/ccache/config.yml @@ -1,15 +1,7 @@ versions: - "4.9.1": + "4.10": folder: all - "4.9": + "4.9.1": folder: all "4.8.3": folder: all - "4.8.2": - folder: all - "4.8.1": - folder: all - "4.8": - folder: all - "4.7.4": - folder: all diff --git a/recipes/cctag/all/conandata.yml b/recipes/cctag/all/conandata.yml index 13ba480ba9f39..1f24a6339e1f2 100644 --- a/recipes/cctag/all/conandata.yml +++ b/recipes/cctag/all/conandata.yml @@ -1,9 +1,26 @@ sources: + "1.0.3": + url: "https://github.com/alicevision/CCTag/archive/refs/tags/v1.0.3.tar.gz" + sha256: "25396b03c4aa3c1be241a2a8518a29511cb4fff695caa5126203fbba8e8e444d" "1.0.1": url: "https://github.com/alicevision/CCTag/archive/refs/tags/v1.0.1.tar.gz" sha256: "ae8a819bc978eb13bb1061a204c214da835e56c9b7dc775237ed6b2191011dec" patches: + "1.0.3": + - patch_file: "patches/1.0.3-0001-honor-vc-runtime.patch" + patch_description: "Honor vc runtime" + patch_type: "conan" + - patch_file: "patches/1.0.3-0002-fix-boost-deprecated-includes.patch" + patch_description: "Fix deprecated Boost includes" + patch_type: "portability" "1.0.1": - - patch_file: "patches/0001-honor-vc-runtime.patch" + - patch_file: "patches/1.0.1-0001-honor-vc-runtime.patch" patch_description: "Honor vc runtime" patch_type: "conan" + - patch_file: "patches/1.0.3-0002-fix-boost-deprecated-includes.patch" + patch_description: "Fix deprecated Boost includes" + patch_type: "portability" + - patch_file: "patches/1.0.1-0002-fix-missing-define.patch" + patch_description: "Add missing _GNU_SOURCE define" + patch_type: "bugfix" + patch_source: "https://github.com/alicevision/CCTag/commit/b49d710ab6870a865c20c943a65bd6dca906a184" diff --git a/recipes/cctag/all/conanfile.py b/recipes/cctag/all/conanfile.py index 773c86527b19a..8d249cbcf72c9 100644 --- a/recipes/cctag/all/conanfile.py +++ b/recipes/cctag/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir from conan.tools.microsoft import is_msvc_static_runtime +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -18,6 +19,7 @@ class CCTagConan(ConanFile): homepage = "https://github.com/alicevision/CCTag" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,6 +28,7 @@ class CCTagConan(ConanFile): "visual_debug": [True, False], "no_cout": [True, False], "with_cuda": [True, False], + "cuda_cc_list": [None, "ANY"], } default_options = { "shared": False, @@ -34,6 +37,7 @@ class CCTagConan(ConanFile): "visual_debug": False, "no_cout": True, "with_cuda": False, + "cuda_cc_list": None, # e.g. "5.2;7.5;8.2", builds all up to 7.5 by default } def export_sources(self): @@ -47,14 +51,21 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def package_id(self): + if not self.info.options.with_cuda: + del self.info.options.cuda_cc_list + def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.80.0") - self.requires("eigen/3.4.0") - self.requires("onetbb/2020.3") - self.requires("opencv/4.5.5") + self.requires("boost/1.84.0", transitive_headers=True, transitive_libs=True) + self.requires("eigen/3.4.0", transitive_headers=True) + if Version(self.version) >= "1.0.3": + self.requires("onetbb/2021.10.0") + else: + self.requires("onetbb/2020.3.3") + self.requires("opencv/4.9.0", transitive_headers=True, transitive_libs=True) @property def _required_boost_components(self): @@ -64,27 +75,22 @@ def _required_boost_components(self): ] def validate(self): - miss_boost_required_comp = \ - any(getattr(self.dependencies["boost"].options, - f"without_{boost_comp}", - True) for boost_comp in self._required_boost_components) + miss_boost_required_comp = any( + self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True) + for boost_comp in self._required_boost_components + ) if self.dependencies["boost"].options.header_only or miss_boost_required_comp: raise ConanInvalidConfiguration( f"{self.ref} requires non header-only boost with these components: " f"{', '.join(self._required_boost_components)}", ) - if self.settings.compiler == "Visual Studio" and not self.options.shared and \ - is_msvc_static_runtime(self) and self.dependencies["onetbb"].options.shared: + if is_msvc_static_runtime(self) and not self.options.shared and self.dependencies["onetbb"].options.shared: raise ConanInvalidConfiguration("this specific configuration is prevented due to internal c3i limitations") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 14) - # FIXME: add cuda support - if self.options.with_cuda: - raise ConanInvalidConfiguration("CUDA not supported yet") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -93,16 +99,18 @@ def generate(self): tc.variables["CCTAG_SERIALIZE"] = self.options.serialize tc.variables["CCTAG_VISUAL_DEBUG"] = self.options.visual_debug tc.variables["CCTAG_NO_COUT"] = self.options.no_cout - tc.variables["CCTAG_WITH_CUDA"] = self.options.with_cuda tc.variables["CCTAG_BUILD_APPS"] = False - tc.variables["CCTAG_CUDA_CC_CURRENT_ONLY"] = False - tc.variables["CCTAG_NVCC_WARNINGS"] = False tc.variables["CCTAG_EIGEN_NO_ALIGN"] = True tc.variables["CCTAG_USE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) tc.variables["CCTAG_ENABLE_SIMD_AVX2"] = False tc.variables["CCTAG_BUILD_TESTS"] = False tc.variables["CCTAG_BUILD_DOC"] = False - tc.variables["CCTAG_NO_THRUST_COPY_IF"] = False + + tc.variables["CCTAG_WITH_CUDA"] = self.options.with_cuda + tc.variables["CCTAG_CUDA_CC_CURRENT_ONLY"] = False + tc.variables["CCTAG_NVCC_WARNINGS"] = False + if self.options.cuda_cc_list: + tc.variables["CCTAG_CUDA_CC_LIST_INIT"] = self.options.cuda_cc_list tc.generate() deps = CMakeDeps(self) @@ -118,6 +126,10 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "${OpenCV_LIBS}", "opencv_core opencv_videoio opencv_imgproc opencv_imgcodecs") + # Remove very old CUDA compute capabilities + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CCTAG_CUDA_CC_LIST_INIT0 3.5 3.7 5.0 5.2)", + "set(CCTAG_CUDA_CC_LIST_INIT0 5.0 5.2)") def build(self): self._patch_sources() @@ -139,17 +151,31 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["dl", "pthread"]) self.cpp_info.requires = [ - "boost::atomic", "boost::chrono", "boost::date_time", "boost::exception", - "boost::filesystem", "boost::serialization", "boost::system", - "boost::thread", "boost::timer", "boost::math_c99", "eigen::eigen", - "onetbb::onetbb", "opencv::opencv_core", "opencv::opencv_videoio", - "opencv::opencv_imgproc", "opencv::opencv_imgcodecs", + "boost::atomic", + "boost::chrono", + "boost::date_time", + "boost::exception", + "boost::filesystem", + "boost::math_c99", + "boost::serialization", + "boost::system", + "boost::thread", + "boost::timer", + "eigen::eigen", + "onetbb::onetbb", + "opencv::opencv_core", + "opencv::opencv_imgcodecs", + "opencv::opencv_imgproc", + "opencv::opencv_videoio", ] if self.settings.os == "Windows": self.cpp_info.requires.append("boost::stacktrace_windbg") else: self.cpp_info.requires.append("boost::stacktrace_basic") + # CCTag links against shared CUDA runtime by default and does not use it in headers, + # so we don't need to explicitly link against it. + # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "CCTag" self.cpp_info.names["cmake_find_package_multi"] = "CCTag" diff --git a/recipes/cctag/all/patches/0001-honor-vc-runtime.patch b/recipes/cctag/all/patches/1.0.1-0001-honor-vc-runtime.patch similarity index 100% rename from recipes/cctag/all/patches/0001-honor-vc-runtime.patch rename to recipes/cctag/all/patches/1.0.1-0001-honor-vc-runtime.patch diff --git a/recipes/cctag/all/patches/1.0.1-0002-fix-missing-define.patch b/recipes/cctag/all/patches/1.0.1-0002-fix-missing-define.patch new file mode 100644 index 0000000000000..26658b4f5bbf2 --- /dev/null +++ b/recipes/cctag/all/patches/1.0.1-0002-fix-missing-define.patch @@ -0,0 +1,29 @@ +From b49d710ab6870a865c20c943a65bd6dca906a184 Mon Sep 17 00:00:00 2001 +From: Simone Gasparini +Date: Fri, 7 Oct 2022 23:37:33 +0200 +Subject: [PATCH] [cctag] add osx fix _GNU_SOURCE + +as per +https://github.com/boostorg/stacktrace/issues/88 +--- + src/cctag/utils/Exceptions.hpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/cctag/utils/Exceptions.hpp b/src/cctag/utils/Exceptions.hpp +index 1e16b9b5..46067cff 100644 +--- a/src/cctag/utils/Exceptions.hpp ++++ b/src/cctag/utils/Exceptions.hpp +@@ -7,6 +7,13 @@ + */ + #ifndef _CCTAG_EXCEPTIONS_HPP_ + #define _CCTAG_EXCEPTIONS_HPP_ ++ ++// This fix is necessary on Apple and on Windows using cygwin to avoid the compilation error ++// #error "Boost.Stacktrace requires `_Unwind_Backtrace` function. ++// see https://github.com/boostorg/stacktrace/issues/88 ++#ifndef _GNU_SOURCE ++#define _GNU_SOURCE ++#endif + + #include + #include diff --git a/recipes/cctag/all/patches/1.0.3-0001-honor-vc-runtime.patch b/recipes/cctag/all/patches/1.0.3-0001-honor-vc-runtime.patch new file mode 100644 index 0000000000000..25d94454a5b93 --- /dev/null +++ b/recipes/cctag/all/patches/1.0.3-0001-honor-vc-runtime.patch @@ -0,0 +1,20 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -41,7 +41,7 @@ + else() + message(STATUS "Building in ${CMAKE_BUILD_TYPE} configuration") + endif() +- ++if(0) + # ensure the proper linker flags when building the static version on MSVC + if(MSVC AND NOT BUILD_SHARED_LIBS) + foreach(config "DEBUG" "RELEASE" "MINSIZEREL" "RELWITHDEBINFO") +@@ -65,7 +65,7 @@ + endif() + list(APPEND CUDA_NVCC_FLAGS -Xcompiler ${CCTAG_MVSC_LINKER}) + endif() +- ++endif() + set(CCTAG_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD ${CCTAG_CXX_STANDARD}) + set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/recipes/cctag/all/patches/1.0.3-0002-fix-boost-deprecated-includes.patch b/recipes/cctag/all/patches/1.0.3-0002-fix-boost-deprecated-includes.patch new file mode 100644 index 0000000000000..503defa4a3e7e --- /dev/null +++ b/recipes/cctag/all/patches/1.0.3-0002-fix-boost-deprecated-includes.patch @@ -0,0 +1,16 @@ +Fixes "This header is deprecated. Use instead.", etc. deprecation warnings. +--- src/cctag/CCTagMarkersBank.hpp ++++ src/cctag/CCTagMarkersBank.hpp +@@ -9,9 +9,9 @@ + #define VISION_MARKER_CCTAG_MARKERS_BANK_HPP + + #include +-#include +-#include +-#include ++#include ++#include ++#include + #include + + #include diff --git a/recipes/cctag/config.yml b/recipes/cctag/config.yml index 715e55357a17b..2350f098ddd20 100644 --- a/recipes/cctag/config.yml +++ b/recipes/cctag/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.3": + folder: all "1.0.1": folder: all diff --git a/recipes/cfitsio/all/conandata.yml b/recipes/cfitsio/all/conandata.yml index 6b0480fb20585..63cc622faf8bc 100644 --- a/recipes/cfitsio/all/conandata.yml +++ b/recipes/cfitsio/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.4.0": + url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.4.0.tar.gz" + sha256: "c42bd609151c0b0d7c4f3578d425ae7aaa9afa4828cab35c0accea588e290c29" "4.3.1": url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.3.1.tar.gz" sha256: "2332b965d327a15c103a7d31d6d1afaf775d00e9785dd25332ae76b9725351e4" @@ -17,13 +20,10 @@ sources: "3.490": url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.49.tar.gz" sha256: "8cc4beddd0ff389fb81bde9c181e0e3c419c15ec8a66df201ff4619a93715558" - "3.480": - url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.48.tar.gz" - sha256: "fc369363616753fa4dbe9bf28fa7e49cc1b057081229d89b52087d85ef303314" - "3.470": - url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.47.tar.gz" - sha256: "985606e058403c073a68d95be74e9696f0ded9414520784457a1d4cba8cca7e2" patches: + "4.4.0": + - patch_file: "patches/windows-use-strtok_s.patch" + - patch_file: "patches/fix-cmake-4.2.0.patch" "4.3.1": - patch_file: "patches/windows-use-strtok_s.patch" - patch_file: "patches/fix-cmake-4.2.0.patch" @@ -42,9 +42,3 @@ patches: "3.490": - patch_file: "patches/windows-use-strtok_s.patch" - patch_file: "patches/fix-cmake-3.490.patch" - "3.480": - - patch_file: "patches/windows-use-strtok_s.patch" - - patch_file: "patches/fix-cmake-3.470.patch" - "3.470": - - patch_file: "patches/windows-use-strtok_s.patch" - - patch_file: "patches/fix-cmake-3.470.patch" diff --git a/recipes/cfitsio/all/conanfile.py b/recipes/cfitsio/all/conanfile.py index 782f21cb2a73b..e2f5688059f62 100644 --- a/recipes/cfitsio/all/conanfile.py +++ b/recipes/cfitsio/all/conanfile.py @@ -1,9 +1,10 @@ +import glob +import os + from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm import Version -import glob -import os required_conan_version = ">=1.54.0" @@ -12,7 +13,7 @@ class CfitsioConan(ConanFile): name = "cfitsio" description = "C library for reading and writing data files in FITS " \ "(Flexible Image Transport System) data format" - license = "CFITSIO" + license = ("CFITSIO", "NASA-1.3") topics = ("fits", "image", "nasa", "astronomy", "astrophysics", "space") homepage = "https://heasarc.gsfc.nasa.gov/fitsio/" url = "https://github.com/conan-io/conan-center-index" @@ -104,7 +105,11 @@ def build(self): cmake.build() def package(self): - copy(self, "License.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) >= "4.4.0": + copy(self, "NASA*", src=os.path.join(self.source_folder, "licenses"), + dst=os.path.join(self.package_folder, "licenses")) + else: + 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", "pkgconfig")) diff --git a/recipes/cfitsio/all/patches/fix-cmake-3.470.patch b/recipes/cfitsio/all/patches/fix-cmake-3.470.patch deleted file mode 100644 index 46df9c1140c70..0000000000000 --- a/recipes/cfitsio/all/patches/fix-cmake-3.470.patch +++ /dev/null @@ -1,223 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -3,8 +3,8 @@ - # Suppress warning about WIN32 no longer being defined on Cygwin: - SET(CMAKE_LEGACY_CYGWIN_WIN32 0) - -+CMAKE_MINIMUM_REQUIRED(VERSION 3.1) - PROJECT(CFITSIO) --CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) - - # Allow @rpath token in target install name on Macs. - # See "cmake --help-policy CMP0042" for more information. -@@ -12,12 +12,14 @@ IF(POLICY CMP0042) - CMAKE_POLICY(SET CMP0042 NEW) - ENDIF() - --INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) --INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) -+INCLUDE(CheckSymbolExists) -+INCLUDE(CheckCSourceCompiles) - - # Allow the developer to select if Dynamic or Static libraries are built - OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" ON) - OPTION (USE_PTHREADS "Thread-safe build (using pthreads)" OFF) -+OPTION(CFITSIO_USE_SSE2 "Enable use of instructions in the SSE2 extended instruction set" OFF) -+OPTION(CFITSIO_USE_SSSE3 "Enable use of instructions in the SSSE3 extended instruction set" OFF) - - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}") - set (LIB_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") -@@ -55,12 +57,19 @@ IF (BUILD_SHARED_LIBS) - ENDIF (BUILD_SHARED_LIBS) - - --FILE(GLOB H_FILES "*.h") -+SET(H_FILES fitsio.h fitsio2.h longnam.h) -+SET(LINK_LIBS "") - - IF (USE_PTHREADS) -- FIND_PACKAGE(pthreads REQUIRED) -- INCLUDE_DIRECTORIES(${PTHREADS_INCLUDE_DIR}) -- ADD_DEFINITIONS(-D_REENTRANT) -+ SET(CMAKE_THREAD_PREFER_PTHREAD TRUE) -+ SET(THREADS_PREFER_PTHREAD_FLAG TRUE) -+ FIND_PACKAGE(Threads REQUIRED) -+ IF(CMAKE_USE_PTHREADS_INIT) -+ LIST(APPEND LINK_LIBS "Threads::Threads") -+ ELSE() -+ find_package(pthreads4w REQUIRED CONFIG) -+ LIST(APPEND LINK_LIBS "pthreads4w::pthreads4w") -+ ENDIF() - ENDIF() - - # Math library (not available in MSVC or MINGW) -@@ -71,35 +80,36 @@ ELSE() - ENDIF() - - # Support for remote file drivers is not implemented for native Windows: --IF (NOT MSVC) -+IF (NOT WIN32) - # Find library needed for gethostbyname: -- CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME) -- IF(NOT CMAKE_HAVE_GETHOSTBYNAME) -- CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_HAVE_GETHOSTBYNAME) -- ENDIF() -+ CHECK_SYMBOL_EXISTS(gethostbyname "netdb.h" CMAKE_HAVE_GETHOSTBYNAME) - - # Find library needed for connect: -- CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT) -- IF(NOT CMAKE_HAVE_CONNECT) -- CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_HAVE_CONNECT) -- ENDIF() -+ CHECK_SYMBOL_EXISTS(connect "sys/types.h;sys/socket.h" CMAKE_HAVE_CONNECT) - - # Define HAVE_NET_SERVICES if gethostbyname & connect were found: - IF (CMAKE_HAVE_GETHOSTBYNAME AND CMAKE_HAVE_CONNECT) - ADD_DEFINITIONS(-DHAVE_NET_SERVICES) -+ CHECK_SYMBOL_EXISTS(fmemopen "stdio.h" HAVE_FMEMOPEN) -+ IF(HAVE_FMEMOPEN) -+ ADD_DEFINITIONS(-DHAVE_FMEMOPEN) -+ ENDIF() - ENDIF () - - # Find curl library, for HTTPS support: -- FIND_PACKAGE(CURL) -- IF (CURL_FOUND) -- INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR}) -- ADD_DEFINITIONS(-DCFITSIO_HAVE_CURL) -+ OPTION(UseCurl "UseCurl" ON) -+ IF (UseCurl) -+ FIND_PACKAGE(CURL) -+ IF (CURL_FOUND) -+ LIST(APPEND LINK_LIBS "CURL::libcurl") -+ ADD_DEFINITIONS(-DCFITSIO_HAVE_CURL) -+ ENDIF() - ENDIF() - ENDIF() - - SET(SRC_FILES - buffers.c cfileio.c checksum.c -- drvrfile.c drvrmem.c drvrnet.c -+ drvrfile.c drvrmem.c drvrnet.c drvrsmem.c - editcol.c edithdu.c eval_f.c eval_l.c eval_y.c - f77_wrap1.c f77_wrap2.c f77_wrap3.c f77_wrap4.c - fits_hcompress.c fits_hdecompress.c fitscore.c -@@ -123,27 +133,99 @@ SET(SRC_FILES - - # Only include zlib source files if we are building a shared library. - # Users will need to link their executable with zlib independently. --IF (BUILD_SHARED_LIBS) -- set(SRC_FILES ${SRC_FILES} -- zlib/adler32.c zlib/crc32.c zlib/deflate.c zlib/infback.c -- zlib/inffast.c zlib/inflate.c zlib/inftrees.c zlib/trees.c -- zlib/uncompr.c zlib/zutil.c -- ) -+find_package(ZLIB REQUIRED) -+LIST(APPEND LINK_LIBS "ZLIB::ZLIB") -+ -+IF(CFITSIO_USE_SSE2) -+ IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR -+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR -+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") -+ ADD_COMPILE_OPTIONS(-msse2) -+ ENDIF() -+ IF(MSVC) -+ ADD_DEFINITIONS(-D__SSE2__=1) -+ ENDIF() -+ENDIF() -+ -+IF(CFITSIO_USE_SSSE3) -+ IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR -+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR -+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") -+ ADD_COMPILE_OPTIONS(-mssse3) -+ ENDIF() -+ IF(MSVC) -+ ADD_DEFINITIONS(-D__SSE2__=1 -D__SSSE3__=1) -+ ENDIF() -+ENDIF() -+ -+OPTION(CFITSIO_USE_BZIP2 "Enable bzip2 support" OFF) -+IF(CFITSIO_USE_BZIP2) -+ FIND_PACKAGE(BZip2 REQUIRED) -+ LIST(APPEND LINK_LIBS "BZip2::BZip2") -+ ADD_DEFINITIONS(-DHAVE_BZIP2=1) -+ENDIF() -+ -+# Test for the unix ftruncate function -+CHECK_SYMBOL_EXISTS(ftruncate "unistd.h" HAVE_FTRUNCATE) -+IF(HAVE_FTRUNCATE) -+ ADD_DEFINITIONS(-DHAVE_FTRUNCATE) -+ENDIF() -+ -+# Check is System V IPC is supported on this machine -+CHECK_C_SOURCE_COMPILES(" -+#include -+#include -+#include -+int main() { -+ shmat(0,0,0); -+ shmdt(0); -+ shmget(0, 0, 0); -+ semget(0, 0, 0); -+ return 0; -+}" HAVE_SHMEM_SERVICES) -+IF(HAVE_SHMEM_SERVICES) -+ ADD_DEFINITIONS(-DHAVE_SHMEM_SERVICES) -+ -+ # Some systems define flock_t, for others we have to define it ourselves -+ CHECK_C_SOURCE_COMPILES(" -+ #include -+ int main() { -+ flock_t filler; -+ return 0; -+ }" HAVE_FLOCK_T) -+ IF(HAVE_FLOCK_T) -+ ADD_DEFINITIONS(-DHAVE_FLOCK_T) -+ ENDIF() -+ -+ # Check union semun -+ CHECK_C_SOURCE_COMPILES(" -+ #include -+ #include -+ #include -+ int main() { -+ union semun filler; -+ return 0; -+ }" HAVE_UNION_SEMUN) -+ IF(HAVE_UNION_SEMUN) -+ ADD_DEFINITIONS(-DHAVE_UNION_SEMUN) -+ ENDIF() - ENDIF() - - ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${H_FILES} ${SRC_FILES}) --TARGET_LINK_LIBRARIES(${LIB_NAME} ${PTHREADS_LIBRARY} ${M_LIB} ${CURL_LIBRARIES}) -+TARGET_LINK_LIBRARIES(${LIB_NAME} ${LINK_LIBS} ${M_LIB}) -+if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "12") -+ TARGET_COMPILE_OPTIONS(${LIB_NAME} PRIVATE -Wno-error=implicit-function-declaration) -+endif() - - SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION} SOVERSION ${${PROJECT_NAME}_MAJOR_VERSION}) --install(TARGETS ${LIB_NAME} DESTINATION ${LIB_DESTINATION}) - install(TARGETS ${LIB_NAME} - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) - install(FILES ${H_FILES} DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel) - --# Only build test code and executables if building a shared library: --IF (BUILD_SHARED_LIBS) -+# Do not build test code and executables: -+IF (FALSE) - - ENABLE_TESTING() - -@@ -173,7 +255,7 @@ IF (BUILD_SHARED_LIBS) - set_target_properties(FPack Funpack PROPERTIES LINK_FLAGS "setargv.obj") - endif(MSVC) - --ENDIF(BUILD_SHARED_LIBS) -+ENDIF() - - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cfitsio.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/cfitsio.pc @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cfitsio.pc DESTINATION lib/pkgconfig/) diff --git a/recipes/cfitsio/config.yml b/recipes/cfitsio/config.yml index 644678fbd04e4..bfb174dc329f7 100644 --- a/recipes/cfitsio/config.yml +++ b/recipes/cfitsio/config.yml @@ -1,4 +1,6 @@ versions: + "4.4.0": + folder: all "4.3.1": folder: all "4.3.0": @@ -11,7 +13,3 @@ versions: folder: all "3.490": folder: all - "3.480": - folder: all - "3.470": - folder: all diff --git a/recipes/chunkio/all/conandata.yml b/recipes/chunkio/all/conandata.yml index 0ec309fb48a89..0996c6fec0b7e 100644 --- a/recipes/chunkio/all/conandata.yml +++ b/recipes/chunkio/all/conandata.yml @@ -1,8 +1,18 @@ sources: + "1.5.2": + url: "https://github.com/fluent/chunkio/archive/refs/tags/v1.5.2.tar.gz" + sha256: "c73e809215454c34a79ed2a7d38abc6058da99dad8564de85e2919100fb987a5" "1.1.6": - url: "https://github.com/edsiper/chunkio/archive/refs/tags/v1.1.6.tar.gz" + url: "https://github.com/fluent/chunkio/archive/refs/tags/v1.1.6.tar.gz" sha256: "755dda0b8ccf6f5ff804b2c1a3caa938bae7b0f37d73afa12c1bf1fab4fd4c86" patches: + "1.5.2": + - patch_file: "patches/1.5.2-0001-add-installer.patch" + patch_description: "add installer" + patch_type: "conan" + - patch_file: "patches/1.1.6-0003-disable-pic.patch" + patch_description: "disable pic on static build" + patch_type: "portability" "1.1.6": - patch_file: "patches/1.1.6-0001-add-installer.patch" patch_description: "add installer" diff --git a/recipes/chunkio/all/conanfile.py b/recipes/chunkio/all/conanfile.py index a32c30c04b01b..730b6cde7d240 100644 --- a/recipes/chunkio/all/conanfile.py +++ b/recipes/chunkio/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -10,7 +11,7 @@ class ChunkIOConan(ConanFile): description = "Simple library to manage chunks of data in memory and file system" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/edsiper/chunkio" + homepage = "https://github.com/fluent/chunkio" topics = ("chunk", "io", "memory", "file") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -70,3 +71,5 @@ def package_info(self): self.cpp_info.libs = ["chunkio-shared"] if self.options.shared else ["chunkio-static", "cio-crc32"] if self.settings.os == "Windows": self.cpp_info.system_libs.append("shlwapi") + if Version(self.version) >= "1.5.0": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/chunkio/all/patches/1.5.2-0001-add-installer.patch b/recipes/chunkio/all/patches/1.5.2-0001-add-installer.patch new file mode 100644 index 0000000000000..6e02f8052fa98 --- /dev/null +++ b/recipes/chunkio/all/patches/1.5.2-0001-add-installer.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dbc7d48..a3810a5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -118,10 +118,15 @@ include_directories( + + add_subdirectory(deps/crc32) + add_subdirectory(src) +-add_subdirectory(tools) ++# add_subdirectory(tools) + + # Tests + if(CIO_TESTS) + enable_testing() + add_subdirectory(tests) + endif() ++ ++include(GNUInstallDirs) ++install(FILES ${PROJECT_BINARY_DIR}/include/chunkio/cio_info.h ${PROJECT_BINARY_DIR}/include/chunkio/cio_version.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/chunkio) ++install(DIRECTORY include/chunkio DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PATTERN "*.in" EXCLUDE) ++install(DIRECTORY deps/monkey/include/monkey DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +diff --git a/deps/crc32/CMakeLists.txt b/deps/crc32/CMakeLists.txt +index 8ae1823..0b7dba0 100644 +--- a/deps/crc32/CMakeLists.txt ++++ b/deps/crc32/CMakeLists.txt +@@ -3,3 +3,12 @@ set(src + ) + + add_library(cio-crc32 STATIC ${src}) ++ ++if(CIO_LIB_STATIC) ++ include(GNUInstallDirs) ++ install( ++ TARGETS cio-crc32 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index bb52273..b6e37b1 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -51,3 +51,22 @@ endif() + if (NOT CIO_LIB_STATIC AND NOT CIO_LIB_SHARED) + message(FATAL_ERROR "What are you doing?, you should build something") + endif() ++ ++include(GNUInstallDirs) ++ ++if(CIO_LIB_STATIC) ++ install( ++ TARGETS chunkio-static ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() ++ ++if(CIO_LIB_SHARED) ++ install( ++ TARGETS chunkio-shared ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() diff --git a/recipes/chunkio/all/test_package/CMakeLists.txt b/recipes/chunkio/all/test_package/CMakeLists.txt index 145508da160d2..b429e0efccdb7 100644 --- a/recipes/chunkio/all/test_package/CMakeLists.txt +++ b/recipes/chunkio/all/test_package/CMakeLists.txt @@ -3,5 +3,9 @@ project(test_package LANGUAGES C) find_package(chunkio REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.c) +if(chunkio_VERSION VERSION_LESS "1.5.0") + add_executable(${PROJECT_NAME} test_package.c) +else() + add_executable(${PROJECT_NAME} test_package_1_5_0.c) +endif() target_link_libraries(${PROJECT_NAME} PRIVATE chunkio::chunkio) diff --git a/recipes/chunkio/all/test_package/test_package_1_5_0.c b/recipes/chunkio/all/test_package/test_package_1_5_0.c new file mode 100644 index 0000000000000..ebbc2de6796ec --- /dev/null +++ b/recipes/chunkio/all/test_package/test_package_1_5_0.c @@ -0,0 +1,23 @@ +#include "chunkio/chunkio.h" +#include + +static int log_cb(struct cio_ctx *ctx, int level, const char *file, int line, + char *str) +{ + (void) ctx; + + printf("[cio-test-fs] %-60s => %s:%i\n", str, file, line); + return 0; +} + +int main() { + struct cio_options options; + cio_options_init(&options); + options.flags = CIO_CHECKSUM; + options.log_level = CIO_LOG_INFO; + struct cio_ctx *ctx = cio_create(&options); + + cio_destroy(ctx); + + return 0; +} diff --git a/recipes/chunkio/config.yml b/recipes/chunkio/config.yml index 98af2724bf2b9..2ac2738283086 100644 --- a/recipes/chunkio/config.yml +++ b/recipes/chunkio/config.yml @@ -1,3 +1,5 @@ versions: + "1.5.2": + folder: "all" "1.1.6": folder: "all" diff --git a/recipes/cista/all/conandata.yml b/recipes/cista/all/conandata.yml index dddca09a6246d..02747f36f74ac 100644 --- a/recipes/cista/all/conandata.yml +++ b/recipes/cista/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "0.15": + - url: "https://github.com/felixguendling/cista/releases/download/v0.15/cista.h" + sha256: "45685fde5c5ef576ad821c4db7f01e375eb2668aa6dafd6b9627fe58ce0641eb" + - url: "https://raw.githubusercontent.com/felixguendling/cista/v0.15/LICENSE" + sha256: "fcd47e35fd6dc22feec454c5c1e572ccb7587dedd91d824528ebbb00a7f37c56" "0.14": - url: "https://github.com/felixguendling/cista/releases/download/v0.14/cista.h" sha256: "078933804966439ae105a6a748aa027a2f197351d735712b1efca0453340562d" diff --git a/recipes/cista/config.yml b/recipes/cista/config.yml index 4390251f71953..205c7eaece71d 100644 --- a/recipes/cista/config.yml +++ b/recipes/cista/config.yml @@ -1,4 +1,6 @@ versions: + "0.15": + folder: all "0.14": folder: all "0.11": diff --git a/recipes/civetweb/all/conanfile.py b/recipes/civetweb/all/conanfile.py index b393da542821b..d7ccad2b88226 100644 --- a/recipes/civetweb/all/conanfile.py +++ b/recipes/civetweb/all/conanfile.py @@ -22,6 +22,7 @@ class CivetwebConan(ConanFile): "fPIC": [True, False], "shared": [True, False], "ssl_dynamic_loading": [True, False], + "thread_stack_size": [None, "ANY"], "with_caching": [True, False], "with_cgi": [True, False], "with_cxx": [True, False], @@ -39,6 +40,7 @@ class CivetwebConan(ConanFile): "fPIC": True, "shared": False, "ssl_dynamic_loading": False, + "thread_stack_size": None, "with_caching": True, "with_cgi": True, "with_cxx": True, @@ -92,6 +94,8 @@ def requirements(self): def validate(self): if self.options.get_safe("ssl_dynamic_loading") and not self.dependencies["openssl"].options.shared: raise ConanInvalidConfiguration("ssl_dynamic_loading requires shared openssl") + if self.options.thread_stack_size and not str(self.options.thread_stack_size).isdigit(): + raise ConanInvalidConfiguration("-o='civetweb/*:thread_stack_size' should be a positive integer") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -122,6 +126,8 @@ def generate(self): tc.variables["CIVETWEB_ENABLE_THIRD_PARTY_OUTPUT"] = self.options.with_third_party_output tc.variables["CIVETWEB_ENABLE_WEBSOCKETS"] = self.options.with_websockets tc.variables["CIVETWEB_SERVE_NO_FILES"] = not self.options.with_static_files + if self.options.thread_stack_size: + tc.variables["CIVETWEB_THREAD_STACK_SIZE"] = self.options.thread_stack_size if self._has_zlib_option: tc.variables["CIVETWEB_ENABLE_ZLIB"] = self.options.with_zlib diff --git a/recipes/cjson/all/conandata.yml b/recipes/cjson/all/conandata.yml index 98903aa382fd7..32c4ecff90851 100644 --- a/recipes/cjson/all/conandata.yml +++ b/recipes/cjson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.7.18": + url: "https://github.com/DaveGamble/cJSON/archive/v1.7.18.tar.gz" + sha256: "3aa806844a03442c00769b83e99970be70fbef03735ff898f4811dd03b9f5ee5" "1.7.17": url: "https://github.com/DaveGamble/cJSON/archive/v1.7.17.tar.gz" sha256: "c91d1eeb7175c50d49f6ba2a25e69b46bd05cffb798382c19bfb202e467ec51c" diff --git a/recipes/cjson/all/conanfile.py b/recipes/cjson/all/conanfile.py index e715bfc8ad197..84820348d6401 100644 --- a/recipes/cjson/all/conanfile.py +++ b/recipes/cjson/all/conanfile.py @@ -13,12 +13,11 @@ class CjsonConan(ConanFile): name = "cjson" description = "Ultralightweight JSON parser in ANSI C." license = "MIT" - topics = ("json", "parser") - homepage = "https://github.com/DaveGamble/cJSON" url = "https://github.com/conan-io/conan-center-index" - - package_type = "library" + homepage = "https://github.com/DaveGamble/cJSON" + topics = ("json", "parser") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], diff --git a/recipes/cjson/config.yml b/recipes/cjson/config.yml index 8dc9df22965bb..08843263806b5 100644 --- a/recipes/cjson/config.yml +++ b/recipes/cjson/config.yml @@ -1,4 +1,6 @@ versions: + "1.7.18": + folder: all "1.7.17": folder: all "1.7.16": diff --git a/recipes/cli11/all/conandata.yml b/recipes/cli11/all/conandata.yml index f6711af51ec3a..0202c83c31a52 100644 --- a/recipes/cli11/all/conandata.yml +++ b/recipes/cli11/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.2": + url: "https://github.com/CLIUtils/CLI11/archive/v2.4.2.tar.gz" + sha256: "f2d893a65c3b1324c50d4e682c0cdc021dd0477ae2c048544f39eed6654b699a" "2.4.1": url: "https://github.com/CLIUtils/CLI11/archive/v2.4.1.tar.gz" sha256: "73b7ec52261ce8fe980a29df6b4ceb66243bb0b779451dbd3d014cfec9fdbb58" diff --git a/recipes/cli11/config.yml b/recipes/cli11/config.yml index 29883272197c4..fc84730ec9afc 100644 --- a/recipes/cli11/config.yml +++ b/recipes/cli11/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.2": + folder: all "2.4.1": folder: all "2.4.0": diff --git a/recipes/clove-unit/all/conandata.yml b/recipes/clove-unit/all/conandata.yml index b80516fa1a975..1377a0bac8c05 100644 --- a/recipes/clove-unit/all/conandata.yml +++ b/recipes/clove-unit/all/conandata.yml @@ -1,16 +1,22 @@ sources: + "2.4.5": + url: "https://github.com/fdefelici/clove-unit/archive/v2.4.5.tar.gz" + sha256: "e4db72612adf00d7c7c9512cb9990768f5f3e62a72039929b78ba17d5a6f4308" + "2.4.4": + url: "https://github.com/fdefelici/clove-unit/archive/v2.4.4.tar.gz" + sha256: "25e611e1d4286c73d9cce7bbc99f83e00629551602351fec1edcbb669243e047" "2.4.1": url: "https://github.com/fdefelici/clove-unit/archive/v2.4.1.tar.gz" - sha256: ede833e361b5b62052bd0976386307d1d962c7ab20a0e24eb6e970d409c726fe + sha256: "ede833e361b5b62052bd0976386307d1d962c7ab20a0e24eb6e970d409c726fe" "2.4.0": url: "https://github.com/fdefelici/clove-unit/archive/v2.4.0.tar.gz" - sha256: d5005854d7b3b6ed1b470c2df353fadd80a2ed5a80bb85efc074b9d55315e78d + sha256: "d5005854d7b3b6ed1b470c2df353fadd80a2ed5a80bb85efc074b9d55315e78d" "2.3.0": url: "https://github.com/fdefelici/clove-unit/archive/v2.3.0.tar.gz" - sha256: ca94d33643bbe1ff2205f7e6405f3e9c5a95d2f3a076a126814e64b46e3cce8e + sha256: "ca94d33643bbe1ff2205f7e6405f3e9c5a95d2f3a076a126814e64b46e3cce8e" "2.2.4": url: "https://github.com/fdefelici/clove-unit/archive/v2.2.4.tar.gz" - sha256: 0341f13b3e897952f1643eea2ca70cf014c4a086cf83375270980ac05f9d51aa + sha256: "0341f13b3e897952f1643eea2ca70cf014c4a086cf83375270980ac05f9d51aa" "2.2.3": url: "https://github.com/fdefelici/clove-unit/archive/v2.2.3.tar.gz" - sha256: 65f80d600ddec35f7ba70370f10e2df268d68c589e5cddbdcad815b6dbb61dfd + sha256: "65f80d600ddec35f7ba70370f10e2df268d68c589e5cddbdcad815b6dbb61dfd" diff --git a/recipes/clove-unit/all/conanfile.py b/recipes/clove-unit/all/conanfile.py index 630528ab512d9..3e530c191a833 100644 --- a/recipes/clove-unit/all/conanfile.py +++ b/recipes/clove-unit/all/conanfile.py @@ -8,13 +8,14 @@ class CloveUnitConan(ConanFile): name = "clove-unit" description = "Single-header Unit Testing framework for C (interoperable with C++) with test autodiscovery feature" - topics = ("unit-testing", "testing", "unit testing", "test") + license = "MIT" homepage = "https://github.com/fdefelici/clove-unit" url = "https://github.com/conan-io/conan-center-index" - license = "MIT" + topics = ("unit-testing", "testing", "unit testing", "test", "header-only") no_copy_source = True package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True def layout(self): basic_layout(self, src_folder="src") diff --git a/recipes/clove-unit/config.yml b/recipes/clove-unit/config.yml index e5228fd78f381..fd769a0869f29 100644 --- a/recipes/clove-unit/config.yml +++ b/recipes/clove-unit/config.yml @@ -1,4 +1,8 @@ versions: + "2.4.5": + folder: "all" + "2.4.4": + folder: "all" "2.4.1": folder: "all" "2.4.0": diff --git a/recipes/cmake/3.x.x/conanfile.py b/recipes/cmake/3.x.x/conanfile.py index f6de583315097..042191e304bd0 100644 --- a/recipes/cmake/3.x.x/conanfile.py +++ b/recipes/cmake/3.x.x/conanfile.py @@ -37,8 +37,8 @@ def config_options(self): self.options.with_openssl = False def requirements(self): - if self.options.with_openssl: - self.requires("openssl/1.1.1t") + if self.options.get_safe("with_openssl", default=False): + self.requires("openssl/[>=1.1 <4]") def validate_build(self): if self.settings.os == "Windows" and self.options.bootstrap: diff --git a/recipes/cmake/binary/conandata.yml b/recipes/cmake/binary/conandata.yml index 312a7c7d57530..cddf4c7d973c9 100644 --- a/recipes/cmake/binary/conandata.yml +++ b/recipes/cmake/binary/conandata.yml @@ -1,4 +1,175 @@ sources: + "3.30.0": + Linux: + armv8: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-linux-aarch64.tar.gz" + sha256: "3db7f12dadc91be9b30f0e5a71038c51d7f5b7cc03e32625621a052e9996bef0" + x86_64: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-linux-x86_64.tar.gz" + sha256: "09846a3858583f38189b59177586adf125a08c15f3cddcaf7d7d7081ac86969f" + Macos: + universal: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-macos10.10-universal.tar.gz" + sha256: "54f237212362efa3f192508eeb25d98f2150779ed45c46a77fe356597c3d2749" + Windows: + armv8: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-windows-arm64.zip" + sha256: "cb8fb65a8f523daa0ce6c531407ae10fcab8d0eefe18a6ef9fb718c54307d6e3" + x86_64: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-windows-x86_64.zip" + sha256: "f8d2da0eaf3bab9cf065e97bd6d8e1819886f8671d3d4c7bb93cb774123fa448" + "3.29.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-linux-aarch64.tar.gz" + sha256: "4d6b0a551db9da7a034a09372f716cf2094413d7fd8a787051854154b0b3b343" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-linux-x86_64.tar.gz" + sha256: "28fef61e64840b784da6db35218fd3ae179ff8bf0be1c8a9d075d6185a0e4fdc" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-macos10.10-universal.tar.gz" + sha256: "a65f9e66c63bb79f3b6f00e4b67367b6f6c40030ee41cf06580818a74a84b3e9" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-windows-arm64.zip" + sha256: "8f0df498d8b1a076fc9305dde5a06427262a0476e89d4c670a49147b0bc30761" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-windows-x86_64.zip" + sha256: "5c648eac06c33477e510bae14ce1f969e9abb38992b71f245633b182fccb474d" + "3.29.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-linux-aarch64.tar.gz" + sha256: "6eb655ee89c50611f2370c5a3293bd2fe1920b73dff50b71fb3357d56a9d28d8" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-linux-x86_64.tar.gz" + sha256: "92629f95e15e7c2e88726c57a984ffdc5cf248e354f7ab791bc86d2ad513903e" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-macos10.10-universal.tar.gz" + sha256: "a110d173ab839854fc0b19b9f29f213c1112106e2858c1a1fe7973d4bb13a536" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-windows-arm64.zip" + sha256: "9c67d16560125ebf1278ef1b3072914a60bff780522b28c0096f364f775a8e55" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-windows-x86_64.zip" + sha256: "f85db8361cb7eb11ceb6b2f1ee42bec7234bb8d9e487ea78c00de64771768d92" + "3.29.4": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-linux-aarch64.tar.gz" + sha256: "9210619e7907b14858178743d5b7ba70ce846d98a6a65bcdbd83c08b932ba6a5" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-linux-x86_64.tar.gz" + sha256: "64e5473169dd43055fbf2c138cae6e5ec10f30a0606d24f12078e68466320cf4" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-macos10.10-universal.tar.gz" + sha256: "44a59c584122676463bf5bdd2c7dee2ac02944e065a71cc30c57541a20d3465c" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-windows-arm64.zip" + sha256: "16ce291dd34189a60d7add96b4148adfdbb46b6b2478086cb43abe2e5ff34ad3" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-windows-x86_64.zip" + sha256: "1c8bfbc5537553edccded62f8f03475a161280c1b64f54c887824c6eb4e773ff" + "3.29.3": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-linux-aarch64.tar.gz" + sha256: "ae61d262b2771ba9cbdf1eeac288e64d6510d2f0417d2d92e27807d269ac90fa" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-linux-x86_64.tar.gz" + sha256: "90b543a30220401db0e08347af067545be158ce89ffb09b7df1516cda8617329" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-macos10.10-universal.tar.gz" + sha256: "1a7ecdd1dc8baaede55d1011f60b5871ff908fa640f7e96ab5520f38ef97bba0" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-windows-arm64.zip" + sha256: "8d7d65e46a45bdbf8b4416d29ef6ad9a80f0b26afb5d6afab358e34b1b30a556" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-windows-x86_64.zip" + sha256: "6423ed300e6aa1b15c4aeae9a7399157f53fc84a2fb7242ca64c8dfd83e5f8a6" + "3.29.2": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-linux-aarch64.tar.gz" + sha256: "ca883c6dc3ce9eebd833804f0f940ecbbff603520cfd169ee58916dbbc23c2b8" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-linux-x86_64.tar.gz" + sha256: "0416c70cf88e8f92efcbfe292e181bc09ead7d70e29ab37b697522c01121eab5" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-macos10.10-universal.tar.gz" + sha256: "0b542389345b28d2f73122b72ec9b899947e643fd86cf8f42bae2718884d2ad3" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-windows-arm64.zip" + sha256: "5b16a0db4966c04582c40131038de49d5b0161fcd950dc9e955753dfab858882" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-windows-x86_64.zip" + sha256: "86b5de51f60a0e9d62be4d8ca76ea467d154083d356fcc9af1409606be341cd8" + "3.29.0": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-linux-aarch64.tar.gz" + sha256: "2cb768a14b28a4478bb931d917dbc419305b82433bdecc046df98e7c336225fa" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-linux-x86_64.tar.gz" + sha256: "f06258f52c5649752dfb10c4c2e1d8167c760c8826f078c6f5c332fa9d976bf8" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-macos10.10-universal.tar.gz" + sha256: "868f356c56a3c35e8f39f0d4fb7e579cb2eb0ac06c26520d6a203d91bdc7ad09" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-windows-arm64.zip" + sha256: "e5bea5c45b61f105429fc664364c5280acd40770cc74235b79e7422f608a9849" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-windows-x86_64.zip" + sha256: "9ab28eba1ab7911a0e57ab274f5990a283fffa1d22eb711792d5562e5869f9ef" + "3.28.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-linux-aarch64.tar.gz" + sha256: "7909cc2128ce9442c63ce674a0bfb0e4f4ce04cef667d887e15ad5670d594ba7" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-linux-x86_64.tar.gz" + sha256: "931e3c0d546ee03ca72bb147ccd9b49e3b6252f765f66bf21b9d165519940458" + Macos: + universal: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-macos10.10-universal.tar.gz" + sha256: "cbda8e719b3239e304b339cdd90e946c09dac5ad2d57c93bf1b1d3914685d9a7" + Windows: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-windows-arm64.zip" + sha256: "63e4ebd2dadb5ad63faaf4ed38db40d3fec92d1b050d2a4e69011ea3ee699d29" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-windows-x86_64.zip" + sha256: "a8f2e684ead94a64fd3517a38857a5b3f7f8d68d15c49ca1143d18797eaf9cac" + "3.28.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-linux-aarch64.tar.gz" + sha256: "5b4a86b456058266bd4caa9c59187fab4b1ace823acdd9741d2d24fed5a4f50b" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-linux-x86_64.tar.gz" + sha256: "c5460b8a0ecfea7c0ac99d78427e19409ea9133e29a604e1f8c0e6806a8f6934" + Macos: + universal: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-macos10.10-universal.tar.gz" + sha256: "62956bf3c26b396cee20dddf2914d63d882cff4245e13c29c72f7841c03d56e4" + Windows: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-windows-arm64.zip" + sha256: "47056df28bc543c528f85f15c46180dbed750e5ebd0180f936a2e3ee22ddea56" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-windows-x86_64.zip" + sha256: "0fbea146a782e4b82a799384a2109e46ce27f3ad70c30d3f8c9ef751e1e28040" "3.28.1": Linux: armv8: diff --git a/recipes/cmake/config.yml b/recipes/cmake/config.yml index 7ce9e3ce4a58b..762b68a2142aa 100644 --- a/recipes/cmake/config.yml +++ b/recipes/cmake/config.yml @@ -1,4 +1,22 @@ versions: + "3.30.0": + folder: "binary" + "3.29.6": + folder: "binary" + "3.29.5": + folder: "binary" + "3.29.4": + folder: "binary" + "3.29.3": + folder: "binary" + "3.29.2": + folder: "binary" + "3.29.0": + folder: "binary" + "3.28.6": + folder: "binary" + "3.28.5": + folder: "binary" "3.28.1": folder: "binary" "3.27.9": diff --git a/recipes/commata/all/conandata.yml b/recipes/commata/all/conandata.yml index 2f4d1cb571d15..859d53c719d79 100644 --- a/recipes/commata/all/conandata.yml +++ b/recipes/commata/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.0.0": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v1.0.0.tar.gz" + sha256: "ecf0a88f6a4616d10770522b4ef4838e4100511759eb640270f6b932e4b7df69" + "0.2.9": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.9.tar.gz" + sha256: "24c404e90e2f01a2f9e46e55c2f8121a3f146d1f2dfb819b8d7ab5cf13bd6a9f" "0.2.8": url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.8.tar.gz" sha256: "a762ec3ef1549aa5aebef78a160a40ee16d396fd976154f1f5c160837d145c8a" @@ -15,6 +21,15 @@ sources: url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.5.tar.gz" sha256: "d1be1f366267af6c466c29f846f5968f57626a8a6635a2ea9a3de3f6fb88e53b" patches: + "0.2.9": + - patch_file: "patches/0.2.9-0001-include-set.patch" + patch_description: "include header" + patch_type: "portability" + patch_source: "https://github.com/furfurylic/commata/pull/3" + - patch_file: "patches/0.2.9-0002-additional-missing-includes.patch" + patch_description: "add more missing headers" + patch_type: "portability" + patch_source: "https://github.com/furfurylic/commata/commit/07c6f43f0fae0237569d12420aded35f8ccf792f" "0.2.7": - patch_file: "patches/0.2.7-0001-include-optional.patch" patch_description: "include header" diff --git a/recipes/commata/all/patches/0.2.9-0001-include-set.patch b/recipes/commata/all/patches/0.2.9-0001-include-set.patch new file mode 100644 index 0000000000000..1519e2f79a965 --- /dev/null +++ b/recipes/commata/all/patches/0.2.9-0001-include-set.patch @@ -0,0 +1,12 @@ +diff --git a/include/commata/field_scanners.hpp b/include/commata/field_scanners.hpp +index 9b19b8c..9606732 100644 +--- a/include/commata/field_scanners.hpp ++++ b/include/commata/field_scanners.hpp +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + #include "text_error.hpp" + #include "text_value_translation.hpp" diff --git a/recipes/commata/all/patches/0.2.9-0002-additional-missing-includes.patch b/recipes/commata/all/patches/0.2.9-0002-additional-missing-includes.patch new file mode 100644 index 0000000000000..87671798cc1bd --- /dev/null +++ b/recipes/commata/all/patches/0.2.9-0002-additional-missing-includes.patch @@ -0,0 +1,14 @@ +diff --git a/include/commata/field_handling.hpp b/include/commata/field_handling.hpp +index 04ab67e..8b438b6 100644 +--- a/include/commata/field_handling.hpp ++++ b/include/commata/field_handling.hpp +@@ -6,7 +6,9 @@ + #ifndef COMMATA_GUARD_CD40E918_ACCD_4879_BB48_7D9B8B823369 + #define COMMATA_GUARD_CD40E918_ACCD_4879_BB48_7D9B8B823369 + ++#include + #include ++#include + + namespace commata { + diff --git a/recipes/commata/config.yml b/recipes/commata/config.yml index 613aa17053d3e..992edc2e1338d 100644 --- a/recipes/commata/config.yml +++ b/recipes/commata/config.yml @@ -1,4 +1,8 @@ versions: + "1.0.0": + folder: all + "0.2.9": + folder: all "0.2.8": folder: all "0.2.7": diff --git a/recipes/cpp-channel/all/conandata.yml b/recipes/cpp-channel/all/conandata.yml new file mode 100644 index 0000000000000..8e45b89578701 --- /dev/null +++ b/recipes/cpp-channel/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.8.2": + url: "https://github.com/andreiavrammsd/cpp-channel/archive/refs/tags/v0.8.2.tar.gz" + sha256: "7666ec6ef275029593dc97bf35057761bc049298d71597a640da1e659c39a667" diff --git a/recipes/cpp-channel/all/conanfile.py b/recipes/cpp-channel/all/conanfile.py new file mode 100644 index 0000000000000..2dfc0cff05ee7 --- /dev/null +++ b/recipes/cpp-channel/all/conanfile.py @@ -0,0 +1,59 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.52.0" + +class CppCHannelConan(ConanFile): + name = "cpp-channel" + description = "Thread-safe container for sharing data between threads" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/andreiavrammsd/cpp-channel" + topics = ("channel", "golang", "container", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc < 7") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + copy( + self, + pattern="*.inl", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cpp-channel/all/test_package/CMakeLists.txt b/recipes/cpp-channel/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6e53e2494f389 --- /dev/null +++ b/recipes/cpp-channel/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cpp-channel REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp-channel::cpp-channel) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cpp-channel/all/test_package/conanfile.py b/recipes/cpp-channel/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/cpp-channel/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cpp-channel/all/test_package/test_package.cpp b/recipes/cpp-channel/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f0fa8b9f9e593 --- /dev/null +++ b/recipes/cpp-channel/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +#include "msd/channel.hpp" + +int main() +{ + msd::channel ch{10}; + + int in{}; + + in = 1; + ch << in; + + in = 2; + ch << in; + + in = 3; + ch << in; + + for (auto out : ch) { + std::cout << out << '\n'; + + if (ch.empty()) { + break; + } + } +} diff --git a/recipes/cpp-channel/config.yml b/recipes/cpp-channel/config.yml new file mode 100644 index 0000000000000..bed1cdd9bb5b1 --- /dev/null +++ b/recipes/cpp-channel/config.yml @@ -0,0 +1,3 @@ +versions: + "0.8.2": + folder: all diff --git a/recipes/cpp-dump/all/conandata.yml b/recipes/cpp-dump/all/conandata.yml new file mode 100644 index 0000000000000..e2ca2bfcf8c91 --- /dev/null +++ b/recipes/cpp-dump/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.6.0": + url: "https://github.com/philip82148/cpp-dump/archive/refs/tags/v0.6.0.tar.gz" + sha256: "22bc5fafa22ac7c1e99db8824fdabec4af6baabed0c8b7cc80a0205dfb550414" + "0.5.0": + url: "https://github.com/philip82148/cpp-dump/archive/refs/tags/v0.5.0.tar.gz" + sha256: "31fa8b03c9ee820525137be28f37b36e2abe7fd91df7d67681cb894db2230fe6" diff --git a/recipes/cpp-dump/all/conanfile.py b/recipes/cpp-dump/all/conanfile.py new file mode 100644 index 0000000000000..b9f479f3b52af --- /dev/null +++ b/recipes/cpp-dump/all/conanfile.py @@ -0,0 +1,73 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.52.0" + + +class CppDumpConan(ConanFile): + name = "cpp-dump" + description = "An all-round dump function library for C++ that can print any type, even user-defined types." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/philip82148/cpp-dump" + topics = ("debug", "dump", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="dump.hpp", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include", "hpp"), + src=os.path.join(self.source_folder, "hpp"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cpp-dump/all/test_package/CMakeLists.txt b/recipes/cpp-dump/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..79f40a47d7e0c --- /dev/null +++ b/recipes/cpp-dump/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cpp-dump REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp-dump::cpp-dump) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cpp-dump/all/test_package/conanfile.py b/recipes/cpp-dump/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/cpp-dump/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cpp-dump/all/test_package/test_package.cpp b/recipes/cpp-dump/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..187dc7393224b --- /dev/null +++ b/recipes/cpp-dump/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +#include +#include +#include + +int main() { + std::clog << std::endl; + + std::vector> my_vector{{3, 5, 8, 9, 7}, {9, 3, 2, 3, 8}}; + CPP_DUMP(my_vector); + + std::clog << std::endl; +} diff --git a/recipes/cpp-dump/config.yml b/recipes/cpp-dump/config.yml new file mode 100644 index 0000000000000..33d7618432d30 --- /dev/null +++ b/recipes/cpp-dump/config.yml @@ -0,0 +1,5 @@ +versions: + "0.6.0": + folder: all + "0.5.0": + folder: all diff --git a/recipes/cpp-httplib/all/conandata.yml b/recipes/cpp-httplib/all/conandata.yml index 55f4436e78089..8ff6cdba110e7 100644 --- a/recipes/cpp-httplib/all/conandata.yml +++ b/recipes/cpp-httplib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.16.0": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.16.0.tar.gz" + sha256: "c125022eb85eaa12235518dc4638be93b62c3216d0f87b655af7b17b71b38851" "0.15.3": url: "https://github.com/yhirose/cpp-httplib/archive/v0.15.3.tar.gz" sha256: "2121bbf38871bb2aafb5f7f2b9b94705366170909f434428352187cb0216124e" diff --git a/recipes/cpp-httplib/config.yml b/recipes/cpp-httplib/config.yml index 89c0fa2d0946b..d7f8c6163badb 100644 --- a/recipes/cpp-httplib/config.yml +++ b/recipes/cpp-httplib/config.yml @@ -1,4 +1,6 @@ versions: + "0.16.0": + folder: all "0.15.3": folder: all "0.15.2": diff --git a/recipes/cpp-peglib/1.x.x/conandata.yml b/recipes/cpp-peglib/1.x.x/conandata.yml index dc41e18c30f7b..7aa81fd5b52ff 100644 --- a/recipes/cpp-peglib/1.x.x/conandata.yml +++ b/recipes/cpp-peglib/1.x.x/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.8.8": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.8.tar.gz" + sha256: "3019d8084a146562fe2fd4c71e3226ac6e3994e8cee21cab27b3cd5a86bcef34" + "1.8.7": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.7.tar.gz" + sha256: "400696cc7e721b23aeac28a1ae12ceec235e2671888993da2ce012f6acdf83d4" "1.8.6": url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.6.tar.gz" sha256: "b2ebdc135a66074a386d377b761b38e050088fba6482575ca3028d0e184ecd91" diff --git a/recipes/cpp-peglib/config.yml b/recipes/cpp-peglib/config.yml index 67a22c2c821e5..81349971ce40f 100644 --- a/recipes/cpp-peglib/config.yml +++ b/recipes/cpp-peglib/config.yml @@ -1,4 +1,8 @@ versions: + "1.8.8": + folder: "1.x.x" + "1.8.7": + folder: "1.x.x" "1.8.6": folder: "1.x.x" "1.8.5": diff --git a/recipes/cpp-sort/all/conandata.yml b/recipes/cpp-sort/all/conandata.yml index 48e5289632674..c155d44a961c8 100644 --- a/recipes/cpp-sort/all/conandata.yml +++ b/recipes/cpp-sort/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.16.0": + url: "https://github.com/Morwenn/cpp-sort/archive/1.16.0.tar.gz" + sha256: "54eb65de5655ce58719d45616f29e4b9060135b9cc8b526bcfc9f5434975ea8c" "1.15.0": url: "https://github.com/Morwenn/cpp-sort/archive/1.15.0.tar.gz" sha256: "886e813a4b87c6361e9b50c0a66c73b3b812f0ce0b7039ff3991eddce77e0dc7" diff --git a/recipes/cpp-sort/config.yml b/recipes/cpp-sort/config.yml index acbaa54fefe9c..ce014d3a22c71 100644 --- a/recipes/cpp-sort/config.yml +++ b/recipes/cpp-sort/config.yml @@ -1,4 +1,6 @@ versions: + "1.16.0": + folder: all "1.15.0": folder: all "1.14.0": diff --git a/recipes/cpp-yyjson/all/conandata.yml b/recipes/cpp-yyjson/all/conandata.yml new file mode 100644 index 0000000000000..a6c03b5fc9f4d --- /dev/null +++ b/recipes/cpp-yyjson/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.5.0": + url: "https://github.com/yosh-matsuda/cpp-yyjson/archive/refs/tags/v0.5.0.tar.gz" + sha256: "c1d44460c9ca3c21d5cfaea882ffaca83565c24984c5d17322e0b74a84ececfc" diff --git a/recipes/cpp-yyjson/all/conanfile.py b/recipes/cpp-yyjson/all/conanfile.py new file mode 100644 index 0000000000000..b65b4445b46dd --- /dev/null +++ b/recipes/cpp-yyjson/all/conanfile.py @@ -0,0 +1,76 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.52.0" + +class CppYyjsonConan(ConanFile): + name = "cpp-yyjson" + description = "Ultra-fast and intuitive C++ JSON reader/writer with yyjson backend" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/yosh-matsuda/cpp-yyjson" + topics = ("json", "reader", "writer", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "15", + "apple-clang": "14", + "Visual Studio": "17", + "msvc": "193", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("yyjson/0.9.0") + self.requires("fmt/10.2.1") + self.requires("nameof/0.10.4") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.hpp", + os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if is_msvc(self): + self.cpp_info.cxxflags.append("/Zc:preprocessor") + + self.cpp_info.set_property("cmake_file_name", "cpp_yyjson") + self.cpp_info.set_property("cmake_target_name", "cpp_yyjson::cpp_yyjson") diff --git a/recipes/cpp-yyjson/all/test_package/CMakeLists.txt b/recipes/cpp-yyjson/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f2fd7795754c4 --- /dev/null +++ b/recipes/cpp-yyjson/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cpp_yyjson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp_yyjson::cpp_yyjson) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/cpp-yyjson/all/test_package/conanfile.py b/recipes/cpp-yyjson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/cpp-yyjson/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cpp-yyjson/all/test_package/test_package.cpp b/recipes/cpp-yyjson/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f4345c086ba90 --- /dev/null +++ b/recipes/cpp-yyjson/all/test_package/test_package.cpp @@ -0,0 +1,52 @@ +#include +#include +#include + +#include "cpp_yyjson.hpp" + +using namespace yyjson; + +auto json_str = R"( +{ + "id": 1, + "pi": 3.141592, + "name": "example", + "array": [0, 1, 2, 3, 4], + "currency": { + "USD": 129.66, + "EUR": 140.35, + "GBP": 158.72 + }, + "success": true +})"; + +int main() { + // Read JSON string and cast as an object class + auto obj = *read(json_str).as_object(); + + // Key access to the JSON object class + auto id = *obj["id"].as_int(); + auto pi = *obj["pi"].as_real(); + auto name = *obj["name"].as_string(); + auto success = *obj["success"].as_bool(); + + // JSON array/object classes adapt the range concept + auto list = *obj["array"].as_array(); + for (const auto& v : list) { + // `write` returns JSON read-only string + std::cout << v.write() << std::endl; + } + + // The range value type of object class is a key-value pair + auto dict = *obj["currency"].as_object(); + for (const auto& [k, v] : dict) { + std::cout << "{" << k << ": " << v.write() << "}" << std::endl; + } + + // JSON array/object to container conversion + auto numbers = cast>(list); + auto currency = cast>(dict); + + // Stringify read-only string + std::cout << obj.write() << std::endl; +} diff --git a/recipes/cpp-yyjson/config.yml b/recipes/cpp-yyjson/config.yml new file mode 100644 index 0000000000000..ca7b2c3985d5e --- /dev/null +++ b/recipes/cpp-yyjson/config.yml @@ -0,0 +1,3 @@ +versions: + "0.5.0": + folder: all diff --git a/recipes/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml index 0e4ce7f0c9324..a93642627eb02 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.14.2": + url: "https://github.com/danmar/cppcheck/archive/2.14.2.tar.gz" + sha256: "9c3acea5f489336bd83a8ea33917a9a04a80c56d874bf270287e7de27acf2d00" + "2.14.1": + url: "https://github.com/danmar/cppcheck/archive/2.14.1.tar.gz" + sha256: "22d1403fbc3158f35b5216d7b0a50bbaf0c80bf6663933a71f65cc4fc307ff3d" "2.13.4": url: "https://github.com/danmar/cppcheck/archive/2.13.4.tar.gz" sha256: "d6ea064ebab76c6aa000795440479767d8d814dd29405918df4c1bbfcd6cb86c" diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index fa5b72926399e..50b0c8fbb19de 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -66,8 +66,8 @@ def package_info(self): self.cpp_info.libdirs = [] bin_folder = os.path.join(self.package_folder, "bin") - self.output.info(f"Append {bin_folder} to environment variable PATH") self.env_info.PATH.append(bin_folder) + cppcheck_htmlreport = os.path.join(bin_folder, "cppcheck-htmlreport") self.env_info.CPPCHECK_HTMLREPORT = cppcheck_htmlreport self.runenv_info.define_path("CPPCHECK_HTMLREPORT", cppcheck_htmlreport) diff --git a/recipes/cppcheck/config.yml b/recipes/cppcheck/config.yml index b1367265202bb..23cb6f096c9de 100644 --- a/recipes/cppcheck/config.yml +++ b/recipes/cppcheck/config.yml @@ -1,4 +1,8 @@ versions: + "2.14.2": + folder: all + "2.14.1": + folder: all "2.13.4": folder: all "2.13.3": diff --git a/recipes/cpprestsdk/all/conanfile.py b/recipes/cpprestsdk/all/conanfile.py index c75c41fcad7c4..c8ac42529d53c 100644 --- a/recipes/cpprestsdk/all/conanfile.py +++ b/recipes/cpprestsdk/all/conanfile.py @@ -112,7 +112,13 @@ def package_info(self): # cpprestsdk_boost_internal self.cpp_info.components["cpprestsdk_boost_internal"].set_property("cmake_target_name", "cpprestsdk::cpprestsdk_boost_internal") self.cpp_info.components["cpprestsdk_boost_internal"].includedirs = [] - self.cpp_info.components["cpprestsdk_boost_internal"].requires = ["boost::boost"] + ## List of Boost components cpprestsdk depends on: + ## see https://github.com/microsoft/cpprestsdk/blob/v2.10.19/Release/cmake/cpprest_find_boost.cmake#L77-L106 + self.cpp_info.components["cpprestsdk_boost_internal"].requires = ["boost::headers", "boost::system"] + if self.settings.os != "Windows": + self.cpp_info.components["cpprestsdk_boost_internal"].requires.extend(["boost::random", "boost::thread", "boost::filesystem", "boost::chrono", "boost::atomic"]) + if self.settings.os != "Android": + self.cpp_info.components["cpprestsdk_boost_internal"].requires.extend(["boost::date_time", "boost::regex"]) # cpprestsdk_openssl_internal self.cpp_info.components["cpprestsdk_openssl_internal"].set_property("cmake_target_name", "cpprestsdk::cpprestsdk_openssl_internal") self.cpp_info.components["cpprestsdk_openssl_internal"].includedirs = [] diff --git a/recipes/cpptrace/all/conandata.yml b/recipes/cpptrace/all/conandata.yml index 3c8c1e7ad8901..2bf854f46723a 100644 --- a/recipes/cpptrace/all/conandata.yml +++ b/recipes/cpptrace/all/conandata.yml @@ -1,5 +1,33 @@ sources: # Newer versions at the top + "0.6.2": + url: + - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.6.2.tar.gz" + sha256: "02a0540b5b1be0788565f48b065b456d3eab81ae2323a50e75ed36449a0143ed" + "0.6.1": + url: + - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.6.1.tar.gz" + sha256: "4bb478eedbe4b2c0093ef7af4f64795304850e03312e658076b25ef8d6019c75" + "0.6.0": + url: + - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.6.0.tar.gz" + sha256: "7c2996f03d15f61016bc81fe7fa5220b1cc42498333c5c0e699ad2f96b918b96" + "0.5.4": + url: + - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.5.4.tar.gz" + sha256: "bab0f76330f90c445216ccade1a3ff29c9c4bbd44805be34d52095cd95b02df4" + "0.5.3": + url: + - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.5.3.tar.gz" + sha256: "fb84b8b021bf8c1265e650b4cc19ae8acc9c07b980eb1e34d9806acf15bb4fdf" + "0.5.2": + url: + - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.5.2.tar.gz" + sha256: "d148998e175b9c69ffb4383ab321a0d27487392e4eee3f39441d35b6856c8f78" + "0.5.1": + url: + - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.5.1.tar.gz" + sha256: "27b9f862ec6185f570ee59c07fdd12bebb55a986191518e896621317d2654f26" "0.5.0": url: - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.5.0.tar.gz" @@ -25,6 +53,11 @@ sources: - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.2.1.tar.gz" sha256: "3184f404c61b6b8ba6fe7c64fc40d1c3d6d87df59bcacf1845d846101bc22f9a" patches: + "0.5.2": + - patch_file: "patches/0.5.2/0001-msvc-bug.patch" + patch_type: "official" + patch_source: "https://github.com/jeremy-rifkin/cpptrace/commit/599d6abd6cc74e80e8429fc309247be5f7edd5d7" + patch_description: "Workaround bug for old msvc" "0.4.0": - patch_file: "patches/0.4.0/0001-libdwarf_path.patch" patch_type: "conan" diff --git a/recipes/cpptrace/all/conanfile.py b/recipes/cpptrace/all/conanfile.py index f0aee2a68a632..fe0556f21f1b2 100644 --- a/recipes/cpptrace/all/conanfile.py +++ b/recipes/cpptrace/all/conanfile.py @@ -21,10 +21,12 @@ class CpptraceConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "unwind": ["default", "libunwind"], } default_options = { "shared": False, "fPIC": True, + "unwind": "default", } @property @@ -43,10 +45,12 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if Version(self.version) >= Version("0.4.0"): + if Version(self.version) >= "0.4.0": self.requires("libdwarf/0.9.1") else: self.requires("libdwarf/0.8.0") + if self.options.unwind == "libunwind": + self.requires("libunwind/1.8.0", transitive_libs=True) def validate(self): if self.settings.compiler.cppstd: @@ -63,13 +67,15 @@ def generate(self): tc = CMakeToolchain(self) if is_msvc(self): tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) - if Version(self.version) >= Version("0.3.0"): + if Version(self.version) >= "0.3.0": tc.variables["CPPTRACE_USE_EXTERNAL_LIBDWARF"] = True tc.variables["CPPTRACE_CONAN"] = True else: if not self.options.shared: tc.variables["CPPTRACE_STATIC"] = True tc.variables["CPPTRACE_USE_SYSTEM_LIBDWARF"] = True + if self.options.unwind == "libunwind": + tc.variables["CPPTRACE_UNWIND_WITH_LIBUNWIND"] = True tc.generate() tc = CMakeDeps(self) tc.generate() diff --git a/recipes/cpptrace/all/patches/0.5.2/0001-msvc-bug.patch b/recipes/cpptrace/all/patches/0.5.2/0001-msvc-bug.patch new file mode 100644 index 0000000000000..b9a184ee0d627 --- /dev/null +++ b/recipes/cpptrace/all/patches/0.5.2/0001-msvc-bug.patch @@ -0,0 +1,36 @@ +diff --git a/src/utils/microfmt.hpp b/src/utils/microfmt.hpp +index ba47db7..0f750c3 100644 +--- a/src/utils/microfmt.hpp ++++ b/src/utils/microfmt.hpp +@@ -302,20 +302,27 @@ namespace microfmt { + } + } + +- template + #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ template + std::string format(std::string_view fmt, Args&&... args) { +- #else +- std::string format(const std::string& fmt, Args&&... args) { +- #endif + return detail::format(fmt.begin(), fmt.end(), {detail::format_value(args)...}); + } + ++ inline std::string format(std::string_view fmt) { ++ return std::string(fmt); ++ } ++ #endif ++ + template + std::string format(const char* fmt, Args&&... args) { + return detail::format(fmt, fmt + std::strlen(fmt), {detail::format_value(args)...}); + } + ++ // working around an old msvc bug https://godbolt.org/z/88T8hrzzq mre: https://godbolt.org/z/drd8echbP ++ inline std::string format(const char* fmt) { ++ return std::string(fmt); ++ } ++ + template + void print(const S& fmt, Args&&... args) { + std::cout<=7.78.0 <9]", transitive_headers=True, transitive_libs=True) - # FIXME: This is a very dirty hack. - # with_ssl == _AUTO_SSL, cpr needs the openssl header to compile. But Conan recipe does not know which SSL library to use. - # because cpr's CMakeLists.txt automatically detects SSL libraries with CPR_ENABLE_SSL == ON. - if self.settings.os in ["Linux", "FreeBSD"] and self.options.with_ssl in ["openssl", CprConan._AUTO_SSL]: + if self.options.with_ssl == "openssl": self.requires("openssl/[>=1.1 <4]") def validate(self): @@ -101,24 +99,15 @@ def validate(self): if not self._uses_valid_abi_and_compiler: raise ConanInvalidConfiguration(f"Cannot compile {self.ref} with libstdc++ on clang < 9") - ssl_library = str(self.options.with_ssl) - - if ssl_library == "openssl" and is_apple_os(self): - raise ConanInvalidConfiguration("OpenSSL is not supported on macOS") - if ssl_library == "darwinssl" and not is_apple_os(self): - raise ConanInvalidConfiguration("DarwinSSL is only supported on macOS") - if ssl_library == "winssl" and self.settings.os != "Windows": - raise ConanInvalidConfiguration("WinSSL is only on Windows") + if self.options.with_ssl: + ssl_library = str(self.options.with_ssl) - if ssl_library not in (CprConan._AUTO_SSL, CprConan._NO_SSL, "winssl") and ssl_library != self.dependencies["libcurl"].options.with_ssl: - raise ConanInvalidConfiguration( - f"{self.ref}:with_ssl={self.options.with_ssl} requires libcurl:with_ssl={self.options.with_ssl}" - ) - - if ssl_library == "winssl" and self.dependencies["libcurl"].options.with_ssl != "schannel": - raise ConanInvalidConfiguration( - f"{self.ref}:with_ssl=winssl requires libcurl:with_ssl=schannel" - ) + if ssl_library == "openssl" and is_apple_os(self): + raise ConanInvalidConfiguration("OpenSSL is not supported on macOS. Use DarwinSSL instead.") + if ssl_library == "darwinssl" and not is_apple_os(self): + raise ConanInvalidConfiguration("DarwinSSL is only supported on macOS") + if ssl_library == "winssl" and self.settings.os != "Windows": + raise ConanInvalidConfiguration("WinSSL is only on Windows") if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") @@ -143,9 +132,7 @@ def generate(self): tc.variables["CPR_FORCE_OPENSSL_BACKEND"] = (self.options.with_ssl == "openssl") tc.variables["CPR_FORCE_WINSSL_BACKEND"] = (self.options.with_ssl == "winssl") tc.variables["CMAKE_USE_OPENSSL"] = (self.options.with_ssl == "openssl") - # If we are on a version where disabling SSL requires a cmake option, disable it - if self.options.with_ssl == CprConan._NO_SSL: - tc.variables["CPR_ENABLE_SSL"] = False + tc.variables["CPR_ENABLE_SSL"] = bool(self.options.with_ssl) if self.options.get_safe("verbose_logging", False): tc.variables["CURL_VERBOSE_LOGGING"] = True diff --git a/recipes/cpuinfo/all/conanfile.py b/recipes/cpuinfo/all/conanfile.py index 24edf5382c77c..58abd3608a84f 100644 --- a/recipes/cpuinfo/all/conanfile.py +++ b/recipes/cpuinfo/all/conanfile.py @@ -108,3 +108,6 @@ def package_info(self): self.cpp_info.components["cpuinfo"].requires = ["clog"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["cpuinfo"].system_libs.append("pthread") + + if self.settings.os == "Android": + self.cpp_info.components["cpuinfo"].system_libs.append("log") diff --git a/recipes/cpython/all/conandata.yml b/recipes/cpython/all/conandata.yml index f9fd51067c8b3..d49b900576339 100644 --- a/recipes/cpython/all/conandata.yml +++ b/recipes/cpython/all/conandata.yml @@ -1,72 +1,79 @@ sources: - "3.10.0": - url: "https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz" - sha256: "c4e0cbad57c90690cb813fb4663ef670b4d0f587d8171e2c42bd4c9245bd2758" - "3.9.7": - url: "https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tgz" - sha256: "a838d3f9360d157040142b715db34f0218e535333696a5569dc6f854604eb9d1" - "3.8.12": - url: "https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz" - sha256: "316aa33f3b7707d041e73f246efedb297a70898c4b91f127f66dc8d80c596f1a" - "3.7.12": - url: "https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz" - sha256: "33b4daaf831be19219659466d12645f87ecec6eb21d4d9f9711018a7b66cce46" - "2.7.18": - url: "https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz" - sha256: "da3080e3b488f648a3d7a4560ddee895284c3380b11d6de75edb986526b9a814" + "3.12.2": + url: "https://www.python.org/ftp/python/3.12.2/Python-3.12.2.tgz" + sha256: "a7c4f6a9dc423d8c328003254ab0c9338b83037bd787d680826a5bf84308116e" + "3.11.9": + url: "https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz" + sha256: "e7de3240a8bc2b1e1ba5c81bf943f06861ff494b69fda990ce2722a504c6153d" + "3.10.14": + url: "https://www.python.org/ftp/python/3.10.14/Python-3.10.14.tgz" + sha256: "cefea32d3be89c02436711c95a45c7f8e880105514b78680c14fe76f5709a0f6" + "3.9.19": + url: "https://www.python.org/ftp/python/3.9.19/Python-3.9.19.tgz" + sha256: "f5f9ec8088abca9e399c3b62fd8ef31dbd2e1472c0ccb35070d4d136821aaf71" + "3.8.19": + url: "https://www.python.org/ftp/python/3.8.19/Python-3.8.19.tgz" + sha256: "c7fa55a36e5c7a19ec37d8f90f60a2197548908c9ac8b31e7c0dbffdd470eeac" patches: - "3.10.0": - - patch_file: "patches/3.10.0-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0002-_msi-vcxproj.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.10.0-0003-_ctypes-ffi.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.10.0-0005-disable-macos-tcltk.patch" - base_path: "source_subfolder" + "3.12.2": + - patch_file: "patches/3.9/3.9.7-0002-_msi-vcxproj.patch" + patch_description: "Fix ARM/ARM64 mismatch in project file" + patch_type: "bugfix" + - patch_file: "patches/3.12/3.12.1-0001-_ctypes-ffi.patch" + patch_description: "Support shared libffi" + patch_type: "portability" - patch_file: "patches/3.x-0001-relocatable-python-config.patch" - base_path: "source_subfolder" - "3.9.7": - - patch_file: "patches/3.9.7-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0002-_msi-vcxproj.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0003-_ctypes-ffi.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0005-disable-macos-tcltk.patch" - base_path: "source_subfolder" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.12/3.12.1-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" + "3.11.9": + - patch_file: "patches/3.9/3.9.7-0002-_msi-vcxproj.patch" + patch_description: "Fix ARM/ARM64 mismatch in project file" + patch_type: "bugfix" + - patch_file: "patches/3.11/3.11.7-0001-_ctypes-ffi.patch" + patch_description: "Support shared libffi" + patch_type: "portability" - patch_file: "patches/3.x-0001-relocatable-python-config.patch" - base_path: "source_subfolder" - "3.8.12": - - patch_file: "patches/3.8.12-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.8.12-0002-_ctypes-ffi.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.8.12-0004-disable-macos-tcltk.patch" - base_path: "source_subfolder" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.x-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" + "3.10.14": + - patch_file: "patches/3.9/3.9.7-0002-_msi-vcxproj.patch" + patch_description: "Fix ARM/ARM64 mismatch in project file" + patch_type: "bugfix" + - patch_file: "patches/3.10/3.10.0-0003-_ctypes-ffi.patch" + patch_description: "Remove duplicate libffi symbols and support shared libffi" + patch_type: "portability" - patch_file: "patches/3.x-0001-relocatable-python-config.patch" - base_path: "source_subfolder" - "3.7.12": - - patch_file: "patches/3.7.9-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.7.9-0003-disable-macos-tcltk.patch" - base_path: "source_subfolder" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.x-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" + "3.9.19": + - patch_file: "patches/3.9/3.9.7-0002-_msi-vcxproj.patch" + patch_description: "Fix ARM/ARM64 mismatch in project file" + patch_type: "bugfix" + - patch_file: "patches/3.9/3.9.7-0003-_ctypes-ffi.patch" + patch_description: "Remove duplicate libffi symbols and support shared libffi" + patch_type: "portability" - patch_file: "patches/3.x-0001-relocatable-python-config.patch" - base_path: "source_subfolder" - "2.7.18": - - patch_file: "patches/2.7.18-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/2.7.18-0002-add-support-msvc-14.patch" - base_path: "source_subfolder" - - patch_file: "patches/2.7.18-0003-msvc-fix-static.patch" - base_path: "source_subfolder" - - patch_file: "patches/2.7.18-0004-disable-macos-tcltk.patch" - base_path: "source_subfolder" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.x-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" + "3.8.19": + - patch_file: "patches/3.8/3.8.12-0002-_ctypes-ffi.patch" + patch_description: "Remove duplicate libffi symbols and support shared libffi" + patch_type: "portability" + - patch_file: "patches/3.x-0001-relocatable-python-config.patch" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.x-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" diff --git a/recipes/cpython/all/conanfile.py b/recipes/cpython/all/conanfile.py index 4fa1d1da6334e..c98c3381c1c65 100644 --- a/recipes/cpython/all/conanfile.py +++ b/recipes/cpython/all/conanfile.py @@ -1,21 +1,29 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, MSBuild, tools -from conans.errors import ConanInvalidConfiguration -from io import StringIO import os import re import textwrap -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.env import VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, mkdir, replace_in_file, rm, rmdir, save, unzip +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import MSBuildDeps, MSBuildToolchain, MSBuild, is_msvc, is_msvc_static_runtime, msvc_runtime_flag, msvs_toolset +from conan.tools.scm import Version + +required_conan_version = ">=1.58.0" class CPythonConan(ConanFile): name = "cpython" + description = "Python is a programming language that lets you work quickly and integrate systems more effectively." + license = "Python-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.python.org" - description = "Python is a programming language that lets you work quickly and integrate systems more effectively." topics = ("python", "cpython", "language", "script") - license = ("Python-2.0",) - exports_sources = "patches/**" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,11 +38,6 @@ class CPythonConan(ConanFile): "with_sqlite3": [True, False], "with_tkinter": [True, False], "with_curses": [True, False], - - # Python 2 options - "unicode": ["ucs2", "ucs4"], - "with_bsddb": [True, False], - # Python 3 options "with_lzma": [True, False], # options that don't change package id @@ -53,286 +56,426 @@ class CPythonConan(ConanFile): "with_sqlite3": True, "with_tkinter": True, "with_curses": True, - - # Python 2 options - "unicode": "ucs2", - "with_bsddb": False, # True, # FIXME: libdb package missing (#5309/#5392) - # Python 3 options "with_lzma": True, # options that don't change package id "env_vars": True, } - - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _version_number_only(self): - return re.match(r"^([0-9.]+)", self.version).group(1) - - @property - def _version_tuple(self): - return tuple(self._version_number_only.split(".")) + short_paths = True @property def _supports_modules(self): - return self.settings.compiler != "Visual Studio" or self.options.shared + return not is_msvc(self) or self.options.shared @property def _version_suffix(self): - if self.settings.compiler == "Visual Studio": - joiner = "" - else: - joiner = "." - return joiner.join(self._version_tuple[:2]) + v = Version(self.version) + joiner = "" if is_msvc(self) else "." + return f"{v.major}{joiner}{v.minor}" - @property - def _is_py3(self): - return tools.Version(self._version_number_only).major == "3" - - @property - def _is_py2(self): - return tools.Version(self._version_number_only).major == "2" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if self.settings.compiler == "Visual Studio": + if is_msvc(self): del self.options.lto del self.options.docstrings del self.options.pymalloc del self.options.with_curses del self.options.with_gdbm del self.options.with_nis - if self._is_py2: - # Python 2.xx does not support following options - del self.options.with_lzma - elif self._is_py3: - # Python 3.xx does not support following options - del self.options.with_bsddb - del self.options.unicode - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.compiler.rm_safe("libcxx") + self.settings.compiler.rm_safe("cppstd") def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if not self._supports_modules: - del self.options.with_bz2 - del self.options.with_sqlite3 - del self.options.with_tkinter - - del self.options.with_bsddb - del self.options.with_lzma - if self.settings.compiler == "Visual Studio": - # The msbuild generator only works with Visual Studio - self.generators.append("MSBuildDeps") - - def validate(self): - if self.options.shared: - if self.settings.compiler == "Visual Studio" and "MT" in self.settings.compiler.runtime: - raise ConanInvalidConfiguration("cpython does not support MT(d) runtime when building a shared cpython library") - if self.settings.compiler == "Visual Studio": - if self.options.optimizations: - raise ConanInvalidConfiguration("This recipe does not support optimized MSVC cpython builds (yet)") - # FIXME: should probably throw when cross building - # FIXME: optimizations for Visual Studio, before building the final `build_type`: - # 1. build the MSVC PGInstrument build_type, - # 2. run the instrumented binaries, (PGInstrument should have created a `python.bat` file in the PCbuild folder) - # 3. build the MSVC PGUpdate build_type - if self.settings.build_type == "Debug" and "d" not in self.settings.compiler.runtime: - raise ConanInvalidConfiguration("Building debug cpython requires a debug runtime (Debug cpython requires _CrtReportMode symbol, which only debug runtimes define)") - if self._is_py2: - if self.settings.compiler.version >= tools.Version("14"): - self.output.warn("Visual Studio versions 14 and higher were never officially supported by the CPython developers") - if str(self.settings.arch) not in self._msvc_archs: - raise ConanInvalidConfiguration("Visual Studio does not support this architecture") + self.options.rm_safe("with_bz2") + self.options.rm_safe("with_sqlite3") + self.options.rm_safe("with_tkinter") + self.options.rm_safe("with_lzma") - if not self.options.shared and tools.Version(self._version_number_only) >= "3.10": - raise ConanInvalidConfiguration("Static msvc build disabled (>=3.10) due to \"AttributeError: module 'sys' has no attribute 'winver'\"") - - if self.options.get_safe("with_curses", False) and not self.options["ncurses"].with_widec: - raise ConanInvalidConfiguration("cpython requires ncurses with wide character support") - - def package_id(self): - del self.info.options.env_vars - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + def layout(self): + basic_layout(self, src_folder="src") - @property - def _with_libffi(self): - # cpython 3.7.x on MSVC uses an ancient libffi 2.00-beta (which is not available at cci, and is API/ABI incompatible with current 3.2+) - return self._supports_modules \ - and (self.settings.compiler != "Visual Studio" or tools.Version(self._version_number_only) >= "3.8") + def build_requirements(self): + if Version(self.version) >= "3.11" and not is_msvc(self) and not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.1.0") def requirements(self): - self.requires("zlib/1.2.11") + self.requires("zlib/[>=1.2.11 <2]") if self._supports_modules: - self.requires("openssl/1.1.1l") - self.requires("expat/2.4.1") - if self._with_libffi: - self.requires("libffi/3.2.1") - if tools.Version(self._version_number_only) < "3.8": - self.requires("mpdecimal/2.4.2") - elif tools.Version(self._version_number_only) < "3.10": + self.requires("openssl/[>=1.1 <4]") + self.requires("expat/[>=2.6.2 <3]") + self.requires("libffi/3.4.4") + if Version(self.version) < "3.10" or is_apple_os(self): + # FIXME: mpdecimal > 2.5.0 on MacOS causes the _decimal module to not be importable self.requires("mpdecimal/2.5.0") else: - self.requires("mpdecimal/2.5.0") # FIXME: no 2.5.1 to troubleshoot apple + self.requires("mpdecimal/2.5.1") if self.settings.os != "Windows": - if not tools.is_apple_os(self.settings.os): - self.requires("libuuid/1.0.3") - self.requires("libxcrypt/4.4.25") + if not is_apple_os(self): + self.requires("util-linux-libuuid/2.39.2") + # In <3.9 and lower patch versions of 3.9/10/11, crypt.h was exposed in Python.h + # This was removed in 3.11 and backported: https://github.com/python/cpython/issues/88914 + # For the sake of this recipe, we only have later patch versions, so this version check + # may be slightly inaccurate if a lower patch version is desired. + transitive_crypt = Version(self.version) < "3.9" + self.requires("libxcrypt/4.4.36", transitive_headers=transitive_crypt, transitive_libs=transitive_crypt) if self.options.get_safe("with_bz2"): self.requires("bzip2/1.0.8") if self.options.get_safe("with_gdbm", False): - self.requires("gdbm/1.19") + self.requires("gdbm/1.23") if self.options.get_safe("with_nis", False): # TODO: Add nis when available. raise ConanInvalidConfiguration("nis is not available on CCI (yet)") if self.options.get_safe("with_sqlite3"): - self.requires("sqlite3/3.36.0") + self.requires("sqlite3/3.45.2") if self.options.get_safe("with_tkinter"): self.requires("tk/8.6.10") if self.options.get_safe("with_curses", False): - self.requires("ncurses/6.2") - if self.options.get_safe("with_bsddb", False): - self.requires("libdb/5.3.28") + # Used in a public header + # https://github.com/python/cpython/blob/v3.10.13/Include/py_curses.h#L34 + self.requires("ncurses/6.4", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_lzma", False): - self.requires("xz_utils/5.2.5") + self.requires("xz_utils/5.4.5") + + def package_id(self): + del self.info.options.env_vars + + def validate(self): + if self.options.shared: + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "cpython does not support MT(d) runtime when building a shared cpython library" + ) + if is_msvc(self): + if self.options.optimizations: + raise ConanInvalidConfiguration( + "This recipe does not support optimized MSVC cpython builds (yet)" + ) + # FIXME: should probably throw when cross building + # FIXME: optimizations for Visual Studio, before building the final `build_type`: + # 1. build the MSVC PGInstrument build_type, + # 2. run the instrumented binaries, (PGInstrument should have created a `python.bat` file in the PCbuild folder) + # 3. build the MSVC PGUpdate build_type + if self.settings.build_type == "Debug" and "d" not in msvc_runtime_flag(self): + raise ConanInvalidConfiguration( + "Building debug cpython requires a debug runtime (Debug cpython requires _CrtReportMode" + " symbol, which only debug runtimes define)" + ) + if str(self.settings.arch) not in self._msvc_archs: + raise ConanInvalidConfiguration("Visual Studio does not support this architecture") + if not self.options.shared and Version(self.version) >= "3.10": + # Static CPython on Windows is only loosely supported, see https://github.com/python/cpython/issues/110234 + # 3.10 fails during the test, 3.11 fails during the build (missing symbol that seems to be DLL specific: PyWin_DLLhModule) + raise ConanInvalidConfiguration("Static msvc build disabled (>=3.10) due to \"AttributeError: module 'sys' has no attribute 'winver'\"") + + if self.options.get_safe("with_curses", False) and not self.dependencies["ncurses"].options.with_widec: + raise ConanInvalidConfiguration("cpython requires ncurses with wide character support") + + if self._supports_modules: + if Version(self.version) >= "3.9.0": + if self.dependencies["mpdecimal"].ref.version < Version("2.5.0"): + raise ConanInvalidConfiguration("cpython 3.9.0 (and newer) requires (at least) mpdecimal 2.5.0") + + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == 9 and Version(self.version) >= "3.12": + raise ConanInvalidConfiguration("FIXME: GCC 9 produces an internal compiler error locally, and a link error in CCI") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.libs = [] + def _generate_autotools(self): + tc = AutotoolsToolchain(self, prefix=self.package_folder) + # Not necessary, just cleans up the output + tc.update_configure_args({"--enable-static": None, "--disable-static": None}) yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), + tc.configure_args += [ "--with-doc-strings={}".format(yes_no(self.options.docstrings)), "--with-pymalloc={}".format(yes_no(self.options.pymalloc)), "--with-system-expat", - "--with-system-ffi", "--enable-optimizations={}".format(yes_no(self.options.optimizations)), "--with-lto={}".format(yes_no(self.options.lto)), "--with-pydebug={}".format(yes_no(self.settings.build_type == "Debug")), + "--with-system-libmpdec", + "--with-openssl={}".format(self.dependencies["openssl"].package_folder), ] - if self._is_py2: - conf_args.extend([ - "--enable-unicode={}".format(yes_no(self.options.unicode)), - ]) - if self._is_py3: - conf_args.extend([ - "--with-system-libmpdec", - "--with-openssl={}".format(self.deps_cpp_info["openssl"].rootpath), - "--enable-loadable-sqlite-extensions={}".format(yes_no(not self.options["sqlite3"].omit_load_extension)), - ]) - if self.settings.compiler == "intel": - conf_args.extend(["--with-icc"]) - if tools.get_env("CC") or self.settings.compiler != "gcc": - conf_args.append("--without-gcc") - if self.options.with_tkinter: + if Version(self.version) < "3.12": + tc.configure_args.append("--with-system-ffi") + if Version(self.version) >= "3.10": + tc.configure_args.append("--disable-test-modules") + if self.options.get_safe("with_sqlite3"): + tc.configure_args.append("--enable-loadable-sqlite-extensions={}".format( + yes_no(not self.dependencies["sqlite3"].options.omit_load_extension) + )) + if self.options.with_tkinter and Version(self.version) < "3.11": tcltk_includes = [] tcltk_libs = [] # FIXME: collect using some conan util (https://github.com/conan-io/conan/issues/7656) for dep in ("tcl", "tk", "zlib"): - tcltk_includes += ["-I{}".format(d) for d in self.deps_cpp_info[dep].include_paths] - tcltk_libs += ["-l{}".format(lib) for lib in self.deps_cpp_info[dep].libs] - if self.settings.os == "Linux" and not self.options["tk"].shared: + cpp_info = self.dependencies[dep].cpp_info.aggregated_components() + tcltk_includes += [f"-I{d}" for d in cpp_info.includedirs] + tcltk_libs += [f"-L{lib}" for lib in cpp_info.libdirs] + tcltk_libs += [f"-l{lib}" for lib in cpp_info.libs] + if self.settings.os in ["Linux", "FreeBSD"] and not self.dependencies["tk"].options.shared: # FIXME: use info from xorg.components (x11, xscrnsaver) - tcltk_libs.extend(["-l{}".format(lib) for lib in ("X11", "Xss")]) - conf_args.extend([ + tcltk_libs.extend([f"-l{lib}" for lib in ("X11", "Xss")]) + tc.configure_args += [ "--with-tcltk-includes={}".format(" ".join(tcltk_includes)), "--with-tcltk-libs={}".format(" ".join(tcltk_libs)), - ]) - if self.settings.os in ("Linux", "FreeBSD"): - # Building _testembed fails due to missing pthread/rt symbols - self._autotools.link_flags.append("-lpthread") - - build = None - if tools.cross_building(self) and not tools.cross_building(self, skip_x64_x86=True): - # Building from x86_64 to x86 is not a "real" cross build, so set build == host - build = tools.get_gnu_triplet(str(self.settings.os), str(self.settings.arch), str(self.settings.compiler)) - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder, build=build) - return self._autotools + ] + if not is_apple_os(self): + tc.extra_ldflags.append('-Wl,--as-needed') + + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + if Version(self.version) >= "3.11": + pkgdeps = PkgConfigDeps(self) + pkgdeps.generate() + + def generate(self): + VirtualRunEnv(self).generate(scope="build") + + if is_msvc(self): + # The msbuild generator only works with Visual Studio + deps = MSBuildDeps(self) + deps.generate() + # The toolchain.props is not injected yet, but it also generates VCVars + toolchain = MSBuildToolchain(self) + toolchain.properties["IncludeExternals"] = "true" + toolchain.generate() + else: + self._generate_autotools() + + def _msvc_project_path(self, name): + return os.path.join(self.source_folder, "PCBuild", f"{name}.vcxproj") + + def _regex_replace_in_file(self, filename, pattern, replacement): + content = load(self, filename) + content = re.sub(pattern, replacement, content) + save(self, filename, content) + + def _inject_conan_props_file(self, project_basename, dep_name, condition=True): + if condition: + search = '' + replace_in_file(self, + self._msvc_project_path(project_basename), + search, + search + f'') + + def _patch_setup_py(self): + setup_py = os.path.join(self.source_folder, "setup.py") + if Version(self.version) < "3.10": + replace_in_file(self, setup_py, ":libmpdec.so.2", "mpdec") + + if self.options.get_safe("with_curses", False): + libcurses = self.dependencies["ncurses"].cpp_info.components["libcurses"] + tinfo = self.dependencies["ncurses"].cpp_info.components["tinfo"] + libs = libcurses.libs + libcurses.system_libs + tinfo.libs + tinfo.system_libs + replace_in_file(self, setup_py, + "curses_libs = ", + "curses_libs = {} #".format(repr(libs))) + + if self._supports_modules: + openssl = self.dependencies["openssl"].cpp_info.aggregated_components() + zlib = self.dependencies["zlib"].cpp_info.aggregated_components() + if Version(self.version) < "3.11": + replace_in_file(self, setup_py, + "openssl_includes = ", + f"openssl_includes = {openssl.includedirs + zlib.includedirs} #") + replace_in_file(self, setup_py, + "openssl_libdirs = ", + f"openssl_libdirs = {openssl.libdirs + zlib.libdirs} #") + replace_in_file(self, setup_py, + "openssl_libs = ", + f"openssl_libs = {openssl.libs + zlib.libs} #") + + if Version(self.version) < "3.11": + replace_in_file(self, setup_py, "if (MACOS and self.detect_tkinter_darwin())", "if (False)") + + def _patch_msvc_projects(self): + # Don't build vendored bz2 + self._regex_replace_in_file(self._msvc_project_path("_bz2"), r'.*Include=\"\$\(bz2Dir\).*', "") + + if self._supports_modules: + # Don't import vendored libffi + replace_in_file(self, self._msvc_project_path("_ctypes"), '', "") + if Version(self.version) < "3.11": + # Don't add this define, it should be added conditionally by the libffi package + replace_in_file(self, self._msvc_project_path("_ctypes"), "FFI_BUILDING;", "") + + # Don't import vendored openssl + replace_in_file(self, self._msvc_project_path("_hashlib"), '', "") + replace_in_file(self, self._msvc_project_path("_ssl"), '', "") + + # For mpdecimal, we need to remove all headers and all c files *except* the main module file, _decimal.c + self._regex_replace_in_file(self._msvc_project_path("_decimal"), r'.*Include=\"\.\.\\Modules\\_decimal\\.*\.h.*', "") + self._regex_replace_in_file(self._msvc_project_path("_decimal"), r'.*Include=\"\.\.\\Modules\\_decimal\\libmpdec\\.*\.c.*', "") + # There is also an assembly file with a complicated build step as part of the mpdecimal build + replace_in_file(self, self._msvc_project_path("_decimal"), "", "-->") + # Remove extra include directory + replace_in_file(self, self._msvc_project_path("_decimal"), r"..\Modules\_decimal\libmpdec;", "") + + # Don't include vendored sqlite3 + replace_in_file(self, self._msvc_project_path("_sqlite3"), + '', + '') + + # Remove hardcoded reference to lzma library + replace_in_file(self, self._msvc_project_path("_lzma"), "$(OutDir)liblzma$(PyDebugExt).lib;", "") + # Don't include vendored lzma + replace_in_file(self, self._msvc_project_path("_lzma"), + '', + '') + + # Don't include vendored expat project + replace_in_file(self, self._msvc_project_path("pyexpat"), + r"$(PySourcePath)Modules\expat;", + "") + # Remove XML_STATIC, this should conditionally be set by the expat library. + # TODO: Why HAVE_EXPAT_H? (It is at least removed in later versions) + replace_in_file(self, self._msvc_project_path("pyexpat"), ("HAVE_EXPAT_H;" if Version(self.version) < "3.11" else "") + "XML_STATIC;", "") + self._regex_replace_in_file(self._msvc_project_path("pyexpat"), r'.*Include=\"\.\.\\Modules\\expat\\.*" />', "") + + # Don't include vendored expat headers + replace_in_file(self, self._msvc_project_path("_elementtree"), + r"..\Modules\expat;", + "") + # Remove XML_STATIC, this should conditionally be set by the expat library. + replace_in_file(self, self._msvc_project_path("_elementtree"), "XML_STATIC;", "") + # Remove vendored expat + self._regex_replace_in_file(self._msvc_project_path("_elementtree"), r'.*Include=\"\.\.\\Modules\\expat\\.*" />', "") + + if Version(self.version) >= "3.9": + # deflate.c has warning 4244 disabled, need special patching else it breaks the regex below + # Add an extra space to avoid being picked up by the regex + replace_in_file(self, self._msvc_project_path("pythoncore"), + r'', + r'') + # Don't use vendored zlib + self._regex_replace_in_file(self._msvc_project_path("pythoncore"), r'.*Include=\"\$\(zlibDir\).*', "") + + # Don't use vendored tcl/tk include dir + replace_in_file(self, self._msvc_project_path("_tkinter"), "$(tcltkDir)include;", "") + # Don't use hardcoded tcl/tk library + replace_in_file(self, self._msvc_project_path("_tkinter"), "$(tcltkLib);", "") + # TODO: Why? + replace_in_file(self, self._msvc_project_path("_tkinter"), + "", + "") + # Don't use vendored tcl/tk + self._regex_replace_in_file(self._msvc_project_path("_tkinter"), r'.*Include=\"\$\(tcltkdir\).*', "") + + # Disable "ValidateUcrtbase" target (TODO: Why?) + replace_in_file(self, self._msvc_project_path("python"), "$(Configuration) != 'PGInstrument'", "False") + + if Version(self.version) < "3.11": + # TODO: Why? + replace_in_file(self, self._msvc_project_path("_freeze_importlib"), + "', + r'') + + self._inject_conan_props_file("_bz2", "bzip2", self.options.get_safe("with_bz2")) + self._inject_conan_props_file("_elementtree", "expat", self._supports_modules) + self._inject_conan_props_file("pyexpat", "expat", self._supports_modules) + self._inject_conan_props_file("_hashlib", "openssl", self._supports_modules) + self._inject_conan_props_file("_ssl", "openssl", self._supports_modules) + self._inject_conan_props_file("_sqlite3", "sqlite3", self.options.get_safe("with_sqlite3")) + self._inject_conan_props_file("_tkinter", "tk", self.options.get_safe("with_tkinter")) + self._inject_conan_props_file("pythoncore", "zlib") + self._inject_conan_props_file("python", "zlib") + self._inject_conan_props_file("pythonw", "zlib") + self._inject_conan_props_file("_ctypes", "libffi", self._supports_modules) + self._inject_conan_props_file("_decimal", "mpdecimal", self._supports_modules) + self._inject_conan_props_file("_lzma", "xz_utils", self.options.get_safe("with_lzma")) + self._inject_conan_props_file("_bsddb", "libdb", self.options.get_safe("with_bsddb")) def _patch_sources(self): - for patch in self.conan_data.get("patches",{}).get(self.version, []): - tools.patch(**patch) - if self._is_py3 and tools.Version(self._version_number_only) < "3.10": - tools.replace_in_file(os.path.join(self._source_subfolder, "setup.py"), - ":libmpdec.so.2", "mpdec") - if self.settings.compiler == "Visual Studio": + apply_conandata_patches(self) + # <=3.10 requires a lot of manual injection of dependencies through setup.py + # 3.12 removes setup.py completely, and uses pkgconfig dependencies + # 3.11 is an in awkward transition state where some dependencies use pkgconfig, and others use setup.py + if Version(self.version) < "3.12": + self._patch_setup_py() + if Version(self.version) >= "3.11": + replace_in_file(self, os.path.join(self.source_folder, "configure"), + 'OPENSSL_LIBS="-lssl -lcrypto"', + 'OPENSSL_LIBS="-lssl -lcrypto -lz"') + if is_msvc(self): runtime_library = { "MT": "MultiThreaded", "MTd": "MultiThreadedDebug", "MD": "MultiThreadedDLL", "MDd": "MultiThreadedDebugDLL", - }[str(self.settings.compiler.runtime)] + }[msvc_runtime_flag(self)] self.output.info("Patching runtime") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pyproject.props"), - "MultiThreadedDLL", runtime_library) - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pyproject.props"), - "MultiThreadedDebugDLL", runtime_library) + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pyproject.props"), + "MultiThreadedDLL", runtime_library) + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pyproject.props"), + "MultiThreadedDebugDLL", runtime_library) # Remove vendored packages - tools.rmdir(os.path.join(self._source_subfolder, "Modules", "_decimal", "libmpdec")) - tools.rmdir(os.path.join(self._source_subfolder, "Modules", "expat")) + rmdir(self, os.path.join(self.source_folder, "Modules", "_decimal", "libmpdec")) + rmdir(self, os.path.join(self.source_folder, "Modules", "expat")) - if self.options.get_safe("with_curses", False): - # FIXME: this will link to ALL libraries of ncurses. Only need to link to ncurses(w) (+ eventually tinfo) - tools.replace_in_file(os.path.join(self._source_subfolder, "setup.py"), - "curses_libs = ", - "curses_libs = {} #".format(repr(self.deps_cpp_info["ncurses"].libs + self.deps_cpp_info["ncurses"].system_libs))) + if Version(self.version) < "3.12": + replace_in_file(self, os.path.join(self.source_folder, "Makefile.pre.in"), + "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'", + "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'") # Enable static MSVC cpython if not self.options.shared: - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythoncore.vcxproj"), - "","Py_NO_BUILD_SHARED;") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythoncore.vcxproj"), - "Py_ENABLE_SHARED", "Py_NO_ENABLE_SHARED") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythoncore.vcxproj"), - "DynamicLibrary", "StaticLibrary") - - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "python.vcxproj"), - "", "shlwapi.lib;ws2_32.lib;pathcch.lib;version.lib;%(AdditionalDependencies)") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "python.vcxproj"), - "", "Py_NO_ENABLE_SHARED;") - - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythonw.vcxproj"), - "", "shlwapi.lib;ws2_32.lib;pathcch.lib;version.lib;%(AdditionalDependencies)") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythonw.vcxproj"), - "", "Py_NO_ENABLE_SHARED;%(PreprocessorDefinitions)") - - def _upgrade_single_project_file(self, project_file): - """ - `devenv /upgrade ` will upgrade *ALL* projects referenced by the project. - By temporarily moving the solution project, only one project is upgraded - This is needed for static cpython or for disabled optional dependencies (e.g. tkinter=False) - Restore it afterwards because it is needed to build some targets. - """ - tools.rename(os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln"), - os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln.bak")) - tools.rename(os.path.join(self._source_subfolder, "PCbuild", "pcbuild.proj"), - os.path.join(self._source_subfolder, "PCbuild", "pcbuild.proj.bak")) - with tools.vcvars(self.settings): - self.run("devenv \"{}\" /upgrade".format(project_file), run_environment=True) - tools.rename(os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln.bak"), - os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln")) - tools.rename(os.path.join(self._source_subfolder, "PCbuild", "pcbuild.proj.bak"), - os.path.join(self._source_subfolder, "PCbuild", "pcbuild.proj")) + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythoncore.vcxproj"), + "", + "Py_NO_BUILD_SHARED;") + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythoncore.vcxproj"), + "Py_ENABLE_SHARED", + "Py_NO_ENABLE_SHARED") + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythoncore.vcxproj"), + "DynamicLibrary", + "StaticLibrary") + + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "python.vcxproj"), + "", + "shlwapi.lib;ws2_32.lib;pathcch.lib;version.lib;%(AdditionalDependencies)") + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "python.vcxproj"), + "", + "Py_NO_ENABLE_SHARED;") + + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythonw.vcxproj"), + "", + "shlwapi.lib;ws2_32.lib;pathcch.lib;version.lib;%(AdditionalDependencies)") + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythonw.vcxproj"), + "", + "Py_NO_ENABLE_SHARED;%(PreprocessorDefinitions)") + + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + replace_in_file( + self, os.path.join(self.source_folder, "PCbuild", "pythoncore.vcxproj"), + '', + f'', + ) + + if is_msvc(self): + self._patch_msvc_projects() @property def _solution_projects(self): if self.options.shared: - solution_path = os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln") - projects = set(m.group(1) for m in re.finditer("\"([^\"]+)\\.vcxproj\"", open(solution_path).read())) + solution_path = os.path.join(self.source_folder, "PCbuild", "pcbuild.sln") + projects = set(m.group(1) for m in re.finditer('"([^"]+)\\.vcxproj"', open(solution_path).read())) def project_build(name): if os.path.basename(name) in self._msvc_discarded_projects: @@ -341,39 +484,31 @@ def project_build(name): return False return True - def sort_importance(key): - importance = ( - "pythoncore", # The python library MUST be built first. All modules and executables depend on it - "python", # Build the python executable next (for convenience, when debugging) - ) - try: - return importance.index(key) - except ValueError: - return len(importance) - - projects = sorted((p for p in projects if project_build(p)), key=sort_importance) + projects = list(filter(project_build, projects)) return projects else: - return "pythoncore", "python", "pythonw" + return ["pythoncore", "python", "pythonw"] @property def _msvc_discarded_projects(self): - discarded = {"python_uwp", "pythonw_uwp"} + discarded = { + "python_uwp", + "pythonw_uwp", + "_freeze_importlib", + "sqlite3", + "bdist_wininst", + "liblzma", + "openssl", + "xxlimited", + } if not self.options.with_bz2: discarded.add("bz2") if not self.options.with_sqlite3: discarded.add("_sqlite3") if not self.options.with_tkinter: discarded.add("_tkinter") - if self._is_py2: - # Python 2 Visual Studio projects NOT to build - discarded = discarded.union({"bdist_wininst", "libeay", "ssleay", "sqlite3", "tcl", "tk", "tix"}) - if not self.options.with_bsddb: - discarded.add("_bsddb") - elif self._is_py3: - discarded = discarded.union({"bdist_wininst", "liblzma", "openssl", "sqlite3", "xxlimited"}) - if not self.options.with_lzma: - discarded.add("_lzma") + if not self.options.with_lzma: + discarded.add("_lzma") return discarded @property @@ -381,50 +516,31 @@ def _msvc_archs(self): archs = { "x86": "Win32", "x86_64": "x64", + "armv7": "ARM", + "armv8_32": "ARM", + "armv8": "ARM64", } - if tools.Version(self._version_number_only) >= "3.8": - archs.update({ - "armv7": "ARM", - "armv8_32": "ARM", - "armv8": "ARM64", - }) return archs def _msvc_build(self): msbuild = MSBuild(self) - msbuild_properties = { - "IncludeExternals": "true", - } + msbuild.platform = self._msvc_archs[str(self.settings.arch)] + projects = self._solution_projects - self.output.info("Building {} Visual Studio projects: {}".format(len(projects), projects)) + self.output.info(f"Building {len(projects)} Visual Studio projects: {projects}") - with tools.no_op(): - for project_i, project in enumerate(projects, 1): - self.output.info("[{}/{}] Building project '{}'...".format(project_i, len(projects), project)) - project_file = os.path.join(self._source_subfolder, "PCbuild", project + ".vcxproj") - self._upgrade_single_project_file(project_file) - msbuild.build(project_file, upgrade_project=False, build_type="Debug" if self.settings.build_type == "Debug" else "Release", - platforms=self._msvc_archs, properties=msbuild_properties) + sln = os.path.join(self.source_folder, "PCbuild", "pcbuild.sln") + # FIXME: Solution files do not pick up the toolset automatically. + cmd = msbuild.command(sln, targets=projects) + self.run(f"{cmd} /p:PlatformToolset={msvs_toolset(self)}") def build(self): - # FIXME: these checks belong in validate, but the versions of dependencies are not available there yet - if self._supports_modules: - if tools.Version(self._version_number_only) < "3.8.0": - if tools.Version(self.deps_cpp_info["mpdecimal"].version) >= "2.5.0": - raise ConanInvalidConfiguration("cpython versions lesser then 3.8.0 require a mpdecimal lesser then 2.5.0") - elif tools.Version(self._version_number_only) >= "3.9.0": - if tools.Version(self.deps_cpp_info["mpdecimal"].version) < "2.5.0": - raise ConanInvalidConfiguration("cpython 3.9.0 (and newer) requires (at least) mpdecimal 2.5.0") - - if self._with_libffi: - if tools.Version(self.deps_cpp_info["libffi"].version) >= "3.3" and self.settings.compiler == "Visual Studio" and "d" in str(self.settings.compiler.runtime): - raise ConanInvalidConfiguration("libffi versions >= 3.3 cause 'read access violations' when using a debug runtime (MTd/MDd)") - self._patch_sources() - if self.settings.compiler == "Visual Studio": + if is_msvc(self): self._msvc_build() else: - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() @property @@ -432,44 +548,40 @@ def _msvc_artifacts_path(self): build_subdir_lut = { "x86_64": "amd64", "x86": "win32", + "armv7": "arm32", + "armv8_32": "arm32", + "armv8": "arm64", } - if tools.Version(self._version_number_only) >= "3.8": - build_subdir_lut.update({ - "armv7": "arm32", - "armv8_32": "arm32", - "armv8": "arm64", - }) - return os.path.join(self._source_subfolder, "PCbuild", build_subdir_lut[str(self.settings.arch)]) + return os.path.join(self.source_folder, "PCbuild", build_subdir_lut[str(self.settings.arch)]) @property def _msvc_install_subprefix(self): return "bin" def _copy_essential_dlls(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): # Until MSVC builds support cross building, copy dll's of essential (shared) dependencies to python binary location. # These dll's are required when running the layout tool using the newly built python executable. dest_path = os.path.join(self.build_folder, self._msvc_artifacts_path) - if self._with_libffi: - for bin_path in self.deps_cpp_info["libffi"].bin_paths: - self.copy("*.dll", src=bin_path, dst=dest_path) - for bin_path in self.deps_cpp_info["expat"].bin_paths: - self.copy("*.dll", src=bin_path, dst=dest_path) - for bin_path in self.deps_cpp_info["zlib"].bin_paths: - self.copy("*.dll", src=bin_path, dst=dest_path) + for bin_path in self.dependencies["libffi"].cpp_info.bindirs: + copy(self, "*.dll", src=bin_path, dst=dest_path) + for bin_path in self.dependencies["expat"].cpp_info.bindirs: + copy(self, "*.dll", src=bin_path, dst=dest_path) + for bin_path in self.dependencies["zlib"].cpp_info.bindirs: + copy(self, "*.dll", src=bin_path, dst=dest_path) def _msvc_package_layout(self): self._copy_essential_dlls() install_prefix = os.path.join(self.package_folder, self._msvc_install_subprefix) - tools.mkdir(install_prefix) + mkdir(self, install_prefix) build_path = self._msvc_artifacts_path infix = "_d" if self.settings.build_type == "Debug" else "" # FIXME: if cross building, use a build python executable here - python_built = os.path.join(build_path, "python{}.exe".format(infix)) + python_built = os.path.join(build_path, f"python{infix}.exe") layout_args = [ - os.path.join(self._source_subfolder, "PC", "layout", "main.py"), + os.path.join(self.source_folder, "PC", "layout", "main.py"), "-v", - "-s", self._source_subfolder, + "-s", self.source_folder, "-b", build_path, "--copy", install_prefix, "-p", @@ -481,16 +593,12 @@ def _msvc_package_layout(self): layout_args.append("--include-tcltk") if self.settings.build_type == "Debug": layout_args.append("-d") - python_args = " ".join("\"{}\"".format(a) for a in layout_args) - self.run("{} {}".format(python_built, python_args), run_environment=True) + python_args = " ".join(f'"{a}"' for a in layout_args) + self.run(f"{python_built} {python_args}") - tools.rmdir(os.path.join(self.package_folder, "bin", "tcl")) + rmdir(self, os.path.join(self.package_folder, "bin", "tcl")) - for file in os.listdir(install_prefix): - if re.match("vcruntime.*", file): - os.unlink(os.path.join(install_prefix, file)) - continue - os.unlink(os.path.join(install_prefix, "LICENSE.txt")) + rm(self, "LICENSE.txt", install_prefix) for file in os.listdir(os.path.join(install_prefix, "libs")): if not re.match("python.*", file): os.unlink(os.path.join(install_prefix, "libs", file)) @@ -498,45 +606,130 @@ def _msvc_package_layout(self): def _msvc_package_copy(self): build_path = self._msvc_artifacts_path infix = "_d" if self.settings.build_type == "Debug" else "" - self.copy("*.exe", src=build_path, dst=os.path.join(self.package_folder, self._msvc_install_subprefix)) - self.copy("*.dll", src=build_path, dst=os.path.join(self.package_folder, self._msvc_install_subprefix)) - self.copy("*.pyd", src=build_path, dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "DLLs")) - self.copy("python{}{}.lib".format(self._version_suffix, infix), src=build_path, dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "libs")) - self.copy("*", src=os.path.join(self._source_subfolder, "Include"), dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "include")) - self.copy("pyconfig.h", src=os.path.join(self._source_subfolder, "PC"), dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "include")) - self.copy("*.py", src=os.path.join(self._source_subfolder, "lib"), dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib")) - tools.rmdir(os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib", "test")) + copy(self, "*.exe", + src=build_path, + dst=os.path.join(self.package_folder, self._msvc_install_subprefix)) + copy(self, "*.dll", + src=build_path, + dst=os.path.join(self.package_folder, self._msvc_install_subprefix)) + copy(self, "*.pyd", + src=build_path, + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "DLLs")) + copy(self, f"python{self._version_suffix}{infix}.lib", + src=build_path, + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "libs")) + copy(self, "*", + src=os.path.join(self.source_folder, "Include"), + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "include")) + copy(self, "pyconfig.h", + src=os.path.join(self.source_folder, "PC"), + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "include")) + copy(self, "*.py", + src=os.path.join(self.source_folder, "lib"), + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib")) + rmdir(self, os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib", "test")) packages = {} get_name_version = lambda fn: fn.split(".", 2)[:2] - whldir = os.path.join(self._source_subfolder, "Lib", "ensurepip", "_bundled") + whldir = os.path.join(self.source_folder, "Lib", "ensurepip", "_bundled") for fn in filter(lambda n: n.endswith(".whl"), os.listdir(whldir)): name, version = get_name_version(fn) add = True if name in packages: pname, pversion = get_name_version(packages[name]) - add = tools.Version(version) > tools.Version(pversion) + add = Version(version) > Version(pversion) if add: packages[name] = fn for fname in packages.values(): - tools.unzip(filename=os.path.join(whldir, fname), destination=os.path.join(self.package_folder, "bin", "Lib", "site-packages")) + unzip(self, filename=os.path.join(whldir, fname), + destination=os.path.join(self.package_folder, "bin", "Lib", "site-packages")) + + interpreter_path = os.path.join(build_path, self._cpython_interpreter_name) + lib_dir_path = os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib").replace("\\", "/") + self.run(f"{interpreter_path} -c \"import compileall; compileall.compile_dir('{lib_dir_path}')\"") + + @property + def _exact_lib_name(self): + prefix = "" if self.settings.os == "Windows" else "lib" + if self.settings.os == "Windows": + extension = "lib" + elif not self.options.shared: + extension = "a" + elif is_apple_os(self): + extension = "dylib" + else: + extension = "so" + return f"{prefix}{self._lib_name}.{extension}" + + @property + def _cmake_module_path(self): + if is_msvc(self): + # On Windows, `lib` is for Python modules, `libs` is for compiled objects. + # Usually CMake modules are packaged with the latter. + return os.path.join(self._msvc_install_subprefix, "libs", "cmake") + else: + return os.path.join("lib", "cmake") + + def _write_cmake_findpython_wrapper_file(self): + template = textwrap.dedent(""" + if (DEFINED Python3_VERSION_STRING) + set(_CONAN_PYTHON_SUFFIX "3") + else() + set(_CONAN_PYTHON_SUFFIX "") + endif() + set(Python${_CONAN_PYTHON_SUFFIX}_EXECUTABLE @PYTHON_EXECUTABLE@) + set(Python${_CONAN_PYTHON_SUFFIX}_LIBRARY @PYTHON_LIBRARY@) + + # Fails if these are set beforehand + unset(Python${_CONAN_PYTHON_SUFFIX}_INCLUDE_DIRS) + unset(Python${_CONAN_PYTHON_SUFFIX}_INCLUDE_DIR) + + include(${CMAKE_ROOT}/Modules/FindPython${_CONAN_PYTHON_SUFFIX}.cmake) + + # Sanity check: The former comes from FindPython(3), the latter comes from the injected find module + if(NOT Python${_CONAN_PYTHON_SUFFIX}_VERSION STREQUAL Python${_CONAN_PYTHON_SUFFIX}_VERSION_STRING) + message(FATAL_ERROR "CMake detected wrong cpython version - this is likely a bug with the cpython Conan package") + endif() + + if (TARGET Python${_CONAN_PYTHON_SUFFIX}::Module) + set_target_properties(Python${_CONAN_PYTHON_SUFFIX}::Module PROPERTIES INTERFACE_LINK_LIBRARIES cpython::python) + endif() + if (TARGET Python${_CONAN_PYTHON_SUFFIX}::SABIModule) + set_target_properties(Python${_CONAN_PYTHON_SUFFIX}::SABIModule PROPERTIES INTERFACE_LINK_LIBRARIES cpython::python) + endif() + if (TARGET Python${_CONAN_PYTHON_SUFFIX}::Python) + set_target_properties(Python${_CONAN_PYTHON_SUFFIX}::Python PROPERTIES INTERFACE_LINK_LIBRARIES cpython::embed) + endif() + """) + + # In order for the package to be relocatable, these variables must be relative to the installed CMake file + if is_msvc(self): + python_exe = "${CMAKE_CURRENT_LIST_DIR}/../../" + self._cpython_interpreter_name + python_library = "${CMAKE_CURRENT_LIST_DIR}/../" + self._exact_lib_name + else: + python_exe = "${CMAKE_CURRENT_LIST_DIR}/../../bin/" + self._cpython_interpreter_name + python_library = "${CMAKE_CURRENT_LIST_DIR}/../" + self._exact_lib_name - self.run("{} -c \"import compileall; compileall.compile_dir('{}')\"".format(os.path.join(build_path, self._cpython_interpreter_name), os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib").replace("\\", "/")), - run_environment=True) + cmake_file = os.path.join(self.package_folder, self._cmake_module_path, "use_conan_python.cmake") + content = template.replace("@PYTHON_EXECUTABLE@", python_exe).replace("@PYTHON_LIBRARY@", python_library) + save(self, cmake_file, content) def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - if self.settings.compiler == "Visual Studio": - if self._is_py2 or not self.options.shared: - self._msvc_package_copy() - else: + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + if self.options.shared: self._msvc_package_layout() - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "vcruntime*") + else: + self._msvc_package_copy() + rm(self, "vcruntime*", os.path.join(self.package_folder, "bin"), recursive=True) else: - autotools = self._configure_autotools() - autotools.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + autotools = Autotools(self) + if is_apple_os(self): + # FIXME: See https://github.com/python/cpython/issues/109796, this workaround is mentioned there + autotools.make(target="sharedinstall", args=["DESTDIR="]) + autotools.install(args=["DESTDIR="]) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) # Rewrite shebangs of python scripts for filename in os.listdir(os.path.join(self.package_folder, "bin")): @@ -550,23 +743,25 @@ def package(self): if not(firstline.startswith(b"#!") and b"/python" in firstline and b"/bin/sh" not in firstline): continue text = fn.read() - self.output.info("Rewriting shebang of {}".format(filename)) + self.output.info(f"Rewriting shebang of {filename}") with open(filepath, "wb") as fn: - fn.write(textwrap.dedent("""\ + fn.write(textwrap.dedent(f"""\ #!/bin/sh ''':' __file__="$0" while [ -L "$__file__" ]; do __file__="$(dirname "$__file__")/$(readlink "$__file__")" done - exec "$(dirname "$__file__")/python{}" "$0" "$@" + exec "$(dirname "$__file__")/python{self._version_suffix}" "$0" "$@" ''' - """.format(self._version_suffix)).encode()) + """).encode()) fn.write(text) if not os.path.exists(self._cpython_symlink): - os.symlink("python{}".format(self._version_suffix), self._cpython_symlink) - self._fix_install_name() + os.symlink(f"python{self._version_suffix}", self._cpython_symlink) + fix_apple_shared_install_name(self) + + self._write_cmake_findpython_wrapper_file() @property def _cpython_symlink(self): @@ -577,14 +772,12 @@ def _cpython_symlink(self): @property def _cpython_interpreter_name(self): - if self.settings.compiler == "Visual Studio": - suffix = "" - else: - suffix = self._version_suffix - python = "python{}".format(suffix) - if self.settings.compiler == "Visual Studio": + python = "python" + if is_msvc(self): if self.settings.build_type == "Debug": python += "_d" + else: + python += self._version_suffix if self.settings.os == "Windows": python += ".exe" return python @@ -596,79 +789,71 @@ def _cpython_interpreter_path(self): @property def _abi_suffix(self): res = "" - if self._is_py3: - if self.settings.build_type == "Debug": - res += "d" - if tools.Version(self._version_number_only) < "3.8": - if self.options.get_safe("pymalloc", False): - res += "m" + if self.settings.build_type == "Debug": + res += "d" return res @property def _lib_name(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): if self.settings.build_type == "Debug": lib_ext = "_d" else: lib_ext = "" else: - lib_ext = self._abi_suffix + (".dll.a" if self.options.shared and self.settings.os == "Windows" else "") - return "python{}{}".format(self._version_suffix, lib_ext) - - def _fix_install_name(self): - if tools.is_apple_os(self.settings.os) and self.options.shared: - buffer = StringIO() - python = os.path.join(self.package_folder, "bin", "python") - self.run('otool -L "%s"' % python, output=buffer) - lines = buffer.getvalue().strip().split('\n')[1:] - for line in lines: - library = line.split()[0] - if library.startswith(self.package_folder): - new = library.replace(self.package_folder, "@executable_path/..") - self.output.info("patching {}, replace {} with {}".format(python, library, new)) - self.run("install_name_tool -change {} {} {}".format(library, new, python)) + lib_ext = self._abi_suffix + return f"python{self._version_suffix}{lib_ext}" def package_info(self): - # FIXME: conan components Python::Interpreter component, need a target type - # self.cpp_info.names["cmake_find_package"] = "Python" - # self.cpp_info.names["cmake_find_package_multi"] = "Python" - # FIXME: conan components need to generate multiple .pc files (python2, python-27) - - py_version = tools.Version(self._version_number_only) + py_version = Version(self.version) # python component: "Build a C extension for Python" - if self.settings.compiler == "Visual Studio": + if is_msvc(self): self.cpp_info.components["python"].includedirs = [os.path.join(self._msvc_install_subprefix, "include")] libdir = os.path.join(self._msvc_install_subprefix, "libs") else: - self.cpp_info.components["python"].includedirs.append(os.path.join("include", "python{}{}".format(self._version_suffix, self._abi_suffix))) + self.cpp_info.components["python"].includedirs.append( + os.path.join("include", f"python{self._version_suffix}{self._abi_suffix}") + ) libdir = "lib" if self.options.shared: self.cpp_info.components["python"].defines.append("Py_ENABLE_SHARED") else: self.cpp_info.components["python"].defines.append("Py_NO_ENABLE_SHARED") - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["python"].system_libs.extend(["dl", "m", "pthread", "util"]) elif self.settings.os == "Windows": - self.cpp_info.components["python"].system_libs.extend(["pathcch", "shlwapi", "version", "ws2_32"]) + self.cpp_info.components["python"].system_libs.extend( + ["pathcch", "shlwapi", "version", "ws2_32"] + ) self.cpp_info.components["python"].requires = ["zlib::zlib"] if self.settings.os != "Windows": self.cpp_info.components["python"].requires.append("libxcrypt::libxcrypt") - self.cpp_info.components["python"].names["pkg_config"] = "python-{}.{}".format(py_version.major, py_version.minor) + self.cpp_info.components["python"].set_property( + "pkg_config_name", f"python-{py_version.major}.{py_version.minor}" + ) + self.cpp_info.components["python"].set_property( + "pkg_config_aliases", [f"python{py_version.major}"] + ) self.cpp_info.components["python"].libdirs = [] - self.cpp_info.components["_python_copy"].names["pkg_config"] = "python{}".format(py_version.major) - self.cpp_info.components["_python_copy"].requires = ["python"] - self.cpp_info.components["_python_copy"].libdirs = [] - # embed component: "Embed Python into an application" self.cpp_info.components["embed"].libs = [self._lib_name] self.cpp_info.components["embed"].libdirs = [libdir] - self.cpp_info.components["embed"].names["pkg_config"] = "python-{}.{}-embed".format(py_version.major, py_version.minor) + self.cpp_info.components["embed"].includedirs = [] + self.cpp_info.components["embed"].set_property( + "pkg_config_name", f"python-{py_version.major}.{py_version.minor}-embed" + ) + self.cpp_info.components["embed"].set_property( + "pkg_config_aliases", [f"python{py_version.major}-embed"] + ) self.cpp_info.components["embed"].requires = ["python"] - self.cpp_info.components["_embed_copy"].requires = ["embed"] - self.cpp_info.components["_embed_copy"].names["pkg_config"] = ["python{}-embed".format(py_version.major)] - self.cpp_info.components["_embed_copy"].libdirs = [] + # Transparent integration with CMake's FindPython(3) + self.cpp_info.set_property("cmake_file_name", "Python3") + self.cpp_info.set_property("cmake_module_file_name", "Python") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_build_modules", [os.path.join(self._cmake_module_path, "use_conan_python.cmake")]) + self.cpp_info.builddirs = [self._cmake_module_path] if self._supports_modules: # hidden components: the C extensions of python are built as dynamically loaded shared libraries. @@ -677,12 +862,11 @@ def package_info(self): "openssl::openssl", "expat::expat", "mpdecimal::mpdecimal", + "libffi::libffi", ] - if self._with_libffi: - self.cpp_info.components["_hidden"].requires.append("libffi::libffi") if self.settings.os != "Windows": - if not tools.is_apple_os(self.settings.os): - self.cpp_info.components["_hidden"].requires.append("libuuid::libuuid") + if not is_apple_os(self): + self.cpp_info.components["_hidden"].requires.append("util-linux-libuuid::util-linux-libuuid") self.cpp_info.components["_hidden"].requires.append("libxcrypt::libxcrypt") if self.options.with_bz2: self.cpp_info.components["_hidden"].requires.append("bzip2::bzip2") @@ -692,47 +876,68 @@ def package_info(self): self.cpp_info.components["_hidden"].requires.append("sqlite3::sqlite3") if self.options.get_safe("with_curses", False): self.cpp_info.components["_hidden"].requires.append("ncurses::ncurses") - if self.options.get_safe("with_bsddb"): - self.cpp_info.components["_hidden"].requires.append("libdb::libdb") if self.options.get_safe("with_lzma"): self.cpp_info.components["_hidden"].requires.append("xz_utils::xz_utils") if self.options.get_safe("with_tkinter"): self.cpp_info.components["_hidden"].requires.append("tk::tk") + self.cpp_info.components["_hidden"].includedirs = [] self.cpp_info.components["_hidden"].libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_hidden"].system_libs.append("nsl") if self.options.env_vars: bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.runenv_info.append_path("PATH", bindir) + self.buildenv_info.append_path("PATH", bindir) + + # TODO remove once Conan 1.x is no longer supported + self.output.info(f"Appending PATH environment variable: {bindir}") self.env_info.PATH.append(bindir) python = self._cpython_interpreter_path + self.conf_info.define("user.cpython:python", python) self.user_info.python = python if self.options.env_vars: - self.output.info("Setting PYTHON environment variable: {}".format(python)) + self.runenv_info.append_path("PYTHON", python) + self.buildenv_info.append_path("PYTHON", python) + + # TODO remove once Conan 1.x is no longer supported + self.output.info(f"Appending PYTHON environment variable: {python}") self.env_info.PYTHON = python - if self.settings.compiler == "Visual Studio": + if is_msvc(self): pythonhome = os.path.join(self.package_folder, "bin") - elif tools.is_apple_os(self.settings.os): - pythonhome = self.package_folder else: - version = tools.Version(self._version_number_only) - pythonhome = os.path.join(self.package_folder, "lib", "python{}.{}".format(version.major, version.minor)) + pythonhome = self.package_folder + self.conf_info.define("user.cpython:pythonhome", pythonhome) self.user_info.pythonhome = pythonhome - pythonhome_required = self.settings.compiler == "Visual Studio" or tools.is_apple_os(self.settings.os) + pythonhome_required = is_msvc(self) or is_apple_os(self) + self.conf_info.define("user.cpython:module_requires_pythonhome", pythonhome_required) self.user_info.module_requires_pythonhome = pythonhome_required - if self.settings.compiler == "Visual Studio": + if is_msvc(self): if self.options.env_vars: - self.output.info("Setting PYTHONHOME environment variable: {}".format(pythonhome)) + # FIXME: On Windows, defining this breaks the packaged Python executable, but fixes + # separately built executables with an embedded interpreter trying to run standard Python + # modules. However, NOT defining this reverses the situation, normal Python executables + #work, but embedded interpreters break. + # The docs at https://python.readthedocs.io/en/latest/using/cmdline.html#envvar-PYTHONHOME + # seem to not be accurate to Windows (https://discuss.python.org/t/the-document-on-pythonhome-might-be-wrong/19614/5) + #self.runenv_info.append_path("PYTHONHOME", pythonhome) + #self.buildenv_info.append_path("PYTHONHOME", pythonhome) + + # TODO remove once Conan 1.x is no longer supported + self.output.info(f"Setting PYTHONHOME environment variable: {pythonhome}") self.env_info.PYTHONHOME = pythonhome - if self._is_py2: - python_root = "" - else: - python_root = self.package_folder - if self.options.env_vars: - self.output.info("Setting PYTHON_ROOT environment variable: {}".format(python_root)) - self.env_info.PYTHON_ROOT = python_root + python_root = self.package_folder + if self.options.env_vars: + self.runenv_info.append_path("PYTHON_ROOT", python_root) + self.buildenv_info.append_path("PYTHON_ROOT", python_root) + + # TODO remove once Conan 1.x is no longer supported + self.output.info(f"Setting PYTHON_ROOT environment variable: {python_root}") + self.env_info.PYTHON_ROOT = python_root + self.conf_info.define("user.cpython:python_root", python_root) self.user_info.python_root = python_root diff --git a/recipes/cpython/all/patches/2.7.18-0001-msvc.patch b/recipes/cpython/all/patches/2.7.18-0001-msvc.patch deleted file mode 100644 index 2c101049df531..0000000000000 --- a/recipes/cpython/all/patches/2.7.18-0001-msvc.patch +++ /dev/null @@ -1,278 +0,0 @@ ---- PCbuild/_bsddb.vcxproj -+++ PCbuild/_bsddb.vcxproj -@@ -46,7 +46,7 @@ - NotSet - - -- -+ - - .pyd - -@@ -75,7 +75,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -64,7 +64,7 @@ - $(opensslIncludeDir);%(AdditionalIncludeDirectories) - - -- ws2_32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies) -+ ws2_32.lib;%(AdditionalDependencies) - - - -@@ -75,14 +75,14 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -96,10 +96,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -64,7 +64,7 @@ - $(opensslIncludeDir);%(AdditionalIncludeDirectories) - - -- ws2_32.lib;crypt32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies) -+ ws2_32.lib;crypt32.lib;%(AdditionalDependencies) - - - -@@ -75,14 +75,14 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - {86937f53-c189-40ef-8ce8-8759d8e7d480} - false ---- PCbuild/bz2.vcxproj -+++ PCbuild/bz2.vcxproj -@@ -47,7 +47,7 @@ - NotSet - - -- -+ - - .pyd - -@@ -72,13 +72,13 @@ - - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -61,15 +61,15 @@ - - - -- ..\Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - 0x1D100000 - - - -- -+ - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -58,19 +58,19 @@ - - - -- $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -61,11 +61,11 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -77,12 +77,12 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - diff --git a/recipes/cpython/all/patches/2.7.18-0002-add-support-msvc-14.patch b/recipes/cpython/all/patches/2.7.18-0002-add-support-msvc-14.patch deleted file mode 100644 index 6034410d3d265..0000000000000 --- a/recipes/cpython/all/patches/2.7.18-0002-add-support-msvc-14.patch +++ /dev/null @@ -1,59 +0,0 @@ -Patches from https://bugs.python.org/issue30742 - ---- Modules/posixmodule.c -+++ Modules/posixmodule.c -@@ -563,7 +563,10 @@ typedef struct { - char osfile; - } my_ioinfo; - -+#if _MSC_VER < 1900 // MSVS2013 and lower (https://bugs.python.org/issue30742) - extern __declspec(dllimport) char * __pioinfo[]; -+#endif -+ - #define IOINFO_L2E 5 - #define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) - #define IOINFO_ARRAYS 64 -@@ -575,6 +578,7 @@ extern __declspec(dllimport) char * __pioinfo[]; - int - _PyVerify_fd(int fd) - { -+#if _MSC_VER < 1900 // MSVS2013 and lower (https://bugs.python.org/issue30742) - const int i1 = fd >> IOINFO_L2E; - const int i2 = fd & ((1 << IOINFO_L2E) - 1); - -@@ -607,6 +611,13 @@ _PyVerify_fd(int fd) - fail: - errno = EBADF; - return 0; -+#else -+ //a call to _get_osfhandle with invalid fd sets errno to EBADF -+ if (_get_osfhandle(fd) == INVALID_HANDLE_VALUE) -+ return 0; -+ else -+ return 1; -+#endif - } - - /* the special case of checking dup2. The target fd must be in a sensible range */ ---- Modules/timemodule.c -+++ Modules/timemodule.c -@@ -803,7 +803,18 @@ inittimezone(PyObject *m) { - - And I'm lazy and hate C so nyer. - */ --#if defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__) -+#if defined(HAVE_TZNAME) && (_MSC_VER >= 1900) //MSVS2015+ (https://bugs.python.org/issue30742) -+ tzset(); -+ PyModule_AddIntConstant(m, "timezone", _timezone); -+#ifdef HAVE_ALTZONE -+ PyModule_AddIntConstant(m, "altzone", altzone); -+#else -+ PyModule_AddIntConstant(m, "altzone", _timezone - 3600); -+#endif -+ PyModule_AddIntConstant(m, "daylight", _daylight); -+ PyModule_AddObject(m, "tzname", -+ Py_BuildValue("(zz)", _tzname[0], _tzname[1])); -+#elif defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__) - tzset(); - #ifdef PYOS_OS2 - PyModule_AddIntConstant(m, "timezone", _timezone); diff --git a/recipes/cpython/all/patches/2.7.18-0003-msvc-fix-static.patch b/recipes/cpython/all/patches/2.7.18-0003-msvc-fix-static.patch deleted file mode 100644 index 9eb079402733d..0000000000000 --- a/recipes/cpython/all/patches/2.7.18-0003-msvc-fix-static.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- PC/dl_nt.c -+++ PC/dl_nt.c -@@ -107,5 +107,7 @@ - } - return TRUE; - } -- -+#else -+ULONG_PTR _Py_ActivateActCtx() { return 0; } -+void _Py_DeactivateActCtx(ULONG_PTR cookie) {} - #endif /* Py_ENABLE_SHARED */ diff --git a/recipes/cpython/all/patches/2.7.18-0004-disable-macos-tcltk.patch b/recipes/cpython/all/patches/2.7.18-0004-disable-macos-tcltk.patch deleted file mode 100644 index 5c61acd74bd5c..0000000000000 --- a/recipes/cpython/all/patches/2.7.18-0004-disable-macos-tcltk.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- setup.py -+++ setup.py -@@ -1928,9 +1928,9 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (host_platform == 'darwin' and -- self.detect_tkinter_darwin(inc_dirs, lib_dirs)): -- return -+ #if (host_platform == 'darwin' and -+ # self.detect_tkinter_darwin(inc_dirs, lib_dirs)): -+ # return - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.10.0-0001-msvc.patch b/recipes/cpython/all/patches/3.10.0-0001-msvc.patch deleted file mode 100644 index e9b1faf061f3b..0000000000000 --- a/recipes/cpython/all/patches/3.10.0-0001-msvc.patch +++ /dev/null @@ -1,416 +0,0 @@ ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -58,2 +58,0 @@ --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" --EndProject ---- PCbuild/python.vcxproj -+++ PCbuild/python.vcxproj -@@ -120,1 +120,1 @@ -- -+ ---- PCbuild/_freeze_importlib.vcxproj -+++ PCbuild/_freeze_importlib.vcxproj -@@ -151,1 +151,1 @@ -- -+ --> ---- PCbuild/_bz2.vcxproj -+++ PCbuild/_bz2.vcxproj -@@ -71,7 +71,7 @@ - bz2 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -101,17 +101,17 @@ - - - -- -+ - - -- -- -+ - - - ---- PCbuild/_ctypes.vcxproj -+++ PCbuild/_ctypes.vcxproj -@@ -71,7 +71,7 @@ - _ctypes - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -94,7 +94,7 @@ - - - -- FFI_BUILDING;%(PreprocessorDefinitions) -+ %(PreprocessorDefinitions) - - - /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions) ---- PCbuild/_decimal.vcxproj -+++ PCbuild/_decimal.vcxproj -@@ -71,7 +71,7 @@ - _decimal - Win32Proj - -- -+ - - - DynamicLibrary -@@ -98,11 +98,11 @@ - CONFIG_32;ANSI;%(PreprocessorDefinitions) - CONFIG_64;ANSI;%(PreprocessorDefinitions) - CONFIG_64;MASM;%(PreprocessorDefinitions) -- ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) -+ ..\Modules\_decimal;%(AdditionalIncludeDirectories) - - - -- -+ - - - -- -+ - - -- -+ - - - ---- PCbuild/_lzma.vcxproj -+++ PCbuild/_lzma.vcxproj -@@ -71,7 +71,7 @@ - lzma - Win32Proj - -- -+ - - - DynamicLibrary -@@ -94,10 +94,10 @@ - - - $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) -- WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) -+ $(ConanPreprocessorDefinitions);WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) - - -- $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -111,10 +111,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -74,1 +74,1 @@ -- -+ -@@ -129,4 +129,4 @@ -- -+ ---- PCbuild/pythoncore.vcxproj -+++ PCbuild/pythoncore.vcxproj -@@ -73,1 +73,1 @@ -- -+ -@@ -302,7 +302,7 @@ - - - -- -+ - - - -@@ -496,7 +496,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -71,7 +71,7 @@ - _hashlib - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -71,7 +71,7 @@ - _ssl - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -99,9 +99,9 @@ - - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -71,7 +71,7 @@ - _elementtree - Win32Proj - -- -+ - - - DynamicLibrary -@@ -93,12 +93,12 @@ - - - -- ..\Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - -- -+ - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -71,7 +71,7 @@ - {D06B6426-4762-44CC-8BAD-D79052507F2F} - pyexpat - -- -+ - - - DynamicLibrary -@@ -90,19 +90,19 @@ - - - -- $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -77,7 +77,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -93,12 +93,12 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) -- Py_TCLTK_DIR="$(tcltkDir.TrimEnd('\').Replace('\', '\\'))";%(PreprocessorDefinitions) -+ - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -108,10 +108,10 @@ - - - -- -+ - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -9,9 +9,6 @@ - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" -- ProjectSection(ProjectDependencies) = postProject -- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} -- EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" - EndProject diff --git a/recipes/cpython/all/patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch b/recipes/cpython/all/patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch deleted file mode 100644 index 0288bdae92ee9..0000000000000 --- a/recipes/cpython/all/patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.pre.in -+++ Makefile.pre.in -@@ -627,10 +627,10 @@ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/recipes/cpython/all/patches/3.10.0-0005-disable-macos-tcltk.patch b/recipes/cpython/all/patches/3.10.0-0005-disable-macos-tcltk.patch deleted file mode 100644 index ec23890e0a717..0000000000000 --- a/recipes/cpython/all/patches/3.10.0-0005-disable-macos-tcltk.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- setup.py -+++ setup.py -@@ -2094,8 +2094,8 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (MACOS and self.detect_tkinter_darwin()): -- return True -+ #if (MACOS and self.detect_tkinter_darwin()): -+ # return True - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.10.0-0003-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.10/3.10.0-0003-_ctypes-ffi.patch similarity index 100% rename from recipes/cpython/all/patches/3.10.0-0003-_ctypes-ffi.patch rename to recipes/cpython/all/patches/3.10/3.10.0-0003-_ctypes-ffi.patch diff --git a/recipes/cpython/all/patches/3.11/3.11.7-0001-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.11/3.11.7-0001-_ctypes-ffi.patch new file mode 100644 index 0000000000000..65027b60406fd --- /dev/null +++ b/recipes/cpython/all/patches/3.11/3.11.7-0001-_ctypes-ffi.patch @@ -0,0 +1,37 @@ +diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c +index 9bdf1db856..799f99e809 100644 +--- a/Modules/_ctypes/cfield.c ++++ b/Modules/_ctypes/cfield.c +@@ -1473,7 +1473,11 @@ P_get(void *ptr, Py_ssize_t size) + return PyLong_FromVoidPtr(*(void **)ptr); + } + +-static struct fielddesc formattable[] = { ++#define FORMATTABLE_SIZE 30 ++static struct fielddesc formattable[FORMATTABLE_SIZE]; ++ ++static void formattable_init(void) { ++struct fielddesc my_formattable[] = { + { 's', s_set, s_get, NULL}, + { 'b', b_set, b_get, NULL}, + { 'B', B_set, B_get, NULL}, +@@ -1510,6 +1514,11 @@ static struct fielddesc formattable[] = { + { 'O', O_set, O_get, NULL}, + { 0, NULL, NULL, NULL}, + }; ++ size_t nb = 1; ++ for (struct fielddesc *pos = my_formattable; pos->code; ++pos, ++nb); ++ if (FORMATTABLE_SIZE < nb) abort(); ++ memcpy(formattable, my_formattable, nb * sizeof(struct fielddesc)); ++} + + /* + Ideas: Implement VARIANT in this table, using 'V' code. +@@ -1597,6 +1606,7 @@ _ctypes_get_fielddesc(const char *fmt) + + if (!initialized) { + initialized = 1; ++ formattable_init(); + _ctypes_init_fielddesc(); + } + diff --git a/recipes/cpython/all/patches/3.12/3.12.1-0001-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.12/3.12.1-0001-_ctypes-ffi.patch new file mode 100644 index 0000000000000..06bb62c5abd9f --- /dev/null +++ b/recipes/cpython/all/patches/3.12/3.12.1-0001-_ctypes-ffi.patch @@ -0,0 +1,37 @@ +diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c +index 128506a9ee..ee9ade67b8 100644 +--- a/Modules/_ctypes/cfield.c ++++ b/Modules/_ctypes/cfield.c +@@ -1448,7 +1448,11 @@ P_get(void *ptr, Py_ssize_t size) + return PyLong_FromVoidPtr(*(void **)ptr); + } + +-static struct fielddesc formattable[] = { ++#define FORMATTABLE_SIZE 30 ++static struct fielddesc formattable[FORMATTABLE_SIZE]; ++ ++static void formattable_init(void) { ++struct fielddesc my_formattable[] = { + { 's', s_set, s_get, NULL}, + { 'b', b_set, b_get, NULL}, + { 'B', B_set, B_get, NULL}, +@@ -1485,6 +1489,11 @@ static struct fielddesc formattable[] = { + { 'O', O_set, O_get, NULL}, + { 0, NULL, NULL, NULL}, + }; ++ size_t nb = 1; ++ for (struct fielddesc *pos = my_formattable; pos->code; ++pos, ++nb); ++ if (FORMATTABLE_SIZE < nb) abort(); ++ memcpy(formattable, my_formattable, nb * sizeof(struct fielddesc)); ++} + + /* + Ideas: Implement VARIANT in this table, using 'V' code. +@@ -1572,6 +1581,7 @@ _ctypes_get_fielddesc(const char *fmt) + + if (!initialized) { + initialized = 1; ++ formattable_init(); + _ctypes_init_fielddesc(); + } + diff --git a/recipes/cpython/all/patches/3.12/3.12.1-0002-remove-module-deps.patch b/recipes/cpython/all/patches/3.12/3.12.1-0002-remove-module-deps.patch new file mode 100644 index 0000000000000..1d9d31f011d72 --- /dev/null +++ b/recipes/cpython/all/patches/3.12/3.12.1-0002-remove-module-deps.patch @@ -0,0 +1,50 @@ +diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln +index bdddec60da..f6a30955bf 100644 +--- a/PCbuild/pcbuild.sln ++++ b/PCbuild/pcbuild.sln +@@ -9,45 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution + EndProjectSection + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" +- ProjectSection(ProjectDependencies) = postProject +- {9E48B300-37D1-11DD-8C41-005056C00008} = {9E48B300-37D1-11DD-8C41-005056C00008} +- {9EC7190A-249F-4180-A900-548FDCF3055F} = {9EC7190A-249F-4180-A900-548FDCF3055F} +- {78D80A15-BD8C-44E2-B49E-1F05B0A0A687} = {78D80A15-BD8C-44E2-B49E-1F05B0A0A687} +- {6901D91C-6E48-4BB7-9FEC-700C8131DF1D} = {6901D91C-6E48-4BB7-9FEC-700C8131DF1D} +- {54B1431F-B86B-4ACB-B28C-88BCF93191D8} = {54B1431F-B86B-4ACB-B28C-88BCF93191D8} +- {F749B822-B489-4CA5-A3AD-CE078F5F338A} = {F749B822-B489-4CA5-A3AD-CE078F5F338A} +- {D06B6426-4762-44CC-8BAD-D79052507F2F} = {D06B6426-4762-44CC-8BAD-D79052507F2F} +- {36D0C52C-DF4E-45D0-8BC7-E294C3ABC781} = {36D0C52C-DF4E-45D0-8BC7-E294C3ABC781} +- {CB435430-EBB1-478B-8F4E-C256F6838F55} = {CB435430-EBB1-478B-8F4E-C256F6838F55} +- {17E1E049-C309-4D79-843F-AE483C264AEA} = {17E1E049-C309-4D79-843F-AE483C264AEA} +- {384C224A-7474-476E-A01B-750EA7DE918C} = {384C224A-7474-476E-A01B-750EA7DE918C} +- {12728250-16EC-4DC6-94D7-E21DD88947F8} = {12728250-16EC-4DC6-94D7-E21DD88947F8} +- {86937F53-C189-40EF-8CE8-8759D8E7D480} = {86937F53-C189-40EF-8CE8-8759D8E7D480} +- {28B5D777-DDF2-4B6B-B34F-31D938813856} = {28B5D777-DDF2-4B6B-B34F-31D938813856} +- {31FFC478-7B4A-43E8-9954-8D03E2187E9C} = {31FFC478-7B4A-43E8-9954-8D03E2187E9C} +- {F9D71780-F393-11E0-BE50-0800200C9A66} = {F9D71780-F393-11E0-BE50-0800200C9A66} +- {494BAC80-A60C-43A9-99E7-ACB691CE2C4D} = {494BAC80-A60C-43A9-99E7-ACB691CE2C4D} +- {C6E20F84-3247-4AD6-B051-B073268F73BA} = {C6E20F84-3247-4AD6-B051-B073268F73BA} +- {B244E787-C445-441C-BDF4-5A4F1A3A1E51} = {B244E787-C445-441C-BDF4-5A4F1A3A1E51} +- {18CAE28C-B454-46C1-87A0-493D91D97F03} = {18CAE28C-B454-46C1-87A0-493D91D97F03} +- {13CECB97-4119-4316-9D42-8534019A5A44} = {13CECB97-4119-4316-9D42-8534019A5A44} +- {885D4898-D08D-4091-9C40-C700CFE3FC5A} = {885D4898-D08D-4091-9C40-C700CFE3FC5A} +- {447F05A8-F581-4CAC-A466-5AC7936E207E} = {447F05A8-F581-4CAC-A466-5AC7936E207E} +- {ECC7CEAC-A5E5-458E-BB9E-2413CC847881} = {ECC7CEAC-A5E5-458E-BB9E-2413CC847881} +- {4946ECAC-2E69-4BF8-A90A-F5136F5094DF} = {4946ECAC-2E69-4BF8-A90A-F5136F5094DF} +- {FDB84CBB-2FB6-47C8-A2D6-091E0833239D} = {FDB84CBB-2FB6-47C8-A2D6-091E0833239D} +- {73FCD2BD-F133-46B7-8EC1-144CD82A59D5} = {73FCD2BD-F133-46B7-8EC1-144CD82A59D5} +- {2097F1C1-597C-4167-93E3-656A7D6339B2} = {2097F1C1-597C-4167-93E3-656A7D6339B2} +- {A2697BD3-28C1-4AEC-9106-8B748639FD16} = {A2697BD3-28C1-4AEC-9106-8B748639FD16} +- {900342D7-516A-4469-B1AD-59A66E49A25F} = {900342D7-516A-4469-B1AD-59A66E49A25F} +- {6DAC66D9-E703-4624-BE03-49112AB5AA62} = {6DAC66D9-E703-4624-BE03-49112AB5AA62} +- {0E9791DB-593A-465F-98BC-681011311617} = {0E9791DB-593A-465F-98BC-681011311617} +- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} +- {EB6E69DD-04BF-4543-9B92-49FAABCEAC2E} = {EB6E69DD-04BF-4543-9B92-49FAABCEAC2E} +- {16BFE6F0-22EF-40B5-B831-7E937119EF10} = {16BFE6F0-22EF-40B5-B831-7E937119EF10} +- {FCBE1EF2-E0F0-40B1-88B5-00A35D378742} = {FCBE1EF2-E0F0-40B1-88B5-00A35D378742} +- {A840DDFB-ED50-484B-B527-B32E7CF90FD5} = {A840DDFB-ED50-484B-B527-B32E7CF90FD5} +- EndProjectSection + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" + ProjectSection(ProjectDependencies) = postProject diff --git a/recipes/cpython/all/patches/3.7.9-0001-msvc.patch b/recipes/cpython/all/patches/3.7.9-0001-msvc.patch deleted file mode 100644 index 29be01b13f5b5..0000000000000 --- a/recipes/cpython/all/patches/3.7.9-0001-msvc.patch +++ /dev/null @@ -1,416 +0,0 @@ ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -58,2 +58,0 @@ --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" --EndProject ---- PCbuild/python.vcxproj -+++ PCbuild/python.vcxproj -@@ -85,1 +85,1 @@ -- -+ ---- PCbuild/_freeze_importlib.vcxproj -+++ PCbuild/_freeze_importlib.vcxproj -@@ -110,1 +110,1 @@ -- -+ --> ---- PCbuild/_bz2.vcxproj -+++ PCbuild/_bz2.vcxproj -@@ -39,7 +39,7 @@ - bz2 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -69,17 +69,17 @@ - - - -- -+ - - -- -- -+ - - - ---- PCbuild/_decimal.vcxproj -+++ PCbuild/_decimal.vcxproj -@@ -39,7 +39,7 @@ - _decimal - Win32Proj - -- -+ - - - DynamicLibrary -@@ -64,11 +64,11 @@ - _CRT_SECURE_NO_WARNINGS;MASM;%(PreprocessorDefinitions) - CONFIG_32;PPRO;%(PreprocessorDefinitions) - CONFIG_64;%(PreprocessorDefinitions) -- ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) -+ ..\Modules\_decimal;%(AdditionalIncludeDirectories) - - - -- -+ - - - -- -+ - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -39,7 +39,7 @@ - _elementtree - Win32Proj - -- -+ - - - DynamicLibrary -@@ -65,8 +65,8 @@ -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - -- -+ - - - -- -+ - - - ---- PCbuild/_lzma.vcxproj -+++ PCbuild/_lzma.vcxproj -@@ -39,7 +39,7 @@ - lzma - Win32Proj - -- -+ - - - DynamicLibrary -@@ -62,10 +62,10 @@ - - - $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) -- WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) -+ $(ConanPreprocessorDefinitions);WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) - - -- $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -79,10 +79,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -39,7 +39,7 @@ - _sqlite3 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -95,10 +95,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/openssl.vcxproj -+++ PCbuild/openssl.vcxproj -@@ -74,6 +74,6 @@ nmake - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -39,7 +39,7 @@ - {D06B6426-4762-44CC-8BAD-D79052507F2F} - pyexpat - -- -+ - - - DynamicLibrary -@@ -58,19 +58,19 @@ - - - -- $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/pythoncore.vcxproj -+++ PCbuild/pythoncore.vcxproj -@@ -38,7 +38,7 @@ - {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} - pythoncore - -- -+ - - - DynamicLibrary -@@ -215,7 +215,7 @@ - - - -- -+ - - - -@@ -409,7 +409,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -39,7 +39,7 @@ - _hashlib - Win32Proj - -- -+ - - - DynamicLibrary -@@ -54,7 +54,7 @@ - - - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -39,7 +39,7 @@ - _ssl - Win32Proj - -- -+ - - - DynamicLibrary -@@ -54,7 +54,7 @@ - - - -- -+ - - - -@@ -67,9 +67,9 @@ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -61,12 +61,12 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) -- Py_TCLTK_DIR="$(tcltkDir.TrimEnd('\').Replace('\', '\\'))";%(PreprocessorDefinitions) -+ - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -76,10 +76,10 @@ - - - -- -+ - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -9,9 +9,6 @@ - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" -- ProjectSection(ProjectDependencies) = postProject -- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} -- EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" - EndProject diff --git a/recipes/cpython/all/patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch b/recipes/cpython/all/patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch deleted file mode 100644 index 92e44c8ea6ee5..0000000000000 --- a/recipes/cpython/all/patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.pre.in -+++ Makefile.pre.in -@@ -618,10 +618,10 @@ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/recipes/cpython/all/patches/3.7.9-0003-disable-macos-tcltk.patch b/recipes/cpython/all/patches/3.7.9-0003-disable-macos-tcltk.patch deleted file mode 100644 index f5ffba2f61232..0000000000000 --- a/recipes/cpython/all/patches/3.7.9-0003-disable-macos-tcltk.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- setup.py -+++ setup.py -@@ -1829,9 +1829,9 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (host_platform == 'darwin' and -- self.detect_tkinter_darwin(inc_dirs, lib_dirs)): -- return -+ #if (host_platform == 'darwin' and -+ # self.detect_tkinter_darwin(inc_dirs, lib_dirs)): -+ # return - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.8.12-0001-msvc.patch b/recipes/cpython/all/patches/3.8.12-0001-msvc.patch deleted file mode 100644 index 4e390810d2dde..0000000000000 --- a/recipes/cpython/all/patches/3.8.12-0001-msvc.patch +++ /dev/null @@ -1,431 +0,0 @@ ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -60,2 +60,0 @@ --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" --EndProject ---- PCbuild/python.vcxproj -+++ PCbuild/python.vcxproj -@@ -118,1 +118,1 @@ -- -+ ---- PCbuild/_freeze_importlib.vcxproj -+++ PCbuild/_freeze_importlib.vcxproj -@@ -149,1 +149,1 @@ -- -+ --> ---- PCbuild/_bz2.vcxproj -+++ PCbuild/_bz2.vcxproj -@@ -71,7 +71,7 @@ - bz2 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -101,17 +101,17 @@ - - - -- -+ - - -- -- -+ - - - ---- PCbuild/_ctypes.vcxproj -+++ PCbuild/_ctypes.vcxproj -@@ -71,7 +71,7 @@ - _ctypes - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -94,7 +94,7 @@ - - - -- FFI_BUILDING;%(PreprocessorDefinitions) -+ %(PreprocessorDefinitions) - - - /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions) ---- PCbuild/_decimal.vcxproj -+++ PCbuild/_decimal.vcxproj -@@ -71,7 +71,7 @@ - _decimal - Win32Proj - -- -+ - - - DynamicLibrary -@@ -98,11 +98,11 @@ - CONFIG_32;ANSI;%(PreprocessorDefinitions) - CONFIG_64;ANSI;%(PreprocessorDefinitions) - CONFIG_64;%(PreprocessorDefinitions) -- ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) -+ ..\Modules\_decimal;%(AdditionalIncludeDirectories) - - - -- -+ - - - -- -+ - - -- -+ - - - ---- PCbuild/_lzma.vcxproj -+++ PCbuild/_lzma.vcxproj -@@ -71,7 +71,7 @@ - lzma - Win32Proj - -- -+ - - - DynamicLibrary -@@ -94,10 +94,10 @@ - - - $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) -- WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) -+ $(ConanPreprocessorDefinitions);WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) - - -- $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -111,10 +111,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -71,7 +71,7 @@ - _sqlite3 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -127,10 +127,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/pythoncore.vcxproj -+++ PCbuild/pythoncore.vcxproj -@@ -70,7 +70,7 @@ - {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} - pythoncore - -- -+ - - - DynamicLibrary -@@ -272,7 +272,7 @@ - - - -- -+ - - - -@@ -468,7 +468,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -71,7 +71,7 @@ - _hashlib - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -71,7 +71,7 @@ - _ssl - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -99,9 +99,9 @@ - - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -71,7 +71,7 @@ - _elementtree - Win32Proj - -- -+ - - - DynamicLibrary -@@ -93,12 +93,12 @@ - - - -- ..\Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - -- -+ - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -71,7 +71,7 @@ - {D06B6426-4762-44CC-8BAD-D79052507F2F} - pyexpat - -- -+ - - - DynamicLibrary -@@ -91,18 +91,18 @@ - - - $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions) -+ _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -77,7 +77,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -93,12 +93,12 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) -- Py_TCLTK_DIR="$(tcltkDir.TrimEnd('\').Replace('\', '\\'))";%(PreprocessorDefinitions) -+ - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -108,10 +108,10 @@ - - - -- -+ - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -9,9 +9,6 @@ - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" -- ProjectSection(ProjectDependencies) = postProject -- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} -- EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" - EndProject diff --git a/recipes/cpython/all/patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch b/recipes/cpython/all/patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch deleted file mode 100644 index 21527d0ed307f..0000000000000 --- a/recipes/cpython/all/patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.pre.in -+++ Makefile.pre.in -@@ -606,10 +606,10 @@ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/recipes/cpython/all/patches/3.8.12-0004-disable-macos-tcltk.patch b/recipes/cpython/all/patches/3.8.12-0004-disable-macos-tcltk.patch deleted file mode 100644 index 90af822b58070..0000000000000 --- a/recipes/cpython/all/patches/3.8.12-0004-disable-macos-tcltk.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- setup.py -+++ setup.py -@@ -1838,8 +1838,8 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (MACOS and self.detect_tkinter_darwin()): -- return True -+ #if (MACOS and self.detect_tkinter_darwin()): -+ # return True - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.8.12-0002-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.8/3.8.12-0002-_ctypes-ffi.patch similarity index 100% rename from recipes/cpython/all/patches/3.8.12-0002-_ctypes-ffi.patch rename to recipes/cpython/all/patches/3.8/3.8.12-0002-_ctypes-ffi.patch diff --git a/recipes/cpython/all/patches/3.9.7-0001-msvc.patch b/recipes/cpython/all/patches/3.9.7-0001-msvc.patch deleted file mode 100644 index fac9247123880..0000000000000 --- a/recipes/cpython/all/patches/3.9.7-0001-msvc.patch +++ /dev/null @@ -1,434 +0,0 @@ ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -60,2 +60,0 @@ --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" --EndProject ---- PCbuild/python.vcxproj -+++ PCbuild/python.vcxproj -@@ -118,1 +118,1 @@ -- -+ ---- PCbuild/_freeze_importlib.vcxproj -+++ PCbuild/_freeze_importlib.vcxproj -@@ -149,1 +149,1 @@ -- -+ --> ---- PCbuild/_bz2.vcxproj -+++ PCbuild/_bz2.vcxproj -@@ -71,7 +71,7 @@ - bz2 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -101,17 +101,17 @@ - - - -- -+ - - -- -- -+ - - - ---- PCbuild/_ctypes.vcxproj -+++ PCbuild/_ctypes.vcxproj -@@ -71,7 +71,7 @@ - _ctypes - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -94,7 +94,7 @@ - - - -- FFI_BUILDING;%(PreprocessorDefinitions) -+ %(PreprocessorDefinitions) - - - /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions) ---- PCbuild/_decimal.vcxproj -+++ PCbuild/_decimal.vcxproj -@@ -71,7 +71,7 @@ - _decimal - Win32Proj - -- -+ - - - DynamicLibrary -@@ -98,11 +98,11 @@ - CONFIG_32;ANSI;%(PreprocessorDefinitions) - CONFIG_64;ANSI;%(PreprocessorDefinitions) - CONFIG_64;%(PreprocessorDefinitions) -- ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) -+ ..\Modules\_decimal;%(AdditionalIncludeDirectories) - - - -- -+ - - - -- -+ - - -- -+ - - - ---- PCbuild/_lzma.vcxproj -+++ PCbuild/_lzma.vcxproj -@@ -71,7 +71,7 @@ - lzma - Win32Proj - -- -+ - - - DynamicLibrary -@@ -94,10 +94,10 @@ - - - $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) -- WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) -+ $(ConanPreprocessorDefinitions);WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) - - -- $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -111,10 +111,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -71,7 +71,7 @@ - _sqlite3 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -127,10 +127,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/pythoncore.vcxproj -+++ PCbuild/pythoncore.vcxproj -@@ -70,7 +70,7 @@ - {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} - pythoncore - -- -+ - - - DynamicLibrary -@@ -295,7 +295,7 @@ - - - -- -+ - - - -@@ -497,7 +497,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -71,7 +71,7 @@ - _hashlib - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -71,7 +71,7 @@ - _ssl - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -99,9 +99,9 @@ - - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -71,7 +71,7 @@ - _elementtree - Win32Proj - -- -+ - - - DynamicLibrary -@@ -93,12 +93,12 @@ - - - -- ..\Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - -- -+ - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -71,7 +71,7 @@ - {D06B6426-4762-44CC-8BAD-D79052507F2F} - pyexpat - -- -+ - - - DynamicLibrary -@@ -90,19 +90,19 @@ - - - -- $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -77,7 +77,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -93,12 +93,12 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) -- Py_TCLTK_DIR="$(tcltkDir.TrimEnd('\').Replace('\', '\\'))";%(PreprocessorDefinitions) -+ - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -108,10 +108,10 @@ - - - -- -+ - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -9,9 +9,6 @@ - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" -- ProjectSection(ProjectDependencies) = postProject -- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} -- EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" - EndProject diff --git a/recipes/cpython/all/patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch b/recipes/cpython/all/patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch deleted file mode 100644 index 0bec735b3653d..0000000000000 --- a/recipes/cpython/all/patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.pre.in -+++ Makefile.pre.in -@@ -630,10 +630,10 @@ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/recipes/cpython/all/patches/3.9.7-0005-disable-macos-tcltk.patch b/recipes/cpython/all/patches/3.9.7-0005-disable-macos-tcltk.patch deleted file mode 100644 index 68a48853b3089..0000000000000 --- a/recipes/cpython/all/patches/3.9.7-0005-disable-macos-tcltk.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- setup.py -+++ setup.py -@@ -1986,8 +1986,8 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (MACOS and self.detect_tkinter_darwin()): -- return True -+ #if (MACOS and self.detect_tkinter_darwin()): -+ # return True - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.9.7-0002-_msi-vcxproj.patch b/recipes/cpython/all/patches/3.9/3.9.7-0002-_msi-vcxproj.patch similarity index 100% rename from recipes/cpython/all/patches/3.9.7-0002-_msi-vcxproj.patch rename to recipes/cpython/all/patches/3.9/3.9.7-0002-_msi-vcxproj.patch diff --git a/recipes/cpython/all/patches/3.9.7-0003-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.9/3.9.7-0003-_ctypes-ffi.patch similarity index 100% rename from recipes/cpython/all/patches/3.9.7-0003-_ctypes-ffi.patch rename to recipes/cpython/all/patches/3.9/3.9.7-0003-_ctypes-ffi.patch diff --git a/recipes/cpython/all/patches/3.x-0002-remove-module-deps.patch b/recipes/cpython/all/patches/3.x-0002-remove-module-deps.patch new file mode 100644 index 0000000000000..38a642520abb1 --- /dev/null +++ b/recipes/cpython/all/patches/3.x-0002-remove-module-deps.patch @@ -0,0 +1,10 @@ +--- PCbuild/pcbuild.sln ++++ PCbuild/pcbuild.sln +@@ -9,7 +9,4 @@ + EndProjectSection + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" +- ProjectSection(ProjectDependencies) = postProject +- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} +- EndProjectSection + EndProject diff --git a/recipes/cpython/all/test_package/CMakeLists.txt b/recipes/cpython/all/test_package/CMakeLists.txt index 525329324757f..68886bdf4d074 100644 --- a/recipes/cpython/all/test_package/CMakeLists.txt +++ b/recipes/cpython/all/test_package/CMakeLists.txt @@ -1,100 +1,21 @@ -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(Python3 REQUIRED COMPONENTS Interpreter Development.Module Development.Embed) -set(CACHE PY_VERSION_MAJOR "" CACHE STRING "MAJOR version of python") -set(CACHE PY_VERSION_MAJOR_MINOR "" CACHE STRING "MAJOR.MINOR version of python") -set(CACHE PY_VERSION "" CACHE STRING "Required version of python") -set(CACHE PY_VERSION_SUFFIX "" CACHE STRING "Suffix of python") - -set(Python_ADDITIONAL_VERSIONS ${PY_VERSION}${PY_VERSION_SUFFIX} ${PY_VERSION_MAJOR_MINOR}${PY_VERSION_SUFFIX} ${PY_VERSION_MAJOR}${PY_VERSION_SUFFIX} ${PY_VERSION} ${PY_VERSION_MAJOR_MINOR} ${PY_VERSION_MAJOR}) -message("Using Python_ADDITIONAL_VERSIONS: ${Python_ADDITIONAL_VERSIONS}") - -find_package(PythonInterp REQUIRED) -find_package(PythonLibs REQUIRED) - -string(FIND "${PYTHON_EXECUTABLE}" "${CONAN_CPYTHON_ROOT}" ROOT_SUBPOS) -if(ROOT_SUBPOS EQUAL -1) - message(FATAL_ERROR "found wrong python interpreter: ${PYTHON_EXECUTABLE}") -endif() - -message(STATUS "FindPythonInterp:") -message(STATUS "PYTHON_VERSION_STRING: ${PYTHON_VERSION_STRING}") -message(STATUS "PYTHON_VERSION_MAJOR: ${PYTHON_VERSION_MAJOR}") -message(STATUS "PYTHON_VERSION_MINOR: ${PYTHON_VERSION_MINOR}") -message(STATUS "PYTHON_VERSION_PATCH: ${PYTHON_VERSION_PATCH}") -message(STATUS "=============================================") -message(STATUS "FindPythonLibs:") -message(STATUS "PYTHON_LIBRARIES: ${PYTHON_LIBRARIES}") -message(STATUS "PYTHON_INCLUDE_PATH: ${PYTHON_INCLUDE_PATH} (deprecated)") -message(STATUS "PYTHON_INCLUDE_DIRS: ${PYTHON_INCLUDE_DIRS}") -message(STATUS "PYTHON_DEBUG_LIBRARIES: ${PYTHON_DEBUG_LIBRARIES} (deprecated)") -message(STATUS "PYTHONLIBS_VERSION_STRING: ${PYTHONLIBS_VERSION_STRING}") - -if(NOT PYTHON_VERSION_STRING AND NOT PYTHONLIBS_VERSION_STRING) - message(FATAL_ERROR "Version of python interpreter and libraries not found") -endif() - -if(PYTHON_VERSION_STRING) - if(NOT PYTHON_VERSION_STRING VERSION_EQUAL "${PY_VERSION}") - message("PYTHON_VERSION_STRING does not match PY_VERSION") - message(FATAL_ERROR "CMake detected wrong cpython version") - endif() -endif() - -if(PYTHONLIBS_VERSION_STRING) - if(NOT PYTHONLIBS_VERSION_STRING STREQUAL "${PY_FULL_VERSION}") - message("PYTHONLIBS_VERSION_STRING does not match PY_FULL_VERSION") - message(FATAL_ERROR "CMake detected wrong cpython version") - endif() -endif() +message("Python3_EXECUTABLE: ${Python3_EXECUTABLE}") +message("Python3_INTERPRETER_ID: ${Python3_INTERPRETER_ID}") +message("Python3_VERSION: ${Python3_VERSION}") +message("Python3_INCLUDE_DIRS: ${Python3_INCLUDE_DIRS}") +message("Python3_LIBRARIES: ${Python3_LIBRARIES}") option(BUILD_MODULE "Build python module") - if(BUILD_MODULE) - add_library(spam MODULE "py${PY_VERSION_MAJOR}/test_module.c") - target_include_directories(spam - PRIVATE - ${PYTHON_INCLUDE_DIRS} - ) - target_link_libraries(spam PRIVATE - ${PYTHON_LIBRARIES} - ) - set_property(TARGET spam PROPERTY PREFIX "") + python3_add_library(spam "test_module.c") if(MSVC) - if(CONAN_SETTINGS_BUILD_TYPE STREQUAL "Debug") - set(SUFFIX "_d.pyd") - else() - set(SUFFIX ".pyd") - endif() - set_property(TARGET spam PROPERTY SUFFIX "${SUFFIX}") - endif() - - option(USE_FINDPYTHON_X "Use new-style FindPythonX module") - if(USE_FINDPYTHON_X AND NOT (CMAKE_VERSION VERSION_LESS "3.16")) - # Require CMake 3.16 because this version introduces Python${PY_VERSION_MAJOR}_FIND_ABI - find_package(Python${PY_VERSION_MAJOR} REQUIRED COMPONENTS Interpreter Development) - message("Python${PY_VERSION_MAJOR}_EXECUTABLE: ${Python${PY_VERSION_MAJOR}_EXECUTABLE}") - message("Python${PY_VERSION_MAJOR}_INTERPRETER_ID: ${Python${PY_VERSION_MAJOR}_INTERPRETER_ID}") - message("Python${PY_VERSION_MAJOR}_VERSION: ${Python${PY_VERSION_MAJOR}_VERSION}") - message("Python${PY_VERSION_MAJOR}_INCLUDE_DIRS: ${Python${PY_VERSION_MAJOR}_INCLUDE_DIRS}") - message("Python${PY_VERSION_MAJOR}_LIBRARIES: ${Python${PY_VERSION_MAJOR}_LIBRARIES}") - if(NOT Python${PY_VERSION_MAJOR}_VERSION STREQUAL "${PY_VERSION}") - message("Python_ADDITIONAL_VERSIONS does not match PY_VERSION") - message(FATAL_ERROR "CMake detected wrong cpython version") - endif() - - if(PY_VERSION_MAJOR STREQUAL "2") - python2_add_library(spam2 "py${PY_VERSION_MAJOR}/test_module.c") - elseif(PY_VERSION_MAJOR STREQUAL "3") - python3_add_library(spam2 "py${PY_VERSION_MAJOR}/test_module.c") - else() - message(FATAL_ERROR "Unknown PY_VERSION_MAJOR") - endif() + set_target_properties(spam PROPERTIES DEBUG_POSTFIX "_d") endif() endif() -add_executable(${PROJECT_NAME} "py${PY_VERSION_MAJOR}/test_package.c") -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +add_executable(${PROJECT_NAME} "test_package.c") +target_link_libraries(${PROJECT_NAME} PRIVATE Python3::Python) diff --git a/recipes/cpython/all/test_package/conanfile.py b/recipes/cpython/all/test_package/conanfile.py index 8abc18e4492c5..6f20bfa199e7a 100644 --- a/recipes/cpython/all/test_package/conanfile.py +++ b/recipes/cpython/all/test_package/conanfile.py @@ -1,192 +1,185 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, CMake, tools, RunEnvironment -from conans.errors import ConanException -from io import StringIO import os -import re -import shutil +from io import StringIO +from conan import ConanFile, conan_version +from conan.errors import ConanException +from conan.tools.apple import is_apple_os +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import Environment, VirtualRunEnv +from conan.tools.gnu import AutotoolsDeps +from conan.tools.microsoft import is_msvc, VCVars +from conan.tools.scm import Version -class CmakePython3Abi(object): - def __init__(self, debug, pymalloc, unicode): - self.debug, self.pymalloc, self.unicode = debug, pymalloc, unicode +conan2 = conan_version.major >= 2 - _cmake_lut = { - None: "ANY", - True: "ON", - False: "OFF", - } +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" - @property - def suffix(self): - return "{}{}{}".format( - "d" if self.debug else "", - "m" if self.pymalloc else "", - "u" if self.unicode else "", - ) + def requirements(self): + self.requires(self.tested_reference_str) - @property - def cmake_arg(self): - return ";".join(self._cmake_lut[a] for a in (self.debug, self.pymalloc, self.unicode)) + def build_requirements(self): + # The main recipe does not require CMake, but we test with it. + # The interesting problem that arises here is if you have CMake installed + # with your global pip, then it will fail to run in this test package. + # To avoid that, just add a requirement on CMake. + self.tool_requires("cmake/[>=3.16 <4]") - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + def layout(self): + cmake_layout(self) @property - def _py_version(self): - return re.match(r"^([0-9.]+)", self.deps_cpp_info["cpython"].version).group(1) + def _python(self): + if conan2: + return self.dependencies["cpython"].conf_info.get("user.cpython:python", check_type=str) + else: + return self.deps_user_info["cpython"].python - @property - def _pymalloc(self): - return bool("pymalloc" in self.options["cpython"] and self.options["cpython"].pymalloc) + def _cpython_option(self, name): + if conan2: + return self.dependencies["cpython"].options.get_safe(name, False) + else: + try: + return getattr(self.options["cpython"], name, False) + except ConanException: + return False @property - def _cmake_abi(self): - if self._py_version < tools.Version("3.8"): - return CmakePython3Abi( - debug=self.settings.build_type == "Debug", - pymalloc=self._pymalloc, - unicode=False, - ) + def _py_version(self): + if conan2: + return Version(self.dependencies["cpython"].ref.version) else: - return CmakePython3Abi( - debug=self.settings.build_type == "Debug", - pymalloc=False, - unicode=False, - ) + return Version(self.deps_cpp_info["cpython"].version) @property - def _cmake_try_FindPythonX(self): - if self.settings.compiler == "Visual Studio" and self.settings.build_type == "Debug": - return False - return True + def _test_setuptools(self): + # TODO Should we still try to test this? + # https://github.com/python/cpython/pull/101039 + return can_run(self) and self._supports_modules and self._py_version < "3.12" @property def _supports_modules(self): - return self.settings.compiler != "Visual Studio" or self.options["cpython"].shared + return not is_msvc(self) or self._cpython_option("shared") - def build(self): - if not tools.cross_building(self, skip_x64_x86=True): - command = "{} --version".format(self.deps_user_info["cpython"].python) - buffer = StringIO() - self.run(command, output=buffer, ignore_errors=True, run_environment=True) - self.output.info("output: %s" % buffer.getvalue()) - self.run(command, run_environment=True) + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_MODULE"] = self._supports_modules + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + try: + # CMakeToolchain might generate VCVars, but we need it + # unconditionally for the setuptools build. + VCVars(self).generate() + except ConanException: + pass + + # The build also needs access to the run environment to run the python executable + VirtualRunEnv(self).generate(scope="run") + VirtualRunEnv(self).generate(scope="build") + if self._test_setuptools: + # Just for the distutils build + AutotoolsDeps(self).generate(scope="build") + + def build(self): cmake = CMake(self) - py_major = self.deps_cpp_info["cpython"].version.split(".")[0] - cmake.definitions["BUILD_MODULE"] = self._supports_modules - cmake.definitions["PY_VERSION_MAJOR"] = py_major - cmake.definitions["PY_VERSION_MAJOR_MINOR"] = ".".join(self._py_version.split(".")[:2]) - cmake.definitions["PY_FULL_VERSION"] = self.deps_cpp_info["cpython"].version - cmake.definitions["PY_VERSION"] = self._py_version - cmake.definitions["PY_VERSION_SUFFIX"] = self._cmake_abi.suffix - cmake.definitions["PYTHON_EXECUTABLE"] = self.deps_user_info["cpython"].python - cmake.definitions["USE_FINDPYTHON_X".format(py_major)] = self._cmake_try_FindPythonX - cmake.definitions["Python{}_EXECUTABLE".format(py_major)] = self.deps_user_info["cpython"].python - cmake.definitions["Python{}_ROOT_DIR".format(py_major)] = self.deps_cpp_info["cpython"].rootpath - cmake.definitions["Python{}_USE_STATIC_LIBS".format(py_major)] = not self.options["cpython"].shared - cmake.definitions["Python{}_FIND_FRAMEWORK".format(py_major)] = "NEVER" - cmake.definitions["Python{}_FIND_REGISTRY".format(py_major)] = "NEVER" - cmake.definitions["Python{}_FIND_IMPLEMENTATIONS".format(py_major)] = "CPython" - cmake.definitions["Python{}_FIND_STRATEGY".format(py_major)] = "LOCATION" - - if self.settings.compiler != "Visual Studio": - if tools.Version(self._py_version) < tools.Version("3.8"): - cmake.definitions["Python{}_FIND_ABI".format(py_major)] = self._cmake_abi.cmake_arg - - with tools.environment_append(RunEnvironment(self).vars): - cmake.configure() + cmake.configure() cmake.build() - if not tools.cross_building(self, skip_x64_x86=True): - if self._supports_modules: - with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): - modsrcfolder = "py2" if tools.Version(self.deps_cpp_info["cpython"].version).major < "3" else "py3" - tools.mkdir(os.path.join(self.build_folder, modsrcfolder)) - for fn in os.listdir(os.path.join(self.source_folder, modsrcfolder)): - shutil.copy(os.path.join(self.source_folder, modsrcfolder, fn), os.path.join(self.build_folder, modsrcfolder, fn)) - shutil.copy(os.path.join(self.source_folder, "setup.py"), os.path.join(self.build_folder, "setup.py")) - env = { - "DISTUTILS_USE_SDK": "1", - "MSSdk": "1" - } - env.update(**AutoToolsBuildEnvironment(self).vars) - with tools.environment_append(env): - setup_args = [ - "{}/setup.py".format(self.source_folder), - # "conan", - # "--install-folder", self.build_folder, - "build", - "--build-base", self.build_folder, - "--build-platlib", os.path.join(self.build_folder, "lib_setuptools"), - ] - if self.settings.build_type == "Debug": - setup_args.append("--debug") - self.run("{} {}".format(self.deps_user_info["cpython"].python, " ".join("\"{}\"".format(a) for a in setup_args)), run_environment=True) + if self._test_setuptools: + os.environ["DISTUTILS_USE_SDK"] = "1" + os.environ["MSSdk"] = "1" + setup_args = [ + os.path.join(self.source_folder, "setup.py"), + "build", + "--build-base", self.build_folder, + "--build-platlib", os.path.join(self.build_folder, "lib_setuptools"), + # Bandaid fix: setuptools places temporary files in a subdirectory of the build folder where the + # entirety of the absolute path up to this folder is appended (with seemingly no way to stop this), + # essentially doubling the path length. This may run into Windows max path lengths, so we give ourselves + # a little bit of wiggle room by making this directory name as short as possible. One of the directory + # names goes from (for example) "temp.win-amd64-3.10-pydebug" to "t", saving us roughly 25 characters. + "--build-temp", "t", + ] + if self.settings.build_type == "Debug": + setup_args.append("--debug") + args = " ".join(f'"{a}"' for a in setup_args) + self.run(f"{self._python} {args}") def _test_module(self, module, should_work): try: - self.run("{} {}/test_package.py -b {} -t {} ".format( - self.deps_user_info["cpython"].python, self.source_folder, self.build_folder, module), run_environment=True) - works = True - except ConanException as e: - works = False - exception = e - if should_work == works: - self.output.info("Result of test was expected.") - else: - if works: - raise ConanException("Module '{}' works, but should not have worked".format(module)) - else: - self.output.warn("Module '{}' does not work, but should have worked".format(module)) - raise exception - - def _cpython_option(self, name): - try: - return getattr(self.options["cpython"], name, False) + self.run(f"{self._python} \"{self.source_folder}/test_package.py\" -b \"{self.build_folder}\" -t {module}", env="conanrun") except ConanException: - return False + if should_work: + self.output.warning(f"Module '{module}' does not work, but should have worked") + raise + self.output.info("Module failed as expected") + return + if not should_work: + raise ConanException(f"Module '{module}' works, but should not have worked") + self.output.info("Module worked as expected") def test(self): - if not tools.cross_building(self, skip_x64_x86=True): - self.run("{} -c \"print('hello world')\"".format(self.deps_user_info["cpython"].python), run_environment=True) + if can_run(self): + self.run(f"{self._python} --version", env="conanrun") + + self.run(f"{self._python} -c \"print('hello world')\"", env="conanrun") buffer = StringIO() - self.run("{} -c \"import sys; print('.'.join(str(s) for s in sys.version_info[:3]))\"".format(self.deps_user_info["cpython"].python), run_environment=True, output=buffer) + self.run(f"{self._python} -c \"import sys; print('.'.join(str(s) for s in sys.version_info[:3]))\"", buffer, env="conanrun") self.output.info(buffer.getvalue()) version_detected = buffer.getvalue().splitlines()[-1].strip() if self._py_version != version_detected: - raise ConanException("python reported wrong version. Expected {exp}. Got {res}.".format(exp=self._py_version, res=version_detected)) + raise ConanException( + f"python reported wrong version. Expected {self._py_version}. Got {version_detected}." + ) if self._supports_modules: self._test_module("gdbm", self._cpython_option("with_gdbm")) self._test_module("bz2", self._cpython_option("with_bz2")) - self._test_module("bsddb", self._cpython_option("with_bsddb")) self._test_module("lzma", self._cpython_option("with_lzma")) self._test_module("tkinter", self._cpython_option("with_tkinter")) - with tools.environment_append({"TERM": "ansi"}): - self._test_module("curses", self._cpython_option("with_curses")) - + os.environ["TERM"] = "ansi" + self._test_module("curses", self._cpython_option("with_curses")) self._test_module("expat", True) - self._test_module("sqlite3", True) + self._test_module("sqlite3", self._cpython_option("with_sqlite3")) self._test_module("decimal", True) self._test_module("ctypes", True) - - if tools.is_apple_os(self.settings.os) and not self.options["cpython"].shared: - self.output.info("Not testing the module, because these seem not to work on apple when cpython is built as a static library") + env = Environment() + if self.settings.os != "Windows": + env.define_path("OPENSSL_CONF", os.path.join(os.sep, "dev", "null")) + with env.vars(self).apply(): + self._test_module("ssl", True) + + if is_apple_os(self) and not self._cpython_option("shared"): + self.output.info( + "Not testing the module, because these seem not to work on apple when cpython is built as" + " a static library" + ) # FIXME: find out why cpython on apple does not allow to use modules linked against a static python else: if self._supports_modules: - with tools.environment_append({"PYTHONPATH": [os.path.join(self.build_folder, "lib")]}): - self.output.info("Testing module (spam) using cmake built module") - self._test_module("spam", True) + os.environ["PYTHONPATH"] = os.path.join(self.build_folder, self.cpp.build.libdirs[0]) + self.output.info("Testing module (spam) using cmake built module") + self._test_module("spam", True) - with tools.environment_append({"PYTHONPATH": [os.path.join(self.build_folder, "lib_setuptools")]}): + if self._test_setuptools: + os.environ["PYTHONPATH"] = os.path.join(self.build_folder, "lib_setuptools") self.output.info("Testing module (spam) using setup.py built module") self._test_module("spam", True) - # MSVC builds need PYTHONHOME set. - with tools.environment_append({"PYTHONHOME": self.deps_user_info["cpython"].pythonhome}) if self.deps_user_info["cpython"].module_requires_pythonhome == "True" else tools.no_op(): - self.run(os.path.join("bin", "test_package"), run_environment=True) + del os.environ["PYTHONPATH"] + + # MSVC builds need PYTHONHOME set. Linux and Mac don't require it to be set if tested after building, + # but if the package is relocated then it needs to be set. + if conan2: + os.environ["PYTHONHOME"] = self.dependencies["cpython"].conf_info.get("user.cpython:pythonhome", check_type=str) + else: + os.environ["PYTHONHOME"] = self.deps_user_info["cpython"].pythonhome + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cpython/all/test_package/py2/test_module.c b/recipes/cpython/all/test_package/py2/test_module.c deleted file mode 100644 index 9c5af39ab391b..0000000000000 --- a/recipes/cpython/all/test_package/py2/test_module.c +++ /dev/null @@ -1,42 +0,0 @@ -#include - -#include - -static PyObject *SpamError; - -static PyObject * -spam_system(PyObject *self, PyObject *args) -{ - const char *command; - int sts; - - if (!PyArg_ParseTuple(args, "s", &command)) - return NULL; - sts = system(command); - if (sts < 0) { - PyErr_SetString(SpamError, "System command failed"); - return NULL; - } - return PyLong_FromLong(sts); -} - -const char spam_doc[] = "This is an example spam doc."; - -static PyMethodDef SpamMethods[] = { - {"system", spam_system, METH_VARARGS, "Execute a shell command."}, - {NULL, NULL, 0, NULL} /* Sentinel */ -}; - -PyMODINIT_FUNC -initspam(void) -{ - PyObject *m; - - m = Py_InitModule("spam", SpamMethods); - if (m == NULL) - return; - PyModule_AddStringConstant(m, "__doc__", spam_doc); - SpamError = PyErr_NewException("spam.error", NULL, NULL); - Py_INCREF(SpamError); - PyModule_AddObject(m, "error", SpamError); -} diff --git a/recipes/cpython/all/test_package/py2/test_package.c b/recipes/cpython/all/test_package/py2/test_package.c deleted file mode 100644 index 5e5d839b5a6a1..0000000000000 --- a/recipes/cpython/all/test_package/py2/test_package.c +++ /dev/null @@ -1,12 +0,0 @@ -#include - -int -main(int argc, char *argv[]) -{ - Py_SetProgramName(argv[0]); /* optional but recommended */ - Py_Initialize(); - PyRun_SimpleString("from time import time,ctime\n" - "print 'Today is',ctime(time())\n"); - Py_Finalize(); - return 0; -} diff --git a/recipes/cpython/all/test_package/py3/test_package.c b/recipes/cpython/all/test_package/py3/test_package.c deleted file mode 100644 index f5dfe41cd757c..0000000000000 --- a/recipes/cpython/all/test_package/py3/test_package.c +++ /dev/null @@ -1,21 +0,0 @@ -#define PY_SSIZE_T_CLEAN -#include - -int -main(int argc, char *argv[]) -{ - wchar_t *program = Py_DecodeLocale(argv[0], NULL); - if (program == NULL) { - fprintf(stderr, "Fatal error: cannot decode argv[0]\n"); - exit(1); - } - Py_SetProgramName(program); /* optional but recommended */ - Py_Initialize(); - PyRun_SimpleString("from time import time, ctime\n" - "print('Today is', ctime(time()))\n"); - if (Py_FinalizeEx() < 0) { - exit(120); - } - PyMem_RawFree(program); - return 0; -} diff --git a/recipes/cpython/all/test_package/setup.py b/recipes/cpython/all/test_package/setup.py index cd1754cef8131..2cf4febef6264 100644 --- a/recipes/cpython/all/test_package/setup.py +++ b/recipes/cpython/all/test_package/setup.py @@ -1,5 +1,4 @@ import os -import sys # Hack to work around Python 3.8+ secure dll loading: # see https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew @@ -8,24 +7,14 @@ if os.path.isdir(directory): os.add_dll_directory(directory) -PY2 = (2, 0) <= sys.version_info < (3, 0) -PY3 = (3, 0) <= sys.version_info < (4, 0) - -if PY2: - subdir = "py2" - from distutils.core import setup, Extension -elif PY3: - subdir = "py3" - from setuptools import setup, Extension -else: - raise Exception +from setuptools import setup, Extension +script_dir = os.path.dirname(os.path.realpath(__file__)) setup( name="test_package", version="1.0", - use_2to3=True, ext_modules=[ - Extension("spam", [os.path.join(subdir, "test_module.c")]), + Extension("spam", [os.path.join(script_dir, "test_module.c")]), ], ) diff --git a/recipes/cpython/all/test_package/py3/test_module.c b/recipes/cpython/all/test_package/test_module.c similarity index 100% rename from recipes/cpython/all/test_package/py3/test_module.c rename to recipes/cpython/all/test_package/test_module.c diff --git a/recipes/cpython/all/test_package/test_package.c b/recipes/cpython/all/test_package/test_package.c new file mode 100644 index 0000000000000..cf1688e39502a --- /dev/null +++ b/recipes/cpython/all/test_package/test_package.c @@ -0,0 +1,20 @@ +#define PY_SSIZE_T_CLEAN +#include + +int +main(int argc, char *argv[]) +{ + wchar_t *program = Py_DecodeLocale(argv[0], NULL); + if (program == NULL) { + fprintf(stderr, "Fatal error: cannot decode argv[0]\n"); + exit(1); + } + Py_Initialize(); + PyRun_SimpleString("from time import time, ctime\n" + "print('Today is', ctime(time()))\n"); + if (Py_FinalizeEx() < 0) { + exit(120); + } + PyMem_RawFree(program); + return 0; +} diff --git a/recipes/cpython/all/test_package/test_package.py b/recipes/cpython/all/test_package/test_package.py index f77d2837c6376..bed43fac74c62 100644 --- a/recipes/cpython/all/test_package/test_package.py +++ b/recipes/cpython/all/test_package/test_package.py @@ -14,12 +14,13 @@ def add_test(fn): global ALL_TESTS - name = fn.__name__[fn.__name__.find("_")+1:] + name = fn.__name__[fn.__name__.find("_") + 1 :] def inner_fn(): print("testing {}".format(name)) sys.stdout.flush() fn() + ALL_TESTS[name] = inner_fn return fn @@ -30,13 +31,13 @@ def test_expat(): # 3 handler functions def start_element(name, attrs): - print('Start element:', name, attrs) + print("Start element:", name, attrs) def end_element(name): - print('End element:', name) + print("End element:", name) def char_data(data): - print('Character data:', repr(data)) + print("Character data:", repr(data)) p = xml.parsers.expat.ParserCreate() @@ -44,18 +45,18 @@ def char_data(data): p.EndElementHandler = end_element p.CharacterDataHandler = char_data - p.Parse(""" + p.Parse( + """ Text goes here More text - """, 1) + """, + 1, + ) @add_test def test_gdbm(): - if sys.version_info < (3, 0): - import gdbm - else: - import dbm.gnu as gdbm + import dbm.gnu as gdbm dbfile = "gdbm.db" @@ -85,10 +86,8 @@ def test_spam(): if "This is an example spam doc." not in spam.__doc__: raise Exception("spam.__doc__ does not contain the expected text") - cmd = { - "Windows": "dir", - }.get(platform.system(), "ls") - print("About to run spam.system(\"{}\")".format(cmd)) + cmd = {"Windows": "dir"}.get(platform.system(), "ls") + print('About to run spam.system("{}")'.format(cmd)) sys.stdout.flush() spam.system(cmd) @@ -103,24 +102,6 @@ def test_bz2(): raise Exception("bz2.compress returned no data") -@add_test -def test_bsddb(): - import bsddb - - db = bsddb.btopen("bsddb.db", "c") - db["key1"] = "value1" - db["key2"] = "value2" - db.close() - - db = bsddb.btopen("bsddb.db", "r") - if len(db) != 2: - raise Exception("Wrong length") - if db["key1"] != "value1": - raise Exception("value1 incorrect {}".format(db["key1"])) - if db["key2"] != "value2": - raise Exception("value2 incorrect {}".format(db["key2"])) - - @add_test def test_lzma(): import lzma @@ -133,6 +114,7 @@ def test_lzma(): @add_test def test_sqlite3(): import sqlite3 + conn = sqlite3.connect("sqlite3.db") c = conn.cursor() @@ -141,16 +123,16 @@ def test_sqlite3(): c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)") conn.commit() - t = ('RHAT',) - c.execute('SELECT * FROM stocks WHERE symbol=?', t) + t = ("RHAT",) + c.execute("SELECT * FROM stocks WHERE symbol=?", t) # Larger example that inserts many records at a time purchases = [ - ('2006-03-28', 'BUY', 'IBM', 1000, 45.00), - ('2006-04-05', 'BUY', 'MSFT', 1000, 72.00), - ('2006-04-06', 'SELL', 'IBM', 500, 53.00), + ("2006-03-28", "BUY", "IBM", 1000, 45.00), + ("2006-04-05", "BUY", "MSFT", 1000, 72.00), + ("2006-04-06", "SELL", "IBM", 500, 53.00), ] - c.executemany('INSERT INTO stocks VALUES (?,?,?,?,?)', purchases) + c.executemany("INSERT INTO stocks VALUES (?,?,?,?,?)", purchases) conn.commit() conn.close() conn = sqlite3.connect("sqlite3.db") @@ -161,15 +143,15 @@ def test_sqlite3(): raise Exception("Need 4 stocks") print(data) conn.close() + # Remove the file so subsequent tests don't fail + os.remove("sqlite3.db") @add_test def test_decimal(): - if sys.version_info >= (3, ): - # Check whether the _decimal package was built successfully - import _decimal as decimal - else: - import decimal + # Check whether the _decimal package was built successfully + import _decimal as decimal + decimal.getcontext().prec = 6 print("1/7 =", decimal.Decimal(1) / decimal.Decimal(7)) decimal.getcontext().prec = 40 @@ -199,6 +181,14 @@ def test_tkinter(): print("tk version: {}".format(_tkinter.TK_VERSION)) +@add_test +def test_ssl(): + import ssl + + default_context = ssl.create_default_context() + print("default_context.options={}".format(default_context.options)) + + def main(): parser = argparse.ArgumentParser() parser.add_argument("-b", dest="build_folder", help="build_folder", required=True) diff --git a/recipes/cpython/all/test_v1_package/CMakeLists.txt b/recipes/cpython/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6014dcdd6efcb --- /dev/null +++ b/recipes/cpython/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,96 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +set(CACHE PY_VERSION_MAJOR "" CACHE STRING "MAJOR version of python") +set(CACHE PY_VERSION_MAJOR_MINOR "" CACHE STRING "MAJOR.MINOR version of python") +set(CACHE PY_VERSION "" CACHE STRING "Required version of python") +set(CACHE PY_VERSION_SUFFIX "" CACHE STRING "Suffix of python") + +set(Python_ADDITIONAL_VERSIONS ${PY_VERSION}${PY_VERSION_SUFFIX} ${PY_VERSION_MAJOR_MINOR}${PY_VERSION_SUFFIX} 3${PY_VERSION_SUFFIX} ${PY_VERSION} ${PY_VERSION_MAJOR_MINOR} 3) +message("Using Python_ADDITIONAL_VERSIONS: ${Python_ADDITIONAL_VERSIONS}") + +find_package(PythonInterp REQUIRED) +find_package(PythonLibs REQUIRED) + +string(FIND "${PYTHON_EXECUTABLE}" "${CONAN_CPYTHON_ROOT}" ROOT_SUBPOS) +if(ROOT_SUBPOS EQUAL -1) + message(FATAL_ERROR "found wrong python interpreter: ${PYTHON_EXECUTABLE}") +endif() + +message(STATUS "FindPythonInterp:") +message(STATUS "PYTHON_VERSION_STRING: ${PYTHON_VERSION_STRING}") +message(STATUS "PYTHON_VERSION_MAJOR: ${PYTHON_VERSION_MAJOR}") +message(STATUS "PYTHON_VERSION_MINOR: ${PYTHON_VERSION_MINOR}") +message(STATUS "PYTHON_VERSION_PATCH: ${PYTHON_VERSION_PATCH}") +message(STATUS "=============================================") +message(STATUS "FindPythonLibs:") +message(STATUS "PYTHON_LIBRARIES: ${PYTHON_LIBRARIES}") +message(STATUS "PYTHON_INCLUDE_PATH: ${PYTHON_INCLUDE_PATH} (deprecated)") +message(STATUS "PYTHON_INCLUDE_DIRS: ${PYTHON_INCLUDE_DIRS}") +message(STATUS "PYTHON_DEBUG_LIBRARIES: ${PYTHON_DEBUG_LIBRARIES} (deprecated)") +message(STATUS "PYTHONLIBS_VERSION_STRING: ${PYTHONLIBS_VERSION_STRING}") + +if(NOT PYTHON_VERSION_STRING AND NOT PYTHONLIBS_VERSION_STRING) + message(FATAL_ERROR "Version of python interpreter and libraries not found") +endif() + +if(PYTHON_VERSION_STRING) + if(NOT PYTHON_VERSION_STRING VERSION_EQUAL "${PY_VERSION}") + message("PYTHON_VERSION_STRING does not match PY_VERSION") + message(FATAL_ERROR "CMake detected wrong cpython version") + endif() +endif() + +if(PYTHONLIBS_VERSION_STRING) + if(NOT PYTHONLIBS_VERSION_STRING STREQUAL "${PY_FULL_VERSION}") + message("PYTHONLIBS_VERSION_STRING does not match PY_FULL_VERSION") + message(FATAL_ERROR "CMake detected wrong cpython version") + endif() +endif() + +option(BUILD_MODULE "Build python module") + +set(SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../test_package") + +if(BUILD_MODULE) + add_library(spam MODULE "${SOURCE_DIR}/test_module.c") + target_include_directories(spam + PRIVATE + ${PYTHON_INCLUDE_DIRS} + ) + target_link_libraries(spam PRIVATE + ${PYTHON_LIBRARIES} + ) + set_property(TARGET spam PROPERTY PREFIX "") + if(MSVC) + if(CONAN_SETTINGS_BUILD_TYPE STREQUAL "Debug") + set(SUFFIX "_d.pyd") + else() + set(SUFFIX ".pyd") + endif() + set_property(TARGET spam PROPERTY SUFFIX "${SUFFIX}") + endif() + + option(USE_FINDPYTHON_X "Use new-style FindPythonX module") + if(USE_FINDPYTHON_X AND NOT (CMAKE_VERSION VERSION_LESS "3.16")) + # Require CMake 3.16 because this version introduces Python3_FIND_ABI + find_package(Python3 REQUIRED COMPONENTS Interpreter Development) + message("Python3_EXECUTABLE: ${Python3_EXECUTABLE}") + message("Python3_INTERPRETER_ID: ${Python3_INTERPRETER_ID}") + message("Python3_VERSION: ${Python3_VERSION}") + message("Python3_INCLUDE_DIRS: ${Python3_INCLUDE_DIRS}") + message("Python3_LIBRARIES: ${Python3_LIBRARIES}") + if(NOT Python3_VERSION STREQUAL "${PY_VERSION}") + message("Python_ADDITIONAL_VERSIONS does not match PY_VERSION") + message(FATAL_ERROR "CMake detected wrong cpython version") + endif() + + python3_add_library(spam2 "${SOURCE_DIR}/test_module.c") + endif() +endif() + +add_executable(${PROJECT_NAME} "${SOURCE_DIR}/test_package.c") +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/cpython/all/test_v1_package/conanfile.py b/recipes/cpython/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2fdcf049eb972 --- /dev/null +++ b/recipes/cpython/all/test_v1_package/conanfile.py @@ -0,0 +1,160 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, CMake, tools, RunEnvironment +from conans.errors import ConanException +from conan.tools.env import VirtualRunEnv +from io import StringIO +import os +import re + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + @property + def _py_version(self): + return re.match(r"^([0-9.]+)", self.deps_cpp_info["cpython"].version).group(1) + + @property + def _test_setuptools(self): + # TODO Should we still try to test this? + # https://github.com/python/cpython/pull/101039 + return not tools.cross_building(self, skip_x64_x86=True) and self._supports_modules and self._py_version < tools.Version("3.12") + + @property + def _cmake_try_FindPythonX(self): + if self.settings.compiler == "Visual Studio" and self.settings.build_type == "Debug": + return False + return True + + @property + def _supports_modules(self): + return self.settings.compiler != "Visual Studio" or self.options["cpython"].shared + + def generate(self): + # The build also needs access to the run environment to run the python executable + VirtualRunEnv(self).generate(scope="run") + VirtualRunEnv(self).generate(scope="build") + + def build_requirements(self): + # The main recipe does not require CMake, but we test with it. + # The interesting problem that arises here is if you have CMake installed + # with your global pip, then it will fail to run in this test package. + # To avoid that, just add a requirement on CMake. + self.tool_requires("cmake/[>=3.15 <4]") + + def build(self): + if not tools.cross_building(self, skip_x64_x86=True): + command = "{} --version".format(self.deps_user_info["cpython"].python) + buffer = StringIO() + self.run(command, output=buffer, ignore_errors=True, run_environment=True) + self.output.info("output: %s" % buffer.getvalue()) + self.run(command, run_environment=True) + + cmake = CMake(self) + cmake.definitions["BUILD_MODULE"] = self._supports_modules + cmake.definitions["PY_VERSION_MAJOR_MINOR"] = ".".join(self._py_version.split(".")[:2]) + cmake.definitions["PY_FULL_VERSION"] = self.deps_cpp_info["cpython"].version + cmake.definitions["PY_VERSION"] = self._py_version + cmake.definitions["PY_VERSION_SUFFIX"] = "d" if self.settings.build_type == "Debug" else "" + cmake.definitions["PYTHON_EXECUTABLE"] = self.deps_user_info["cpython"].python + cmake.definitions["USE_FINDPYTHON_X"] = self._cmake_try_FindPythonX + cmake.definitions["Python3_EXECUTABLE"] = self.deps_user_info["cpython"].python + cmake.definitions["Python3_ROOT_DIR"] = self.deps_cpp_info["cpython"].rootpath + cmake.definitions["Python3_USE_STATIC_LIBS"] = not self.options["cpython"].shared + cmake.definitions["Python3_FIND_FRAMEWORK"] = "NEVER" + cmake.definitions["Python3_FIND_REGISTRY"] = "NEVER" + cmake.definitions["Python3_FIND_IMPLEMENTATIONS"] = "CPython" + cmake.definitions["Python3_FIND_STRATEGY"] = "LOCATION" + + with tools.environment_append(RunEnvironment(self).vars): + cmake.configure() + cmake.build() + + if self._test_setuptools: + with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): + env = { + "DISTUTILS_USE_SDK": "1", + "MSSdk": "1" + } + env.update(**AutoToolsBuildEnvironment(self).vars) + with tools.environment_append(env): + setup_args = [ + os.path.join(self.source_folder, "..", "test_package", "setup.py"), + "build", + "--build-base", self.build_folder, + "--build-platlib", os.path.join(self.build_folder, "lib_setuptools"), + # Bandaid fix: setuptools places temporary files in a subdirectory of the build folder where the + # entirety of the absolute path up to this folder is appended (with seemingly no way to stop this), + # essentially doubling the path length. This may run into Windows max path lengths, so we give ourselves + # a little bit of wiggle room by making this directory name as short as possible. One of the directory + # names goes from (for example) "temp.win-amd64-3.10-pydebug" to "t", saving us roughly 25 characters. + "--build-temp", "t", + ] + if self.settings.build_type == "Debug": + setup_args.append("--debug") + self.run("{} {}".format(self.deps_user_info["cpython"].python, " ".join("\"{}\"".format(a) for a in setup_args)), run_environment=True) + + def _test_module(self, module, should_work): + try: + self.run("{} \"{}/../test_package/test_package.py\" -b \"{}\" -t {} ".format( + self.deps_user_info["cpython"].python, self.source_folder, self.build_folder, module), run_environment=True) + works = True + except ConanException as e: + works = False + exception = e + if should_work == works: + self.output.info("Result of test was expected.") + else: + if works: + raise ConanException("Module '{}' works, but should not have worked".format(module)) + else: + self.output.warn("Module '{}' does not work, but should have worked".format(module)) + raise exception + + def _cpython_option(self, name): + try: + return getattr(self.options["cpython"], name, False) + except ConanException: + return False + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + self.run("{} -c \"print('hello world')\"".format(self.deps_user_info["cpython"].python), run_environment=True) + + buffer = StringIO() + self.run("{} -c \"import sys; print('.'.join(str(s) for s in sys.version_info[:3]))\"".format(self.deps_user_info["cpython"].python), run_environment=True, output=buffer) + self.output.info(buffer.getvalue()) + version_detected = buffer.getvalue().splitlines()[-1].strip() + if self._py_version != version_detected: + raise ConanException("python reported wrong version. Expected {exp}. Got {res}.".format(exp=self._py_version, res=version_detected)) + + if self._supports_modules: + self._test_module("gdbm", self._cpython_option("with_gdbm")) + self._test_module("bz2", self._cpython_option("with_bz2")) + self._test_module("lzma", self._cpython_option("with_lzma")) + self._test_module("tkinter", self._cpython_option("with_tkinter")) + with tools.environment_append({"TERM": "ansi"}): + self._test_module("curses", self._cpython_option("with_curses")) + + self._test_module("expat", True) + self._test_module("sqlite3", True) + self._test_module("decimal", True) + self._test_module("ctypes", True) + + if tools.is_apple_os(self.settings.os) and not self.options["cpython"].shared: + self.output.info("Not testing the module, because these seem not to work on apple when cpython is built as a static library") + # FIXME: find out why cpython on apple does not allow to use modules linked against a static python + else: + if self._supports_modules: + with tools.environment_append({"PYTHONPATH": [os.path.join(self.build_folder, "lib")]}): + self.output.info("Testing module (spam) using cmake built module") + self._test_module("spam", True) + + if self._test_setuptools: + with tools.environment_append({"PYTHONPATH": [os.path.join(self.build_folder, "lib_setuptools")]}): + self.output.info("Testing module (spam) using setup.py built module") + self._test_module("spam", True) + + # MSVC builds need PYTHONHOME set. Linux and Mac don't require it to be set if tested after building, + # but if the package is relocated then it needs to be set. + with tools.environment_append({"PYTHONHOME": self.deps_user_info["cpython"].pythonhome}): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/cpython/config.yml b/recipes/cpython/config.yml index e3abf3ec8acb2..87dabe8bf898b 100644 --- a/recipes/cpython/config.yml +++ b/recipes/cpython/config.yml @@ -1,11 +1,11 @@ versions: - "3.10.0": + "3.12.2": folder: "all" - "3.9.7": + "3.11.9": folder: "all" - "3.8.12": + "3.10.14": folder: "all" - "3.7.12": + "3.9.19": folder: "all" - "2.7.18": + "3.8.19": folder: "all" diff --git a/recipes/cr/all/conandata.yml b/recipes/cr/all/conandata.yml new file mode 100644 index 0000000000000..caacd3f558624 --- /dev/null +++ b/recipes/cr/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20221105": + url: "https://github.com/fungos/cr/archive/0e7fef63555cf73c70e4d9ae42f8a6e9cefb8e69.zip" + sha256: "43c076800b19cb9f994ee7e77020e79ea2a01257f221d2f6d80e656f2507069e" diff --git a/recipes/cr/all/conanfile.py b/recipes/cr/all/conanfile.py new file mode 100644 index 0000000000000..b6dc7c42f14b8 --- /dev/null +++ b/recipes/cr/all/conanfile.py @@ -0,0 +1,70 @@ +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.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class CrConan(ConanFile): + name = "cr" + description = "cr.h: A Simple C Hot Reload Header-only Library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/fungos/cr" + topics = ("hot-reload", "hot-swapping", "live-coding", "gamedev", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15", + "clang": "5", + "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.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "cr.h", self.source_folder, os.path.join(self.package_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.extend(["pthread", "dl", "rt"]) + elif is_apple_os(self): + self.cpp_info.system_libs.append("dl") + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("dbghelp") diff --git a/recipes/cr/all/test_package/CMakeLists.txt b/recipes/cr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..420798776cd30 --- /dev/null +++ b/recipes/cr/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cr::cr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cr/all/test_package/conanfile.py b/recipes/cr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/cr/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/cr/all/test_package/test_package.cpp b/recipes/cr/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3be840e09fd11 --- /dev/null +++ b/recipes/cr/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#define CR_HOST +#include + +void dummy() { + cr_plugin ctx; + cr_plugin_open(ctx, "xyz.dll"); + cr_plugin_update(ctx); + cr_plugin_close(ctx); +} + +int main() {} diff --git a/recipes/cr/config.yml b/recipes/cr/config.yml new file mode 100644 index 0000000000000..35012be65fa98 --- /dev/null +++ b/recipes/cr/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20221105": + folder: all diff --git a/recipes/crashpad/all/conandata.yml b/recipes/crashpad/all/conandata.yml index 78196c9e613a3..309c5ff4f2de1 100644 --- a/recipes/crashpad/all/conandata.yml +++ b/recipes/crashpad/all/conandata.yml @@ -1,11 +1,4 @@ sources: - "cci.20210507": - crashpad: - url: "https://github.com/chromium/crashpad/archive/d9bc7cf06aef74e928f9afc3dee33b60121b9c73.tar.gz" - sha256: "49f4b10f1de9b6d33743eccecace6b0fc9d7fe92e5e550ba5e099e6db9a11f0f" - mini_chromium: - url: "https://github.com/chromium/mini_chromium/archive/ccb198907cecf072d8f5b2543d4d348e834a298a.tar.gz" - sha256: "f40a77a4580cd1cb9af71602917a0e85b62bf0f74641b6ed81dd9fb2f2012ea9" "cci.20220219": crashpad: url: "https://github.com/chromium/crashpad/archive/e9937cb36cd12f24d73a07c4b91168cf1885b5db.tar.gz" @@ -14,36 +7,13 @@ sources: url: "https://github.com/chromium/mini_chromium/archive/822fada4a9972e3e2f36a981da770539025beb0a.tar.gz" sha256: "2c3bf30d324fcb60eeef84dd6aaf7fb75b70e37bdb3716ab3ea10cda51c4b05c" patches: - "cci.20210507": - - patch_file: "patches/cci.20210507-0001-fix-openssl-link-order.patch" - base_path: "source_subfolder" - - patch_file: "patches/cci.20210507-0002-remove-fPIC-Werror-LTO.patch" - base_path: "source_subfolder" - - patch_file: "patches/cci.20210507-0003-compilers-from-env.patch" - base_path: "source_subfolder" - - patch_file: "patches/cci.20210507-0004-use-conan-linux-syscall-support-package.patch" - base_path: "source_subfolder" - - patch_file: "patches/cci.20210507-0005-allow-all-archs.patch" - base_path: "source_subfolder" - - patch_file: "patches/cci.20210507-0006-mini_chromium-win_helper-py3.patch" - base_path: "source_subfolder" - - patch_file: "patches/cci.20210507-0007-use-system-zlib.patch" - base_path: "source_subfolder" "cci.20220219": - patch_file: "patches/cci.20220219-0001-fix-openssl-link-order.patch" - base_path: "source_subfolder" - patch_file: "patches/cci.20220219-0002-remove-fPIC-Werror-LTO.patch" - base_path: "source_subfolder" - patch_file: "patches/cci.20220219-0003-compilers-from-env.patch" - base_path: "source_subfolder" - patch_file: "patches/cci.20220219-0004-use-conan-linux-syscall-support-package.patch" - base_path: "source_subfolder" - patch_file: "patches/cci.20220219-0005-allow-all-archs.patch" - base_path: "source_subfolder" - patch_file: "patches/cci.20220219-0006-mini_chromium-win_helper-py3.patch" - base_path: "source_subfolder" - # reused patch from cci.20210507 + # reused patch from cci.20210507 - patch_file: "patches/cci.20210507-0007-use-system-zlib.patch" - base_path: "source_subfolder" - patch_file: "patches/cci.20220219-0007-static-lib-tool_support.patch" - base_path: "source_subfolder" diff --git a/recipes/crashpad/all/conanfile.py b/recipes/crashpad/all/conanfile.py index 42d603abefb4c..7b7d6c74f963c 100644 --- a/recipes/crashpad/all/conanfile.py +++ b/recipes/crashpad/all/conanfile.py @@ -1,21 +1,30 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from contextlib import contextmanager +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rm, save, chdir +from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd +from conan.tools.apple import XCRun, is_apple_os +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.microsoft import VCVars, is_msvc +from conan.tools.gnu import AutotoolsDeps, AutotoolsToolchain + + import os import textwrap -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.64.0" class CrashpadConan(ConanFile): name = "crashpad" description = "Crashpad is a crash-reporting system." url = "https://github.com/conan-io/conan-center-index" - topics = ("conan", "crashpad", "crash", "error", "stacktrace", "collecting", "reporting") + topics = ("crashpad", "crash", "error", "stacktrace", "collecting", "reporting") license = "Apache-2.0" homepage = "https://chromium.googlesource.com/crashpad/crashpad/+/master/README.md" - provides = "crashpad", "mini_chromium" + provides = "mini_chromium" settings = "os", "arch", "compiler", "build_type" + package_type = "static-library" options = { "fPIC": [True, False], "http_transport": ["libcurl", "socket", None], @@ -26,17 +35,16 @@ class CrashpadConan(ConanFile): "http_transport": None, "with_tls": "openssl", } - exports_sources = "patches/*" - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) def _minimum_compiler_cxx14(self): return { "apple-clang": 10, "gcc": 5, "clang": "3.9", + "msvc": "190", "Visual Studio": 14, }.get(str(self.settings.compiler)) @@ -49,46 +57,46 @@ def config_options(self): self.options.http_transport = "socket" def build_requirements(self): - self.build_requires("ninja/1.10.2") - self.build_requires("gn/cci.20210429") + self.tool_requires("ninja/1.10.2") + self.tool_requires("gn/cci.20210429") def requirements(self): # FIXME: use mini_chromium conan package instead of embedded package (if possible) - self.requires("zlib/1.2.12") + self.requires("zlib/[>=1.2.12 <2]") if self.settings.os in ("Linux", "FreeBSD"): self.requires("linux-syscall-support/cci.20200813") if self.options.http_transport != "socket": del self.options.with_tls if self.options.http_transport == "libcurl": - self.requires("libcurl/7.82.0") + self.requires("libcurl/[>=7.78 <9]") if self.options.get_safe("with_tls") == "openssl": - self.requires("openssl/1.1.1o") + self.requires("openssl/[>=1.1 <4]") def validate(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): if self.options.http_transport in ("libcurl", "socket"): raise ConanInvalidConfiguration("http_transport={} is not valid when building with Visual Studio".format(self.options.http_transport)) if self.options.http_transport == "libcurl": - if not self.options["libcurl"].shared: + if not self.dependencies["libcurl"].options.shared: # FIXME: is this true? - self.output.warn("crashpad needs a shared libcurl library") + self.output.warning("crashpad needs a shared libcurl library") min_compiler_version = self._minimum_compiler_cxx14() if min_compiler_version: - if tools.Version(self.settings.compiler.version) < min_compiler_version: + if Version(self.settings.compiler.version) < min_compiler_version: raise ConanInvalidConfiguration("crashpad needs a c++14 capable compiler, version >= {}".format(min_compiler_version)) else: - self.output.warn("This recipe does not know about the current compiler and assumes it has sufficient c++14 supports.") + self.output.warning("This recipe does not know about the current compiler and assumes it has sufficient c++14 supports.") if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 14) + check_min_cppstd(self, 14) def source(self): - tools.get(**self.conan_data["sources"][self.version]["crashpad"], destination=self._source_subfolder, strip_root=True) - tools.get(**self.conan_data["sources"][self.version]["mini_chromium"], - destination=os.path.join(self._source_subfolder, "third_party", "mini_chromium", "mini_chromium"), strip_root=True) + get(self, **self.conan_data["sources"][self.version]["crashpad"], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version]["mini_chromium"], + destination=os.path.join(self.source_folder, "third_party", "mini_chromium", "mini_chromium"), strip_root=True) @property def _gn_os(self): - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): if self.settings.os == "Macos": return "mac" else: @@ -105,31 +113,18 @@ def _gn_arch(self): "x86": "x86", }.get(str(self.settings.arch), str(self.settings.arch)) - @contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - yield - else: - env_defaults = {} - if self.settings.compiler == "gcc": - env_defaults.update({ - "CC": "gcc", - "CXX": "g++", - "LD": "g++", - }) - elif self.settings.compiler in ("clang", "apple-clang"): - env_defaults.update({ - "CC": "clang", - "CXX": "clang++", - "LD": "clang++", - }) - env = {} - for key, value in env_defaults.items(): - if not tools.get_env(key): - env[key] = value - with tools.environment_append(env): - yield + def generate(self): + VCVars(self).generate() + env = Environment() + if self.settings.compiler == "gcc": + env.define("CC", "gcc") + env.define("CXX", "g++") + env.define("LD", "g++") + elif str(self.settings.compiler) in ("clang", "apple-clang"): + env.define("CC", "clang") + env.define("CXX", "clang++") + env.define("LD", "clang++") + env.vars(self).save_script("conanbuild_gn") @property def _http_transport_impl(self): @@ -138,40 +133,31 @@ def _http_transport_impl(self): else: return str(self.options.http_transport) - def _version_greater_equal_to_cci_20220219(self): - return self.version >= "cci.20220219" - - def _has_separate_util_net_lib(self): - return self._version_greater_equal_to_cci_20220219() - - def _needs_to_link_tool_support(self): - return self._version_greater_equal_to_cci_20220219() - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) - if self.settings.compiler == "Visual Studio": - tools.replace_in_file(os.path.join(self._source_subfolder, "third_party", "zlib", "BUILD.gn"), + if is_msvc(self): + replace_in_file(self, os.path.join(self.source_folder, "third_party", "zlib", "BUILD.gn"), "libs = [ \"z\" ]", - "libs = [ {} ]".format(", ".join("\"{}.lib\"".format(l) for l in self.deps_cpp_info["zlib"].libs))) + "libs = [ \"zlib.lib\" ]") if self.settings.compiler == "gcc": - toolchain_path = os.path.join(self._source_subfolder, "third_party", "mini_chromium", "mini_chromium", "build", "config", "BUILD.gn") + toolchain_path = os.path.join(self.source_folder, "third_party", "mini_chromium", "mini_chromium", "build", "config", "BUILD.gn") # Remove gcc-incompatible compiler arguments for comp_arg in ("-Wheader-hygiene", "-Wnewline-eof", "-Wstring-conversion", "-Wexit-time-destructors", "-fobjc-call-cxx-cdtors", "-Wextra-semi", "-Wimplicit-fallthrough"): - tools.replace_in_file(toolchain_path, - "\"{}\"".format(comp_arg), "\"\"") + replace_in_file(self, toolchain_path, "\"{}\"".format(comp_arg), "\"\"") + + deps = AutotoolsDeps(self).vars() + tc = AutotoolsToolchain(self).vars() + def _get_flags(name): + return [f for f in filter(None, [tc.get(name), deps.get(name)])] - autotools = AutoToolsBuildEnvironment(self) - extra_cflags = autotools.flags + ["-D{}".format(d) for d in autotools.defines] + extra_cflags = _get_flags("CPPFLAGS") extra_cflags_c = [] - extra_cflags_cc = autotools.cxx_flags - extra_ldflags = autotools.link_flags + extra_cflags_cc = _get_flags("CXXFLAGS") + extra_ldflags = _get_flags("LDFLAGS") + _get_flags("LIBS") if self.options.get_safe("fPIC"): extra_cflags.append("-fPIC") - extra_cflags.extend("-I {}".format(inc) for inc in autotools.include_paths) - extra_ldflags.extend("-{}{}".format("LIBPATH:" if self.settings.compiler == "Visual Studio" else "L ", libdir) for libdir in autotools.library_paths) if self.settings.compiler == "clang": if self.settings.compiler.get_safe("libcxx"): stdlib = { @@ -190,47 +176,46 @@ def build(self): "extra_cflags_cc=\\\"{}\\\"".format(" ".join(extra_cflags_cc)), "extra_ldflags=\\\"{}\\\"".format(" ".join(extra_ldflags)), ] - with tools.chdir(self._source_subfolder): - with self._build_context(): - self.run("gn gen out/Default --args=\"{}\"".format(" ".join(gn_args)), run_environment=True) - targets = ["client", "minidump", "crashpad_handler", "snapshot"] - if self.settings.os == "Windows": - targets.append("crashpad_handler_com") - self.run("ninja -C out/Default {targets} -j{parallel}".format( - targets=" ".join(targets), - parallel=tools.cpu_count()), run_environment=True) + with chdir(self, self.source_folder): + self.run("gn gen out/Default --args=\"{}\"".format(" ".join(gn_args))) + targets = ["client", "minidump", "crashpad_handler", "snapshot"] + if self.settings.os == "Windows": + targets.append("crashpad_handler_com") + self.run("ninja -C out/Default {targets} -j{parallel}".format( + targets=" ".join(targets), + parallel=os.cpu_count())) def lib_filename(name): - prefix, suffix = ("", ".lib") if self.settings.compiler == "Visual Studio" else ("lib", ".a") + prefix, suffix = ("", ".lib") if is_msvc(self) else ("lib", ".a") return "{}{}{}".format(prefix, name, suffix) - tools.rename(os.path.join(self._source_subfolder, "out", "Default", "obj", "client", lib_filename("common")), - os.path.join(self._source_subfolder, "out", "Default", "obj", "client", lib_filename("client_common"))) - tools.rename(os.path.join(self._source_subfolder, "out", "Default", "obj", "handler", lib_filename("common")), - os.path.join(self._source_subfolder, "out", "Default", "obj", "handler", lib_filename("handler_common"))) + rename(self, os.path.join(self.source_folder, "out", "Default", "obj", "client", lib_filename("common")), + os.path.join(self.source_folder, "out", "Default", "obj", "client", lib_filename("client_common"))) + rename(self, os.path.join(self.source_folder, "out", "Default", "obj", "handler", lib_filename("common")), + os.path.join(self.source_folder, "out", "Default", "obj", "handler", lib_filename("handler_common"))) 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")) - self.copy("*.h", src=os.path.join(self._source_subfolder, "client"), dst=os.path.join("include", "client")) - self.copy("*.h", src=os.path.join(self._source_subfolder, "util"), dst=os.path.join("include", "util")) - self.copy("*.h", src=os.path.join(self._source_subfolder, "third_party", "mini_chromium", "mini_chromium", "base"), dst=os.path.join("include", "base")) - self.copy("*.h", src=os.path.join(self._source_subfolder, "third_party", "mini_chromium", "mini_chromium", "build"), dst=os.path.join("include", "build")) - self.copy("*.h", src=os.path.join(self._source_subfolder, "out", "Default", "gen", "build"), dst=os.path.join("include", "build")) + copy(self, "*.h", src=os.path.join(self.source_folder, "client"), dst=os.path.join(self.package_folder, "include", "client")) + copy(self, "*.h", src=os.path.join(self.source_folder, "util"), dst=os.path.join(self.package_folder, "include", "util")) + copy(self, "*.h", src=os.path.join(self.source_folder, "third_party", "mini_chromium", "mini_chromium", "base"), dst=os.path.join(self.package_folder, "include", "base")) + copy(self, "*.h", src=os.path.join(self.source_folder, "third_party", "mini_chromium", "mini_chromium", "build"), dst=os.path.join(self.package_folder, "include", "build")) + copy(self, "*.h", src=os.path.join(self.source_folder, "out", "Default", "gen", "build"), dst=os.path.join(self.package_folder, "include", "build")) - self.copy("*.a", src=os.path.join(self._source_subfolder, "out", "Default"), dst="lib", keep_path=False) + copy(self, "*.a", src=os.path.join(self.source_folder, "out", "Default"), dst=os.path.join(self.package_folder, "lib"), keep_path=False) - self.copy("*.lib", src=os.path.join(self._source_subfolder, "out", "Default"), dst="lib", keep_path=False) - self.copy("crashpad_handler", src=os.path.join(self._source_subfolder, "out", "Default"), dst="bin", keep_path=False) - self.copy("crashpad_handler.exe", src=os.path.join(self._source_subfolder, "out", "Default"), dst="bin", keep_path=False) - self.copy("crashpad_handler_com.com", src=os.path.join(self._source_subfolder, "out", "Default"), dst="bin", keep_path=False) + copy(self, "*.lib", src=os.path.join(self.source_folder, "out", "Default"), dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "crashpad_handler", src=os.path.join(self.source_folder, "out", "Default"), dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "crashpad_handler.exe", src=os.path.join(self.source_folder, "out", "Default"), dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "crashpad_handler_com.com", src=os.path.join(self.source_folder, "out", "Default"), dst=os.path.join(self.package_folder, "bin"), keep_path=False) if self.settings.os == "Windows": - tools.rename(os.path.join(self.package_folder, "bin", "crashpad_handler_com.com"), + rename(self, os.path.join(self.package_folder, "bin", "crashpad_handler_com.com"), os.path.join(self.package_folder, "bin", "crashpad_handler.com")) # Remove accidentally copied libraries. These are used by the executables, not by the libraries. - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*getopt*") + rm(self, "*getopt*", os.path.join(self.package_folder, "lib"), recursive=True) - tools.save(os.path.join(self.package_folder, "lib", "cmake", "crashpad-cxx.cmake"), + save(self, os.path.join(self.package_folder, "lib", "cmake", "crashpad-cxx.cmake"), textwrap.dedent("""\ if(TARGET crashpad::mini_chromium_base) target_compile_features(crashpad::mini_chromium_base INTERFACE cxx_std_14) @@ -239,9 +224,9 @@ def package(self): def package_info(self): self.cpp_info.components["mini_chromium_base"].libs = ["base"] - self.cpp_info.components["mini_chromium_base"].build_modules = [os.path.join(self.package_folder, "lib", "cmake", "crashpad-cxx.cmake")] + self.cpp_info.set_property("cmake_build_modules", [os.path.join(self.package_folder, "lib", "cmake", "crashpad-cxx.cmake")]) self.cpp_info.components["mini_chromium_base"].builddirs = [os.path.join("lib", "cmake")] - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): if self.settings.os == "Macos": self.cpp_info.components["mini_chromium_base"].frameworks = ["ApplicationServices", "CoreFoundation", "Foundation", "IOKit", "Security"] else: # iOS @@ -249,7 +234,7 @@ def package_info(self): self.cpp_info.components["util"].libs = ["util"] self.cpp_info.components["util"].requires = ["mini_chromium_base", "zlib::zlib"] - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): self.cpp_info.components["util"].libs.append("mig_output") if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.components["util"].libs.append("compat") @@ -277,7 +262,7 @@ def package_info(self): self.cpp_info.components["snapshot"].libs = ["snapshot"] self.cpp_info.components["snapshot"].requires = ["context", "client_common", "mini_chromium_base", "util"] - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): self.cpp_info.components["snapshot"].frameworks.extend(["OpenCL"]) self.cpp_info.components["format"].libs = ["format"] @@ -286,15 +271,11 @@ def package_info(self): self.cpp_info.components["minidump"].libs = ["minidump"] self.cpp_info.components["minidump"].requires = ["snapshot", "mini_chromium_base", "util"] - extra_handler_common_req = [] - if self._has_separate_util_net_lib(): - self.cpp_info.components["net"].libs = ["net"] - extra_handler_common_req = ["net"] + self.cpp_info.components["net"].libs = ["net"] + extra_handler_common_req = ["net"] - extra_handler_req = [] - if self._needs_to_link_tool_support(): - self.cpp_info.components["tool_support"].libs = ["tool_support"] - extra_handler_req = ["tool_support"] + self.cpp_info.components["tool_support"].libs = ["tool_support"] + extra_handler_req = ["tool_support"] self.cpp_info.components["handler_common"].libs = ["handler_common"] self.cpp_info.components["handler_common"].requires = ["client_common", "snapshot", "util"] + extra_handler_common_req @@ -303,5 +284,4 @@ def package_info(self): self.cpp_info.components["handler"].requires = ["client", "util", "handler_common", "minidump", "snapshot"] + extra_handler_req bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) self.env_info.PATH.append(bin_path) diff --git a/recipes/crashpad/all/patches/cci.20210507-0001-fix-openssl-link-order.patch b/recipes/crashpad/all/patches/cci.20210507-0001-fix-openssl-link-order.patch deleted file mode 100644 index fa25c29585519..0000000000000 --- a/recipes/crashpad/all/patches/cci.20210507-0001-fix-openssl-link-order.patch +++ /dev/null @@ -1,23 +0,0 @@ -Order of ssl and crypto is wrong (first ssl, then crypto) ---- util/BUILD.gn -+++ util/BUILD.gn -@@ -402,8 +402,8 @@ - deps += [ "//third_party/boringssl" ] - } else { - libs = [ -- "crypto", - "ssl", -+ "crypto", - ] - } - } -@@ -670,8 +670,8 @@ - deps += [ "//third_party/boringssl" ] - } else { - libs = [ -- "crypto", - "ssl", -+ "crypto", - ] - } - } diff --git a/recipes/crashpad/all/patches/cci.20210507-0002-remove-fPIC-Werror-LTO.patch b/recipes/crashpad/all/patches/cci.20210507-0002-remove-fPIC-Werror-LTO.patch deleted file mode 100644 index dbe02c56b50c4..0000000000000 --- a/recipes/crashpad/all/patches/cci.20210507-0002-remove-fPIC-Werror-LTO.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- third_party/mini_chromium/mini_chromium/build/config/BUILD.gn -+++ third_party/mini_chromium/mini_chromium/build/config/BUILD.gn -@@ -103,7 +103,7 @@ - } - } else if (mini_chromium_is_win) { - cflags = [ -- "/GL", # LTCG. -+ # LTCG. - "/O2", - "/Ob2", # Both explicit and auto inlining. - "/Oy-", # Disable omitting frame pointers, must be after /O2. -@@ -113,9 +113,9 @@ - ldflags = [ - "/OPT:ICF", - "/OPT:REF", -- "/LTCG", -+ - ] -- arflags = [ "/LTCG" ] -+ arflags = [ ] - } - } - -@@ -128,7 +128,7 @@ - cflags = [ - "-Wall", - "-Wendif-labels", -- "-Werror", -+ - "-Wextra", - "-Wextra-semi", - "-Wheader-hygiene", -@@ -239,7 +239,7 @@ - "/D_UNICODE", - "/FS", - "/W4", -- "/WX", -+ - "/Zi", - "/bigobj", # Support larger number of sections in obj file. - "/wd4100", # Unreferenced formal parameter. -@@ -319,7 +319,7 @@ - - if ((mini_chromium_is_posix && !mini_chromium_is_mac && - !mini_chromium_is_ios) || mini_chromium_is_fuchsia) { -- cflags += [ "-fPIC" ] -+ - ldflags += [ - # This must follow Fuchsia’s fdio library above. - "-Wl,--as-needed", ---- third_party/mini_chromium/mini_chromium/build/common.gypi -+++ third_party/mini_chromium/mini_chromium/build/common.gypi -@@ -124,7 +124,7 @@ - - ['OS=="linux" or OS=="android"', { - 'cflags': [ -- '-fPIC', -+ - '-fno-exceptions', - '-fno-strict-aliasing', # See http://crbug.com/32204 - '-fstack-protector-all', # Implies -fstack-protector -@@ -148,7 +148,7 @@ - '_FILE_OFFSET_BITS=64', - ], - 'ldflags': [ -- '-fPIC', -+ - '-pthread', - '-Wl,--as-needed', - '-Wl,-z,noexecstack', diff --git a/recipes/crashpad/all/patches/cci.20210507-0003-compilers-from-env.patch b/recipes/crashpad/all/patches/cci.20210507-0003-compilers-from-env.patch deleted file mode 100644 index 3d2fca3db7ec9..0000000000000 --- a/recipes/crashpad/all/patches/cci.20210507-0003-compilers-from-env.patch +++ /dev/null @@ -1,14 +0,0 @@ -Allow compiling crashpad with gcc (fetch compiler from environment variables) ---- third_party/mini_chromium/mini_chromium/build/config/BUILD.gn -+++ third_party/mini_chromium/mini_chromium/build/config/BUILD.gn -@@ -393,8 +393,8 @@ - ar = rebase_path(clang_path, root_build_dir) + "/bin/llvm-ar" - ld = cxx - } else { -- cc = "clang" -- cxx = "clang++" -+ cc = getenv("CC") -+ cxx = getenv("CXX") - asm = cxx - ld = cxx - diff --git a/recipes/crashpad/all/patches/cci.20210507-0004-use-conan-linux-syscall-support-package.patch b/recipes/crashpad/all/patches/cci.20210507-0004-use-conan-linux-syscall-support-package.patch deleted file mode 100644 index 849ed17734c92..0000000000000 --- a/recipes/crashpad/all/patches/cci.20210507-0004-use-conan-linux-syscall-support-package.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- third_party/lss/lss.h -+++ third_party/lss/lss.h -@@ -16,9 +16,9 @@ - #define CRASHPAD_THIRD_PARTY_LSS_LSS_H_ - - #if defined(CRASHPAD_LSS_SOURCE_EXTERNAL) --#include "third_party/lss/linux_syscall_support.h" -+#include - #elif defined(CRASHPAD_LSS_SOURCE_EMBEDDED) --#include "third_party/lss/lss/linux_syscall_support.h" -+#include - #else - #error Unknown lss source - #endif diff --git a/recipes/crashpad/all/patches/cci.20210507-0005-allow-all-archs.patch b/recipes/crashpad/all/patches/cci.20210507-0005-allow-all-archs.patch deleted file mode 100644 index ae7425fb742f1..0000000000000 --- a/recipes/crashpad/all/patches/cci.20210507-0005-allow-all-archs.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- third_party/mini_chromium/mini_chromium/build/config/BUILD.gn -+++ third_party/mini_chromium/mini_chromium/build/config/BUILD.gn -@@ -193,7 +193,7 @@ - "arm64", - ] - } else { -- assert(false, "Unsupported architecture") -+ print("Unknown architecture -> assume conan knows how to handle it") - } - } - -@@ -268,7 +268,7 @@ - "-m64", - ] - } else { -- assert(false, "Unsupported architecture") -+ print("Unknown architecture -> assume conan knows how to handle it") - } - - # This is currently required by the clang toolchain build that DEPS uses -@@ -302,7 +302,7 @@ - } else if (target_cpu == "x64") { - common_flags += [ "--target=x86_64-fuchsia" ] - } else { -- assert(false, "Unsupported architecture") -+ print("Unknown architecture -> assume conan knows how to handle it") - } - - # fdio is listed in ldflags instead of libs because it’s important for it to ---- util/BUILD.gn -+++ util/BUILD.gn -@@ -145,7 +145,7 @@ if (crashpad_is_mac || crashpad_is_ios) { - "arm64", - ] - } else { -- assert(false, "Unsupported architecture") -+ print("Unknown architecture -> assume conan knows how to handle it") - } - } - diff --git a/recipes/crashpad/all/patches/cci.20210507-0006-mini_chromium-win_helper-py3.patch b/recipes/crashpad/all/patches/cci.20210507-0006-mini_chromium-win_helper-py3.patch deleted file mode 100644 index be8423bbda8e1..0000000000000 --- a/recipes/crashpad/all/patches/cci.20210507-0006-mini_chromium-win_helper-py3.patch +++ /dev/null @@ -1,96 +0,0 @@ ---- third_party/mini_chromium/mini_chromium/build/win_helper.py -+++ third_party/mini_chromium/mini_chromium/build/win_helper.py -@@ -4,7 +4,10 @@ - # Use of this source code is governed by a BSD-style license that can be - # found in the LICENSE file. - --import _winreg -+try: -+ import _winreg -+except ImportError: -+ import winreg as _winreg - import os - import re - import subprocess -@@ -62,7 +65,7 @@ - CreateProcess() documentation for more details.""" - block = '' - nul = '\0' -- for key, value in envvar_dict.iteritems(): -+ for key, value in envvar_dict.items(): - block += key + '=' + value + nul - block += nul - return block -@@ -81,7 +84,7 @@ - archs = ('x86', 'amd64', 'arm64') - result = [] - for arch in archs: -- # Extract environment variables for subprocesses. -+ sys.stderr.write("install_dir {} script_path {}".format(install_dir, script_path)) - args = [os.path.join(install_dir, script_path)] - script_arch_name = arch - if script_path.endswith('SetEnv.cmd') and arch == 'amd64': -@@ -94,12 +97,12 @@ - variables, _ = popen.communicate() - if popen.returncode != 0: - raise Exception('"%s" failed with error %d' % (args, popen.returncode)) -- env = _ExtractImportantEnvironment(variables) -+ env = _ExtractImportantEnvironment(variables.decode()) - - env_block = _FormatAsEnvironmentBlock(env) - basename = 'environment.' + arch - with open(os.path.join(out_dir, basename), 'wb') as f: -- f.write(env_block) -+ f.write(env_block.encode()) - result.append(basename) - return result - -@@ -139,10 +142,10 @@ - link = subprocess.Popen(args, env=env, shell=True, stdout=subprocess.PIPE) - out, _ = link.communicate() - for line in out.splitlines(): -- if (not line.startswith(' Creating library ') and -- not line.startswith('Generating code') and -- not line.startswith('Finished generating code')): -- print line -+ if (not line.startswith(b' Creating library ') and -+ not line.startswith(b'Generating code') and -+ not line.startswith(b'Finished generating code')): -+ print(line) - return link.returncode - - def ExecAsmWrapper(self, arch, *args): -@@ -152,11 +155,11 @@ - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - out, _ = popen.communicate() - for line in out.splitlines(): -- if (not line.startswith('Copyright (C) Microsoft Corporation') and -- not line.startswith('Microsoft (R) Macro Assembler') and -- not line.startswith(' Assembling: ') and -+ if (not line.startswith(b'Copyright (C) Microsoft Corporation') and -+ not line.startswith(b'Microsoft (R) Macro Assembler') and -+ not line.startswith(b' Assembling: ') and - line): -- print line -+ print(line) - return popen.returncode - - def ExecGetVisualStudioData(self, outdir, toolchain_path): -@@ -178,7 +181,7 @@ - 'Microsoft Visual Studio', 'Installer', 'vswhere.exe') - if os.path.exists(vswhere_path): - installation_path = subprocess.check_output( -- [vswhere_path, '-latest', '-property', 'installationPath']).strip() -+ [vswhere_path, '-latest', '-property', 'installationPath']).strip().decode() - if installation_path: - return (installation_path, - os.path.join('VC', 'Auxiliary', 'Build', 'vcvarsall.bat')) -@@ -207,7 +210,7 @@ - x86_environment_file = "%s" - x64_environment_file = "%s" - arm64_environment_file = "%s"''' % (install_dir, x86_file, x64_file, arm64_file) -- print result -+ print(result) - return 0 - - def ExecStamp(self, path): diff --git a/recipes/crashpad/all/test_package/CMakeLists.txt b/recipes/crashpad/all/test_package/CMakeLists.txt index 6c1d84c7e3d82..371eb858142f4 100644 --- a/recipes/crashpad/all/test_package/CMakeLists.txt +++ b/recipes/crashpad/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(crashpad REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE crashpad::crashpad) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/crashpad/all/test_package/conanfile.py b/recipes/crashpad/all/test_package/conanfile.py index a0d87c14b0333..46a8950cd70ed 100644 --- a/recipes/crashpad/all/test_package/conanfile.py +++ b/recipes/crashpad/all/test_package/conanfile.py @@ -1,10 +1,24 @@ -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 +from conan.tools.files import mkdir, save, load 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 generate(self): + save(self, os.path.join(self.generators_folder, "bindir"), + os.path.join(self.dependencies["crashpad"].package_folder, "bin")) def build(self): cmake = CMake(self) @@ -12,14 +26,14 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): test_env_dir = "test_env" - tools.mkdir(test_env_dir) - bin_path = os.path.join("bin", "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["crashpad"].rootpath, "bin", handler_exe) - self.run("%s %s/db %s" % (bin_path, test_env_dir, handler_bin_path), run_environment=True) + mkdir(self, test_env_dir) + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + bindir = load(self, os.path.join(self.generators_folder, "bindir")) + handler_exe = "crashpad_handler" + (".exe" if self.settings.os == "Windows" else "") + handler_bin_path = os.path.join(bindir, handler_exe) + self.run(f"{bin_path} {test_env_dir}/db {handler_bin_path}", env="conanrun") if self.settings.os == "Windows": - handler_exe = "crashpad_handler.com" - handler_bin_path = os.path.join(self.deps_cpp_info["crashpad"].rootpath, "bin", handler_exe) - self.run("%s %s/db %s" % (bin_path, test_env_dir, handler_bin_path), run_environment=True) + handler_bin_path = os.path.join(bindir, "crashpad_handler.com") + self.run(f"{bin_path} {test_env_dir}/db {handler_bin_path}", env="conanrun") diff --git a/recipes/crashpad/config.yml b/recipes/crashpad/config.yml index 104465b6c7315..63942e1b1104b 100644 --- a/recipes/crashpad/config.yml +++ b/recipes/crashpad/config.yml @@ -1,5 +1,3 @@ versions: - "cci.20210507": - folder: all "cci.20220219": folder: all diff --git a/recipes/crowcpp-crow/all/conandata.yml b/recipes/crowcpp-crow/all/conandata.yml index 7b927ae7b3902..91575e2322dc2 100644 --- a/recipes/crowcpp-crow/all/conandata.yml +++ b/recipes/crowcpp-crow/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.0": + url: "https://github.com/CrowCpp/crow/archive/refs/tags/v1.2.0.tar.gz" + sha256: "c80d0b23c6a20f8aa6fe776669dc8a9fb984046891d2f70bfc0539d16998164b" "1.1.0": url: "https://github.com/CrowCpp/crow/archive/refs/tags/v1.1.0.tar.gz" sha256: "f4281c3f25769dbc82437dd4199a8ba07b2a6e8a2f42e36a6fd805c493aae5ca" diff --git a/recipes/crowcpp-crow/all/conanfile.py b/recipes/crowcpp-crow/all/conanfile.py index d5a63018ad0dd..f86149ab6d350 100644 --- a/recipes/crowcpp-crow/all/conanfile.py +++ b/recipes/crowcpp-crow/all/conanfile.py @@ -14,6 +14,7 @@ class CrowConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "http://crowcpp.org/" topics = ("web", "microframework", "header-only") + package_type = "header-library" settings = "os", "compiler", "arch", "build_type" options = { "amalgamation": [True, False], diff --git a/recipes/crowcpp-crow/config.yml b/recipes/crowcpp-crow/config.yml index 271396eff4652..f99accc1b08d5 100644 --- a/recipes/crowcpp-crow/config.yml +++ b/recipes/crowcpp-crow/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.0": folder: all "1.0+5": diff --git a/recipes/crunch/all/test_package/conanfile.py b/recipes/crunch/all/test_package/conanfile.py index 7a2122729677a..539e617675db7 100644 --- a/recipes/crunch/all/test_package/conanfile.py +++ b/recipes/crunch/all/test_package/conanfile.py @@ -22,7 +22,5 @@ def build(self): def test(self): if can_run(self): - img_path = os.path.join(self.source_folder, "test.png") - self.run(f"crunch -file {img_path}", env="conanrun") bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/crunch/all/test_package/test.png b/recipes/crunch/all/test_package/test.png deleted file mode 100644 index 11640c7488fb1..0000000000000 Binary files a/recipes/crunch/all/test_package/test.png and /dev/null differ diff --git a/recipes/crunch/all/test_package/test_package.cpp b/recipes/crunch/all/test_package/test_package.cpp index 7caf2449af9a7..f6909dbc593f0 100644 --- a/recipes/crunch/all/test_package/test_package.cpp +++ b/recipes/crunch/all/test_package/test_package.cpp @@ -4,6 +4,6 @@ int main(int argc, const char* argv[]) { - crn_get_file_type_ext(crn_file_type::cCRNFileTypeCRN); + std::cout << "Test string: " << crn_get_format_string(crn_format::cCRNFmtDXT1) << std::endl; return 0; } diff --git a/recipes/crunch/all/test_v1_package/conanfile.py b/recipes/crunch/all/test_v1_package/conanfile.py index f8fa68e1e8d17..38f4483872d47 100644 --- a/recipes/crunch/all/test_v1_package/conanfile.py +++ b/recipes/crunch/all/test_v1_package/conanfile.py @@ -13,7 +13,5 @@ def build(self): def test(self): if not tools.cross_building(self): - img_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.png") - self.run(f"crunch -file {img_path}", run_environment=True) bin_path = os.path.join("bin", "test_package") self.run(bin_path, run_environment=True) diff --git a/recipes/ctre/all/conandata.yml b/recipes/ctre/all/conandata.yml index c31706ca559c2..14d4398b08a9b 100644 --- a/recipes/ctre/all/conandata.yml +++ b/recipes/ctre/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.9.0": + url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.9.0.tar.gz" + sha256: "55778712968d4f3ad00e9d20fc4d2149d14d96b4ff3dab086613797cd2ccd2b2" "3.8.1": url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.8.1.tar.gz" sha256: "0ce8760d43b3b97b43364cd32ee663e5c8b8b4bfd58e7890042eff6ac52db605" diff --git a/recipes/ctre/config.yml b/recipes/ctre/config.yml index 02f3f62c0a451..218ac700f6381 100644 --- a/recipes/ctre/config.yml +++ b/recipes/ctre/config.yml @@ -1,4 +1,6 @@ versions: + "3.9.0": + folder: all "3.8.1": folder: all "3.8": diff --git a/recipes/cubicinterpolation/all/conanfile.py b/recipes/cubicinterpolation/all/conanfile.py index 2525795c99b74..bc39a02e7855c 100644 --- a/recipes/cubicinterpolation/all/conanfile.py +++ b/recipes/cubicinterpolation/all/conanfile.py @@ -42,8 +42,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - # TODO: update boost dependency as soon as we deprecate conan1.x (see discussion in #11207) - self.requires("boost/1.83.0") + self.requires("boost/1.85.0") self.requires("eigen/3.4.0") @property diff --git a/recipes/cxxgraph/all/conandata.yml b/recipes/cxxgraph/all/conandata.yml new file mode 100644 index 0000000000000..3b4bdb95b9d3a --- /dev/null +++ b/recipes/cxxgraph/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "4.1.0": + url: "https://github.com/ZigRazor/CXXGraph/archive/refs/tags/v4.1.0.tar.gz" + sha256: "1f6601abfcb692f35bfe14f2a34b2302f70213a257b0f7d541a110d6bd460040" + "3.1.0": + url: "https://github.com/ZigRazor/CXXGraph/archive/refs/tags/v3.1.0.tar.gz" + sha256: "54838d0d35a6f2685cf45e50e888146aef3c1a10fbbdddb939b3985c7953087a" diff --git a/recipes/cxxgraph/all/conanfile.py b/recipes/cxxgraph/all/conanfile.py new file mode 100644 index 0000000000000..9765a25c1f6eb --- /dev/null +++ b/recipes/cxxgraph/all/conanfile.py @@ -0,0 +1,87 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc +import os + + +required_conan_version = ">=1.52.0" + + +class CxxgraphConan(ConanFile): + name = "cxxgraph" + description = "Header-Only C++ Library for Graph Representation and Algorithms" + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ZigRazor/CXXGraph/" + topics = ("graph", "partitioning-algorithms", "dijkstra-algorithm", "graph-theory-algorithms", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "17", + "msvc": "193", + } + + def configure(self): + if Version(self.version) < "4.0.0": + self.license = "AGPL-3.0-later" + + 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." + ) + + # TODO: remove this check once the bug is fixed + # https://github.com/ZigRazor/CXXGraph/pull/416 + # https://github.com/ZigRazor/CXXGraph/pull/417 + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio due to fold expression bug") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.h", + os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include"), + ) + copy( + self, + "*.hpp", + os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread"]) diff --git a/recipes/cxxgraph/all/test_package/CMakeLists.txt b/recipes/cxxgraph/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..833f2dae3436f --- /dev/null +++ b/recipes/cxxgraph/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cxxgraph REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cxxgraph::cxxgraph) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cxxgraph/all/test_package/conanfile.py b/recipes/cxxgraph/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/cxxgraph/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/cxxgraph/all/test_package/test_package.cpp b/recipes/cxxgraph/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f651fa10d2f1e --- /dev/null +++ b/recipes/cxxgraph/all/test_package/test_package.cpp @@ -0,0 +1,34 @@ +#include + +#include "CXXGraph/CXXGraph.hpp" + +int main() { + CXXGraph::Node node0("0", 0); + CXXGraph::Node node1("1", 1); + CXXGraph::Node node2("2", 2); + CXXGraph::Node node3("3", 3); + + CXXGraph::UndirectedWeightedEdge edge1(1, node1, node2, 2.0); + CXXGraph::UndirectedWeightedEdge edge2(2, node2, node3, 2.0); + CXXGraph::UndirectedWeightedEdge edge3(3, node0, node1, 2.0); + CXXGraph::UndirectedWeightedEdge edge4(4, node0, node3, 1.0); + + CXXGraph::T_EdgeSet edgeSet; + edgeSet.insert(std::make_shared>(edge1)); + edgeSet.insert(std::make_shared>(edge2)); + edgeSet.insert(std::make_shared>(edge3)); + edgeSet.insert(std::make_shared>(edge4)); + + // Can print out the edges for debugging + std::cout << edge1 << "\n"; + std::cout << edge2 << "\n"; + std::cout << edge3 << "\n"; + std::cout << edge4 << "\n"; + + CXXGraph::Graph graph(edgeSet); + auto res = graph.dijkstra(node0, node2); + + std::cout << "Dijkstra Result: " << res.result << "\n"; + + return 0; +} diff --git a/recipes/cxxgraph/config.yml b/recipes/cxxgraph/config.yml new file mode 100644 index 0000000000000..e92b5abf9b97b --- /dev/null +++ b/recipes/cxxgraph/config.yml @@ -0,0 +1,5 @@ +versions: + "4.1.0": + folder: all + "3.1.0": + folder: all diff --git a/recipes/cyclonedds-cxx/all/conanfile.py b/recipes/cyclonedds-cxx/all/conanfile.py index 723b2660aff69..f2c688b39a594 100644 --- a/recipes/cyclonedds-cxx/all/conanfile.py +++ b/recipes/cyclonedds-cxx/all/conanfile.py @@ -150,13 +150,15 @@ def package_info(self): self.cpp_info.includedirs = ["include/ddscxx"] self.cpp_info.builddirs = [self._module_path] self.cpp_info.components["ddscxx"].libs = ["ddscxx"] - self.cpp_info.components["ddscxx"].includedirs = ["include/ddscxx"] + self.cpp_info.components["ddscxx"].includedirs = [os.path.join("include", "ddscxx")] self.cpp_info.components["ddscxx"].set_property("cmake_target_name", "CycloneDDS-CXX::ddscxx") self.cpp_info.components["ddscxx"].set_property("pkg_config_name", "CycloneDDS-CXX") + self.cpp_info.components["ddscxx"].requires = ["cyclonedds::CycloneDDS"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["ddscxx"].system_libs = ["m"] self.cpp_info.components["idlcxx"].libs = ["cycloneddsidlcxx"] self.cpp_info.components["idlcxx"].set_property("cmake_target_name", "CycloneDDS-CXX::idlcxx") + self.cpp_info.components["idlcxx"].requires = ["cyclonedds::idl"] self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) self.buildenv_info.append_path("PATH", os.path.join(self.package_folder, "bin")) self.runenv_info.append_path("PATH", os.path.join(self.package_folder, "bin")) diff --git a/recipes/cyclonedds-cxx/all/test_package/CMakeLists.txt b/recipes/cyclonedds-cxx/all/test_package/CMakeLists.txt index 4092a05fa5b94..f43c4dca3ca61 100644 --- a/recipes/cyclonedds-cxx/all/test_package/CMakeLists.txt +++ b/recipes/cyclonedds-cxx/all/test_package/CMakeLists.txt @@ -6,10 +6,10 @@ set(CMAKE_CXX_EXTENSIONS OFF) find_package(CycloneDDS-CXX REQUIRED) add_executable(test_package test_package.cpp) -target_link_libraries(test_package PRIVATE CycloneDDS-CXX::ddscxx CycloneDDS::ddsc) +target_link_libraries(test_package PRIVATE CycloneDDS-CXX::ddscxx) if(NOT CMAKE_CROSSCOMPILING) IDLCXX_GENERATE(TARGET MessageLib FILES Message.idl) add_executable(test_message test_message.cpp) - target_link_libraries(test_message PRIVATE MessageLib CycloneDDS-CXX::ddscxx CycloneDDS::ddsc) + target_link_libraries(test_message PRIVATE MessageLib CycloneDDS-CXX::ddscxx) endif() diff --git a/recipes/cyrus-sasl/all/conanfile.py b/recipes/cyrus-sasl/all/conanfile.py index e29d9fed196d8..78ec1f2f5f46a 100644 --- a/recipes/cyrus-sasl/all/conanfile.py +++ b/recipes/cyrus-sasl/all/conanfile.py @@ -41,6 +41,7 @@ class CyrusSaslConan(ConanFile): "with_postgresql": [True, False], "with_mysql": [True, False], "with_sqlite3": [True, False], + "with_saslauthd": [True, False], } default_options = { "shared": False, @@ -57,6 +58,7 @@ class CyrusSaslConan(ConanFile): "with_postgresql": False, "with_mysql": False, "with_sqlite3": False, + "with_saslauthd": True, } @property @@ -66,6 +68,9 @@ def _settings_build(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + # saslauthd doesn't compile on Windows + # https://www.cyrusimap.org/sasl/sasl/windows.html#install-windows + del self.options.with_saslauthd if is_msvc(self): # always required del self.options.with_openssl @@ -137,6 +142,7 @@ def _generate_autotools(self): "--with-mysql={}".format(rootpath_no(self.options.with_mysql, "libmysqlclient")), "--without-sqlite", "--with-sqlite3={}".format(rootpath_no(self.options.with_sqlite3, "sqlite3")), + "--with-saslauthd={}".format(yes_no(self.options.with_saslauthd)), ]) if self.options.with_gssapi: tc.configure_args.append("--with-gss_impl=mit") @@ -242,7 +248,9 @@ def package_info(self): self.cpp_info.libs = ["sasl2"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["resolv", "crypt"] + self.cpp_info.system_libs = ["resolv"] + if self.options.with_saslauthd: + self.cpp_info.system_libs.append("crypt") elif is_msvc(self): self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/dacap-clip/all/conandata.yml b/recipes/dacap-clip/all/conandata.yml index f4f5540f11df5..4c3c17aeedcf5 100644 --- a/recipes/dacap-clip/all/conandata.yml +++ b/recipes/dacap-clip/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.9": + url: "https://github.com/dacap/clip/archive/refs/tags/v1.9.tar.gz" + sha256: "e8af414c720784a6005419afb087786c05602e998ec52b2efe9e3112b7535d30" + "1.8": + url: "https://github.com/dacap/clip/archive/refs/tags/v1.8.tar.gz" + sha256: "a54d243451fb483590ffd9239a3c55f8d8e672d44df63dc2b81da01a229074bc" "1.7": url: "https://github.com/dacap/clip/archive/refs/tags/v1.7.tar.gz" sha256: "f494d306f3425e984368cbd94ffb213e0a3b3d44c3ab169e5134788d3342535c" diff --git a/recipes/dacap-clip/all/conanfile.py b/recipes/dacap-clip/all/conanfile.py index c4021d403c55f..9c743f68fab4e 100644 --- a/recipes/dacap-clip/all/conanfile.py +++ b/recipes/dacap-clip/all/conanfile.py @@ -7,6 +7,7 @@ from conan.tools.microsoft import is_msvc from conan.tools.apple import is_apple_os from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -23,11 +24,13 @@ class DacapClipConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_png": [True, False], + "with_image": [True, False], } default_options = { "shared": False, "fPIC": True, "with_png": True, + "with_image": True, } @property @@ -37,19 +40,21 @@ def _min_cppstd(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_png + if Version(self.version) < "1.8": + del self.options.with_image def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - if self.settings.os not in ["Linux", "FreeBSD"]: - del self.options.with_png def layout(self): cmake_layout(self, src_folder="src") def requirements(self): if self.options.get_safe("with_png", False): - self.requires("libpng/1.6.37") + self.requires("libpng/[>=1.6 <2]") if self.settings.os == "Linux": self.requires("xorg/system") @@ -67,6 +72,7 @@ def generate(self): toolchain.variables["CLIP_EXAMPLES"] = False toolchain.variables["CLIP_TESTS"] = False toolchain.variables["CLIP_X11_WITH_PNG"] = self.options.get_safe("with_png", False) + toolchain.variables["CLIP_ENABLE_IMAGE"] = self.options.get_safe("with_image", False) if is_msvc(self): toolchain.cache_variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = bool(self.options.shared) toolchain.generate() @@ -93,6 +99,8 @@ def package_info(self): if self.options.get_safe("with_png", False): self.cpp_info.requires.append("libpng::libpng") + if self.options.get_safe("with_image", False): + self.cpp_info.defines.append("CLIP_ENABLE_IMAGE=1") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.requires.append("xorg::xcb") @@ -108,6 +116,6 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "clip") self.cpp_info.set_property("cmake_target_name", "clip::clip") - # TODO: Remove on Conan 2.0 + # TODO: Remove on Conan 2.0 self.cpp_info.names["cmake_find_package"] = "clip" self.cpp_info.names["cmake_find_package_multi"] = "clip" diff --git a/recipes/dacap-clip/config.yml b/recipes/dacap-clip/config.yml index f10766e09880a..baafafbfe03c1 100644 --- a/recipes/dacap-clip/config.yml +++ b/recipes/dacap-clip/config.yml @@ -1,4 +1,8 @@ versions: + "1.9": + folder: "all" + "1.8": + folder: "all" "1.7": folder: "all" "1.6": diff --git a/recipes/dataframe/all/conandata.yml b/recipes/dataframe/all/conandata.yml index 85f628c2e20ac..8c70c0dff65c4 100644 --- a/recipes/dataframe/all/conandata.yml +++ b/recipes/dataframe/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.2.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/3.2.0.tar.gz" + sha256: "ca0c27cddf7a77da008d4b85e620e65baf5fcdf107f5e523ec38e7c55d778f7e" + "3.1.0": + url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/3.1.0.tar.gz" + sha256: "09280a81f17d87d171062210c904c1acd94b1cdcf4c040eaa16cc9d224d526d4" "3.0.0": url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/3.0.0.tar.gz" sha256: "9266fb85c518a251a5440e490c81615601791f2de2fad8755aa09f13a0c541f9" diff --git a/recipes/dataframe/config.yml b/recipes/dataframe/config.yml index 3f378327b126e..b500f2488a199 100644 --- a/recipes/dataframe/config.yml +++ b/recipes/dataframe/config.yml @@ -1,4 +1,8 @@ versions: + "3.2.0": + folder: all + "3.1.0": + folder: all "3.0.0": folder: all "2.3.0": diff --git a/recipes/dav1d/all/conandata.yml b/recipes/dav1d/all/conandata.yml index a478887dc4fcc..be4e7f8263cbc 100644 --- a/recipes/dav1d/all/conandata.yml +++ b/recipes/dav1d/all/conandata.yml @@ -1,19 +1,13 @@ sources: + "1.4.3": + url: "http://ftp.videolan.org/pub/videolan/dav1d/1.4.3/dav1d-1.4.3.tar.xz" + sha256: "42fe524bcc82ea3a830057178faace22923a79bad3d819a4962d8cfc54c36f19" + "1.4.1": + url: "http://ftp.videolan.org/pub/videolan/dav1d/1.4.1/dav1d-1.4.1.tar.xz" + sha256: "8d407dd5fe7986413c937b14e67f36aebd06e1fa5cfec679d10e548476f2d5f8" "1.3.0": url: "http://ftp.videolan.org/pub/videolan/dav1d/1.3.0/dav1d-1.3.0.tar.xz" sha256: "6d8be2741c505c47f8f1ced3c9cc427759243436553d01d1acce201f87b39e71" "1.2.1": url: "http://ftp.videolan.org/pub/videolan/dav1d/1.2.1/dav1d-1.2.1.tar.xz" sha256: "4e33eb61ec54c768a16da0cf8fa0928b4c4593f5f804a3c887d4a21c318340b2" - "1.1.0": - url: "http://ftp.videolan.org/pub/videolan/dav1d/1.1.0/dav1d-1.1.0.tar.xz" - sha256: "fb57aae7875f28c30fb3dbae4a3683d27e2f91dde09ce5c60c22cef9bc58dfd1" - "1.0.0": - url: "http://ftp.videolan.org/pub/videolan/dav1d/1.0.0/dav1d-1.0.0.tar.xz" - sha256: "51737db7e4897e599684f873a4725176dd3c779e639411d7c4fce134bb5ebb82" - "0.9.1": - url: "http://ftp.videolan.org/pub/videolan/dav1d/0.9.1/dav1d-0.9.1.tar.xz" - sha256: "a35d6468013eb14e8093ea463594f8b89aba1775a3005fc9ec6fa36b2d2c71d7" - "0.8.1": - url: "http://ftp.videolan.org/pub/videolan/dav1d/0.8.1/dav1d-0.8.1.tar.xz" - sha256: "a4b503063d411dd129f5eb43616675e613b36ac0aa1e449976d645c05add21ea" diff --git a/recipes/dav1d/all/conanfile.py b/recipes/dav1d/all/conanfile.py index 5882f930a7dbd..08d0c4d8be0f5 100644 --- a/recipes/dav1d/all/conanfile.py +++ b/recipes/dav1d/all/conanfile.py @@ -5,7 +5,6 @@ from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain from conan.tools.microsoft import is_msvc -from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -26,7 +25,7 @@ class Dav1dConan(ConanFile): "bit_depth": ["all", 8, 16], "with_tools": [True, False], "assembly": [True, False], - "with_avx512": [True, False], + "with_avx512": ["deprecated", True, False], } default_options = { "shared": False, @@ -34,7 +33,7 @@ class Dav1dConan(ConanFile): "bit_depth": "all", "with_tools": True, "assembly": True, - "with_avx512": False, + "with_avx512": "deprecated", } def config_options(self): @@ -43,24 +42,27 @@ def config_options(self): if is_msvc(self) and self.settings.build_type == "Debug": # debug builds with assembly often causes linker hangs or LNK1000 self.options.assembly = False - if Version(self.version) < "1.0.0": - del self.options.with_avx512 def configure(self): if self.options.shared: self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") - if not self.options.assembly: - self.options.rm_safe("with_avx512") def layout(self): basic_layout(self, src_folder="src") + def package_id(self): + del self.info.options.with_avx512 + + def validate(self): + if self.options.with_avx512 != "deprecated": + self.output.warning("The 'with_avx512' option is deprecated and has no effect") + def build_requirements(self): - self.tool_requires("meson/1.2.1") + self.tool_requires("meson/1.4.0") if self.options.assembly: - self.tool_requires("nasm/2.15.05") + self.tool_requires("nasm/2.16.01") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -72,8 +74,6 @@ def generate(self): tc = MesonToolchain(self) tc.project_options["enable_tests"] = False tc.project_options["enable_asm"] = self.options.assembly - if Version(self.version) < "1.0.0": - tc.project_options["enable_avx512"] = self.options.get_safe("with_avx512", False) tc.project_options["enable_tools"] = self.options.with_tools if self.options.bit_depth == "all": tc.project_options["bitdepths"] = "8,16" diff --git a/recipes/dav1d/config.yml b/recipes/dav1d/config.yml index 21233fe470f83..d5bc79ec13e97 100644 --- a/recipes/dav1d/config.yml +++ b/recipes/dav1d/config.yml @@ -1,13 +1,9 @@ versions: - "1.3.0": - folder: "all" - "1.2.1": + "1.4.3": folder: "all" - "1.1.0": + "1.4.1": folder: "all" - "1.0.0": - folder: "all" - "0.9.1": + "1.3.0": folder: "all" - "0.8.1": + "1.2.1": folder: "all" diff --git a/recipes/daw_header_libraries/all/conandata.yml b/recipes/daw_header_libraries/all/conandata.yml index da4d268e47a7d..7a91f0409f234 100644 --- a/recipes/daw_header_libraries/all/conandata.yml +++ b/recipes/daw_header_libraries/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.106.1": + url: "https://github.com/beached/header_libraries/archive/v2.106.1.tar.gz" + sha256: "393815fbf249ca1220a216899cae3d2672ca193f9db228a0b99925a9b0f90854" + "2.106.0": + url: "https://github.com/beached/header_libraries/archive/v2.106.0.tar.gz" + sha256: "7838ada09afa69e7a42d742991c4b24b32ba27681e7b4dadf7b1e45c168937b5" "2.101.0": url: "https://github.com/beached/header_libraries/archive/v2.101.0.tar.gz" sha256: "468b3a40b90295f1da8eb79ae5723909269c020e7e8bf3d93d3f4fac7c35195b" @@ -11,30 +17,3 @@ sources: "2.96.1": url: "https://github.com/beached/header_libraries/archive/v2.96.1.tar.gz" sha256: "2a9a5c33baa9e3adc1d82fa13a56522638af13cc39372a0c1c8f5c5d984f1464" - "2.95.0": - url: "https://github.com/beached/header_libraries/archive/v2.95.0.tar.gz" - sha256: "8799c06f0587b202fd6049d95e70b04675acbfdbf6e86ac3bbd061cbb9d42b54" - "2.93.1": - url: "https://github.com/beached/header_libraries/archive/v2.93.1.tar.gz" - sha256: "200690094237e4a2c37ac81c23c8c5138ba90ccdeeb2a1dda37690a9d32301ad" - "2.92.0": - url: "https://github.com/beached/header_libraries/archive/v2.92.0.tar.gz" - sha256: "96835f0ff4d3082a38b4ef4c14653c88e193cd26a08cd406fdbfadcfd654d136" - "2.88.0": - url: "https://github.com/beached/header_libraries/archive/v2.88.0.tar.gz" - sha256: "2a634763f3d34f206f6b352ac9609a89d501059afea0ba7c857bd55adc435890" - "2.85.1": - url: "https://github.com/beached/header_libraries/archive/v2.85.1.tar.gz" - sha256: "fb4880e254a481e3c750261fdb75a1696afc9ef4404e095a7f3ba0683bcd9930" - "2.79.0": - url: "https://github.com/beached/header_libraries/archive/v2.79.0.tar.gz" - sha256: "2dfa8fc9495499379cff39ed648c6bba156a87eb177fc91a860045a410aebb99" - "2.76.3": - url: "https://github.com/beached/header_libraries/archive/v2.76.3.tar.gz" - sha256: "2d66f9aec38fb9a42779e0283fa2fc5842e04d34f2bf655c72a9beb4bf5cc8c8" - "2.76.2": - url: "https://github.com/beached/header_libraries/archive/v2.76.2.tar.gz" - sha256: "bfa2da192360a66e400d03a52f8a7bf0fccd23de1f446a812a8890b11df2c592" - "2.74.2": - url: "https://github.com/beached/header_libraries/archive/v2.74.2.tar.gz" - sha256: "32871df3d314cc9b4e293a9a8c79968d1c963dfd3dd60965dbf704eb18acb218" diff --git a/recipes/daw_header_libraries/all/conanfile.py b/recipes/daw_header_libraries/all/conanfile.py index b6840ea09fa55..98257810d2c5a 100644 --- a/recipes/daw_header_libraries/all/conanfile.py +++ b/recipes/daw_header_libraries/all/conanfile.py @@ -16,7 +16,7 @@ class DawHeaderLibrariesConan(ConanFile): license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/beached/header_libraries" - topics = ("algorithms", "helpers", "data-structures") + topics = ("algorithms", "helpers", "data-structures", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -44,7 +44,6 @@ def package_id(self): 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.get_safe("compiler.version")) < minimum_version: raise ConanInvalidConfiguration( @@ -54,9 +53,6 @@ def validate(self): 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="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) diff --git a/recipes/daw_header_libraries/config.yml b/recipes/daw_header_libraries/config.yml index 209a906c305c7..2d8e64c1e7c3e 100644 --- a/recipes/daw_header_libraries/config.yml +++ b/recipes/daw_header_libraries/config.yml @@ -1,4 +1,8 @@ versions: + "2.106.1": + folder: all + "2.106.0": + folder: all "2.101.0": folder: all "2.98.5": @@ -7,21 +11,3 @@ versions: folder: all "2.96.1": folder: all - "2.95.0": - folder: all - "2.93.1": - folder: all - "2.92.0": - folder: all - "2.88.0": - folder: all - "2.85.1": - folder: all - "2.79.0": - folder: all - "2.76.3": - folder: all - "2.76.2": - folder: all - "2.74.2": - folder: all diff --git a/recipes/daw_utf_range/all/conandata.yml b/recipes/daw_utf_range/all/conandata.yml index 274810345e204..38e97ab2afcd4 100644 --- a/recipes/daw_utf_range/all/conandata.yml +++ b/recipes/daw_utf_range/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.5": + url: "https://github.com/beached/utf_range/archive/v2.2.5.tar.gz" + sha256: "18cc142c319c817da86ed037813cd50a16ff1af8e041a22b8af11beaef30ca32" "2.2.4": url: "https://github.com/beached/utf_range/archive/v2.2.4.tar.gz" sha256: "e6df85d6da445c16507e738d70c6313df2a70e64b739a05d6437b06a5f83b8b1" @@ -11,3 +14,9 @@ sources: "2.2.0": url: "https://github.com/beached/utf_range/archive/v2.2.0.tar.gz" sha256: "00f60360736062403c8a7a94dd07c750366958f20d1864578faecf2e09d84265" +daw_headers_mapping: + "2.2.5": "2.106.0" + "2.2.4": "2.101.0" + "2.2.3": "2.97.0" + "2.2.2": "2.97.0" + "2.2.0": "2.97.0" diff --git a/recipes/daw_utf_range/all/conanfile.py b/recipes/daw_utf_range/all/conanfile.py index ad4fd8d98f0b6..bb05e8ba48169 100644 --- a/recipes/daw_utf_range/all/conanfile.py +++ b/recipes/daw_utf_range/all/conanfile.py @@ -38,10 +38,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if Version(self.version) >= "2.2.4": - self.requires("daw_header_libraries/2.101.0") - else: - self.requires("daw_header_libraries/2.97.0") + corresponding_daw_header_version = self.conan_data["daw_headers_mapping"][self.version] + self.requires(f"daw_header_libraries/{corresponding_daw_header_version}") def package_id(self): self.info.clear() diff --git a/recipes/daw_utf_range/config.yml b/recipes/daw_utf_range/config.yml index 0856bcef8b94d..86bdc8b77e0d5 100644 --- a/recipes/daw_utf_range/config.yml +++ b/recipes/daw_utf_range/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.5": + folder: "all" "2.2.4": folder: "all" "2.2.3": diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py index c20fd3f03b189..0d7c729968e28 100644 --- a/recipes/dbus/1.x.x/conanfile.py +++ b/recipes/dbus/1.x.x/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name, is_apple_os from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rm, rmdir, save +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rm, rmdir, save from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain @@ -10,12 +10,13 @@ import os import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class DbusConan(ConanFile): name = "dbus" - license = ("AFL-2.1", "GPL-2.0-or-later") + # license is AFL-2.1 OR GPL-2.0-or-later with several other compatible licenses for smaller sections of code + license = "(AFL-2.1 OR GPL-2.0-or-later) AND DocumentRef-COPYING" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.freedesktop.org/wiki/Software/dbus" description = "D-Bus is a simple system for interprocess communication and coordination." @@ -26,65 +27,81 @@ class DbusConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "dbus_user": [None, "ANY"], + "message_bus": [True, False], "system_socket": [None, "ANY"], "system_pid_file": [None, "ANY"], "with_x11": [True, False], - "with_glib": [True, False], "with_systemd": [True, False], "with_selinux": [True, False], - "session_socket_dir": ["ANY"], + "session_socket_dir": [None, "ANY"], } default_options = { "shared": False, "fPIC": True, + "dbus_user": "messagebus", + "message_bus": False, "system_socket": None, "system_pid_file": None, "with_x11": False, - "with_glib": False, "with_systemd": False, "with_selinux": False, "session_socket_dir": "/tmp", } + @property + def _has_message_bus_option(self): + return Version(self.version) > "1.15.2" + def export_sources(self): export_conandata_patches(self) def config_options(self): - if self.settings.os not in ("Linux", "FreeBSD"): + if self.settings.os not in ["Linux", "FreeBSD"]: del self.options.with_systemd - if self.settings.os not in ("Linux", "FreeBSD"): del self.options.with_x11 + del self.options.with_selinux if self.settings.os == "Windows": del self.options.fPIC + if not self._has_message_bus_option: + self.options.rm_safe("message_bus") def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") if self.options.shared: self.options.rm_safe("fPIC") + if not self.options.get_safe("message_bus"): + self.options.rm_safe("dbus_user") def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") - if self.options.with_glib: - self.requires("glib/2.77.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.get_safe("with_systemd"): self.requires("libsystemd/253.6") - if self.options.with_selinux: - self.requires("libselinux/3.3") + if self.options.get_safe("with_selinux"): + self.requires("libselinux/3.5") if self.options.get_safe("with_x11"): - self.requires("xorg/system") + # X11 is only linked into an executable and should not be propagated as a library dependency. + # It should still be provided in a VirtualRunEnv context, though, + # but Conan as of v2.2 does not yet provide a fine-grained enough control over this. + self.requires("xorg/system", visible=False) + + def package_id(self): + # The dbus_user option only effects the installation of dbus during the package method. + # Otherwise, it only appears in the system.conf file in the package. + self.info.options.rm_safe("dbus_user") def validate(self): if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 7: raise ConanInvalidConfiguration(f"{self.ref} requires at least gcc 7.") def build_requirements(self): - self.tool_requires("meson/1.2.0") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config",check_type=str): - self.tool_requires("pkgconf/1.9.5") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -95,45 +112,57 @@ def generate(self): tc = MesonToolchain(self) tc.project_options["asserts"] = not is_apple_os(self) tc.project_options["checks"] = False + tc.project_options["datadir"] = os.path.join("res", "share") + tc.project_options["sysconfdir"] = os.path.join("res", "etc") tc.project_options["doxygen_docs"] = "disabled" + tc.project_options["ducktype_docs"] = "disabled" + tc.project_options["qt_help"] = "disabled" tc.project_options["modular_tests"] = "disabled" - tc.project_options["system_socket"] = str(self.options.get_safe("system_socket", "")) - tc.project_options["system_pid_file"] = str(self.options.get_safe("system_pid_file", "")) - tc.project_options["session_socket_dir"] = str(self.options.get_safe("session_socket_dir", "")) - tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux", False) else "disabled" - tc.project_options["systemd"] = "enabled" if self.options.get_safe("with_systemd", False) else "disabled" - if self.options.get_safe("with_systemd", False): - tc.project_options["systemd_system_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "system") - tc.project_options["systemd_user_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "user") + tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux") else "disabled" + if self.options.session_socket_dir: + tc.project_options["session_socket_dir"] = str(self.options.session_socket_dir) + tc.project_options["systemd"] = "enabled" if self.options.get_safe("with_systemd") else "disabled" + if self.options.get_safe("with_systemd"): + tc.project_options["systemd_system_unitdir"] = "/res/lib/systemd/system" + tc.project_options["systemd_user_unitdir"] = "/res/usr/lib/systemd/system" + if self._has_message_bus_option: + tc.project_options["message_bus"] = bool(self.options.message_bus) + if self.options.get_safe("dbus_user"): + tc.project_options["dbus_user"] = str(self.options.dbus_user) + if self.options.system_pid_file: + tc.project_options["system_pid_file"] = str(self.options.system_pid_file) + if self.options.system_socket: + tc.project_options["system_socket"] = str(self.options.system_socket) if is_apple_os(self): - tc.project_options["launchd_agent_dir"] = os.path.join(self.package_folder, "res", "LaunchAgents") - tc.project_options["x11_autolaunch"] = "enabled" if self.options.get_safe("with_x11", False) else "disabled" + tc.project_options["launchd_agent_dir"] = os.path.join("res", "LaunchAgents") + tc.project_options["x11_autolaunch"] = "enabled" if self.options.get_safe("with_x11") else "disabled" tc.project_options["xml_docs"] = "disabled" tc.generate() deps = PkgConfigDeps(self) deps.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) - replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('test')", "# subdir('test')") + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "subdir('test')", "# subdir('test')") + + def build(self): + self._patch_sources() meson = Meson(self) meson.configure() meson.build() def package(self): - copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*", os.path.join(self.source_folder, "LICENSES"), os.path.join(self.package_folder, "licenses")) meson = Meson(self) meson.install() rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - rmdir(self, os.path.join(self.package_folder, "share", "doc")) - mkdir(self, os.path.join(self.package_folder, "res")) - for i in ["var", "share", "etc"]: - rename(self, os.path.join(self.package_folder, i), os.path.join(self.package_folder, "res", i)) + rmdir(self, os.path.join(self.package_folder, "res", "share", "doc")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - rmdir(self, os.path.join(self.package_folder, "lib", "systemd")) fix_apple_shared_install_name(self) if self.settings.os == "Windows" and not self.options.shared: rename(self, os.path.join(self.package_folder, "lib", "libdbus-1.a"), os.path.join(self.package_folder, "lib", "dbus-1.lib")) @@ -179,6 +208,12 @@ def package_info(self): if not self.options.shared: self.cpp_info.defines.append("DBUS_STATIC_BUILD") + self.cpp_info.requires.append("expat::expat") + if self.options.get_safe("with_systemd"): + self.cpp_info.requires.append("libsystemd::libsystemd") + if self.options.get_safe("with_selinux"): + self.cpp_info.requires.append("libselinux::selinux") + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed self.cpp_info.filenames["cmake_find_package"] = "DBus1" self.cpp_info.filenames["cmake_find_package_multi"] = "DBus1" diff --git a/recipes/dd-opentracing-cpp/all/CMakeLists.txt b/recipes/dd-opentracing-cpp/all/CMakeLists.txt deleted file mode 100644 index 4adab61a177bf..0000000000000 --- a/recipes/dd-opentracing-cpp/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -if(CONAN_COMPILER MATCHES "clang" AND CONAN_COMPILER_VERSION VERSION_LESS "4.0") - add_compile_options(-ftemplate-depth=1024) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/dd-opentracing-cpp/all/conandata.yml b/recipes/dd-opentracing-cpp/all/conandata.yml index 5c4a8f88936e6..d9d5dcbf278c1 100644 --- a/recipes/dd-opentracing-cpp/all/conandata.yml +++ b/recipes/dd-opentracing-cpp/all/conandata.yml @@ -1,8 +1,12 @@ sources: + "1.3.7": + url: "https://github.com/DataDog/dd-opentracing-cpp/archive/refs/tags/v1.3.7.tar.gz" + sha256: "8d39c6b23f941a2d11571daaccc04e69539a3fcbcc50a631837560d5861a7b96" "1.3.0": - url: https://github.com/DataDog/dd-opentracing-cpp/archive/refs/tags/v1.3.0.tar.gz - sha256: 16aad0c0daed054d4bcdf68cf069956e8d3b0c60a33c2162ad655a17b33b65e4 + url: "https://github.com/DataDog/dd-opentracing-cpp/archive/refs/tags/v1.3.0.tar.gz" + sha256: "16aad0c0daed054d4bcdf68cf069956e8d3b0c60a33c2162ad655a17b33b65e4" patches: + "1.3.7": + - patch_file: "patches/1.3.7/0001-Find-packages-setup.patch" "1.3.0": - - base_path: "source_subfolder" - patch_file: "patches/0001-Find-packages-setup.patch" + - patch_file: "patches/1.3.0/0001-Find-packages-setup.patch" diff --git a/recipes/dd-opentracing-cpp/all/conanfile.py b/recipes/dd-opentracing-cpp/all/conanfile.py index 39cb79ab41f5f..953c532aa7291 100644 --- a/recipes/dd-opentracing-cpp/all/conanfile.py +++ b/recipes/dd-opentracing-cpp/all/conanfile.py @@ -1,17 +1,24 @@ -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 +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class DatadogOpenTracingConan(ConanFile): name = "dd-opentracing-cpp" description = "Monitoring service for cloud-scale applications based on OpenTracing " license = "Apache-2.0" - topics = ("instrumentration", "monitoring", "security", "tracing") - homepage = "https://github.com/DataDog/dd-opentracing-cpp" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/DataDog/dd-opentracing-cpp" + topics = ("instrumentation", "monitoring", "security", "tracing") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -22,30 +29,18 @@ class DatadogOpenTracingConan(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" - @property def _compilers_minimum_version(self): return { "gcc": "5", "Visual Studio": "15", + "msvc": "191", "clang": "3.4", "apple-clang": "7", } 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": @@ -53,68 +48,59 @@ 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("opentracing-cpp/1.6.0") - self.requires("zlib/1.2.11") - self.requires("libcurl/7.80.0") - self.requires("msgpack/3.3.0") - self.requires("nlohmann_json/3.10.5") + self.requires("opentracing-cpp/1.6.0", transitive_headers=True, transitive_libs=True) + self.requires("zlib/[>=1.2.11 <2]") + self.requires("libcurl/[>=7.78 <9]") + self.requires("msgpack-cxx/6.1.0") + self.requires("nlohmann_json/3.11.2") + + @property + def _min_cppstd(self): + return 14 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: - if tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("Datadog-opentracing requires C++14, which your compiler does not support.") - else: - self.output.warn("Datadog-opentracing requires C++14. Your compiler is unknown. Assuming it supports C++14.") + if 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 generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_PLUGIN"] = False + tc.variables["BUILD_SHARED"] = self.options.shared + tc.variables["BUILD_STATIC"] = not self.options.shared + tc.variables["BUILD_TESTING"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_PLUGIN"] = False - self._cmake.definitions["BUILD_SHARED"] = self.options.shared - self._cmake.definitions["BUILD_STATIC"] = not self.options.shared - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() def package_info(self): - # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["dd_opentracing"].libs = ["dd_opentracing"] - self.cpp_info.components["dd_opentracing"].defines.append( - "DD_OPENTRACING_SHARED" if self.options.shared else "DD_OPENTRACING_STATIC" - ) + self.cpp_info.libs = ["dd_opentracing"] + self.cpp_info.defines.append("DD_OPENTRACING_SHARED" if self.options.shared else "DD_OPENTRACING_STATIC") if self.settings.os in ("Linux", "FreeBSD"): - self.cpp_info.components["dd_opentracing"].system_libs.append("pthread") - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed. - # Do not support these names in CMakeDeps, it was a mistake, upstream doesn't export targets - self.cpp_info.names["cmake_find_package"] = "DataDogOpenTracing" - self.cpp_info.names["cmake_find_package_multi"] = "DataDogOpenTracing" - target_suffix = "" if self.options.shared else "-static" - self.cpp_info.components["dd_opentracing"].names["cmake_find_package"] = "dd_opentracing" + target_suffix - self.cpp_info.components["dd_opentracing"].names["cmake_find_package_multi"] = "dd_opentracing" + target_suffix - self.cpp_info.components["dd_opentracing"].requires = [ - "opentracing-cpp::opentracing-cpp", "zlib::zlib", "libcurl::libcurl", - "msgpack::msgpack", "nlohmann_json::nlohmann_json", - ] + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/dd-opentracing-cpp/all/patches/0001-Find-packages-setup.patch b/recipes/dd-opentracing-cpp/all/patches/0001-Find-packages-setup.patch deleted file mode 100644 index 3308c5a043699..0000000000000 --- a/recipes/dd-opentracing-cpp/all/patches/0001-Find-packages-setup.patch +++ /dev/null @@ -1,65 +0,0 @@ ---- - CMakeLists.txt | 30 ++++++++++-------------------- - 1 file changed, 10 insertions(+), 20 deletions(-) - ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -34,17 +34,12 @@ include_directories(include) - set(CMAKE_LIBRARY_PATH deps/lib) - - # Dependencies --find_path(OPENTRACING_INCLUDE_DIR NAMES opentracing/tracer.h) --find_library(OPENTRACING_LIB opentracing) -+find_package(OpenTracing REQUIRED) - find_package(ZLIB REQUIRED) --find_library(MSGPACK_LIB msgpack) --find_package(CURL) -+find_package(msgpack REQUIRED) -+find_package(CURL REQUIRED) - find_package(Threads REQUIRED) - --# Code Sanitizers --set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/3rd_party/sanitizers-cmake" ${CMAKE_MODULE_PATH}) --find_package(Sanitizers) -- - # Code - install(DIRECTORY include/datadog DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - file(GLOB DD_OPENTRACING_SOURCES "src/*.cpp") -@@ -58,29 +53,24 @@ else() - endif() - - # Outputs --set(DATADOG_LINK_LIBRARIES ${OPENTRACING_LIB} ${CURL_LIBRARIES} ${ZLIB_LIBRARIES} Threads::Threads) -+set(DATADOG_LINK_LIBRARIES OpenTracing::OpenTracing CURL::CURL msgpack::msgpack ZLIB::ZLIB Threads::Threads) - - ## Shared lib - if(BUILD_SHARED) - add_library(dd_opentracing SHARED ${DD_OPENTRACING_SOURCES}) -- add_sanitizers(dd_opentracing) - target_link_libraries(dd_opentracing ${DATADOG_LINK_LIBRARIES}) - set_target_properties(dd_opentracing PROPERTIES SOVERSION ${SOVERSION}) -- target_compile_definitions(dd_opentracing PRIVATE DD_OPENTRACING_SHARED) -- install(TARGETS dd_opentracing -- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ target_compile_definitions(dd_opentracing PUBLIC DD_OPENTRACING_SHARED) -+ install(TARGETS dd_opentracing) - endif() - - ## Static lib - if(BUILD_STATIC) - add_library(dd_opentracing-static STATIC ${DD_OPENTRACING_SOURCES}) -- add_sanitizers(dd_opentracing-static) -- set_target_properties(dd_opentracing-static PROPERTIES OUTPUT_NAME dd_opentracing POSITION_INDEPENDENT_CODE ON) -- target_compile_definitions(dd_opentracing PRIVATE DD_OPENTRACING_STATIC) -- install(TARGETS dd_opentracing-static -- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ target_link_libraries(dd_opentracing-static ${DATADOG_LINK_LIBRARIES}) -+ set_target_properties(dd_opentracing-static PROPERTIES OUTPUT_NAME dd_opentracing) -+ target_compile_definitions(dd_opentracing-static PUBLIC DD_OPENTRACING_STATIC) -+ install(TARGETS dd_opentracing-static) - endif() - - ## Plugin - diff --git a/recipes/dd-opentracing-cpp/all/patches/1.3.0/0001-Find-packages-setup.patch b/recipes/dd-opentracing-cpp/all/patches/1.3.0/0001-Find-packages-setup.patch new file mode 100644 index 0000000000000..da57cbb9c9845 --- /dev/null +++ b/recipes/dd-opentracing-cpp/all/patches/1.3.0/0001-Find-packages-setup.patch @@ -0,0 +1,54 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -34,16 +34,11 @@ + set(CMAKE_LIBRARY_PATH deps/lib) + + # Dependencies +-find_path(OPENTRACING_INCLUDE_DIR NAMES opentracing/tracer.h) +-find_library(OPENTRACING_LIB opentracing) ++find_package(OpenTracing REQUIRED CONFIG) + find_package(ZLIB REQUIRED) +-find_library(MSGPACK_LIB msgpack) +-find_package(CURL) ++find_package(msgpack REQUIRED CONFIG) ++find_package(CURL REQUIRED CONFIG) + find_package(Threads REQUIRED) +- +-# Code Sanitizers +-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/3rd_party/sanitizers-cmake" ${CMAKE_MODULE_PATH}) +-find_package(Sanitizers) + + # Code + install(DIRECTORY include/datadog DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +@@ -58,16 +53,16 @@ + endif() + + # Outputs +-set(DATADOG_LINK_LIBRARIES ${OPENTRACING_LIB} ${CURL_LIBRARIES} ${ZLIB_LIBRARIES} Threads::Threads) ++set(DATADOG_LINK_LIBRARIES OpenTracing::OpenTracing CURL::libcurl msgpack-cxx ZLIB::ZLIB Threads::Threads) + + ## Shared lib + if(BUILD_SHARED) + add_library(dd_opentracing SHARED ${DD_OPENTRACING_SOURCES}) +- add_sanitizers(dd_opentracing) + target_link_libraries(dd_opentracing ${DATADOG_LINK_LIBRARIES}) + set_target_properties(dd_opentracing PROPERTIES SOVERSION ${SOVERSION}) + target_compile_definitions(dd_opentracing PRIVATE DD_OPENTRACING_SHARED) + install(TARGETS dd_opentracing ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() +@@ -75,9 +70,9 @@ + ## Static lib + if(BUILD_STATIC) + add_library(dd_opentracing-static STATIC ${DD_OPENTRACING_SOURCES}) +- add_sanitizers(dd_opentracing-static) +- set_target_properties(dd_opentracing-static PROPERTIES OUTPUT_NAME dd_opentracing POSITION_INDEPENDENT_CODE ON) +- target_compile_definitions(dd_opentracing PRIVATE DD_OPENTRACING_STATIC) ++ target_link_libraries(dd_opentracing-static ${DATADOG_LINK_LIBRARIES}) ++ set_target_properties(dd_opentracing-static PROPERTIES OUTPUT_NAME dd_opentracing) ++ target_compile_definitions(dd_opentracing-static PUBLIC DD_OPENTRACING_STATIC) + install(TARGETS dd_opentracing-static + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/recipes/dd-opentracing-cpp/all/patches/1.3.7/0001-Find-packages-setup.patch b/recipes/dd-opentracing-cpp/all/patches/1.3.7/0001-Find-packages-setup.patch new file mode 100644 index 0000000000000..9c70c924a04a6 --- /dev/null +++ b/recipes/dd-opentracing-cpp/all/patches/1.3.7/0001-Find-packages-setup.patch @@ -0,0 +1,60 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -35,15 +35,10 @@ + set(CMAKE_LIBRARY_PATH deps/lib) + + # Dependencies +-find_path(OPENTRACING_INCLUDE_DIR NAMES opentracing/tracer.h) +-find_library(OPENTRACING_LIB opentracing) +-find_library(MSGPACK_LIB msgpack) +-find_package(CURL) ++find_package(OpenTracing REQUIRED CONFIG) ++find_package(msgpack REQUIRED CONFIG) ++find_package(CURL REQUIRED CONFIG) + find_package(Threads REQUIRED) +- +-# Code Sanitizers +-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/3rd_party/sanitizers-cmake" ${CMAKE_MODULE_PATH}) +-find_package(Sanitizers) + + # Code + install(DIRECTORY include/datadog DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +@@ -64,12 +59,12 @@ + if(BUILD_COVERAGE) + set(COVERAGE_LIBRARIES gcov) + endif() +-set(DATADOG_LINK_LIBRARIES ${OPENTRACING_LIB} ${CURL_LIBRARIES} Threads::Threads ${COVERAGE_LIBRARIES}) ++set(DATADOG_LINK_LIBRARIES OpenTracing::OpenTracing CURL::libcurl ${msgpack_LIBRARIES} ZLIB::ZLIB Threads::Threads) ++include_directories(${msgpack_INCLUDE_DIRS}) + + ## Shared lib + if(BUILD_SHARED) + add_library(dd_opentracing SHARED ${DD_OPENTRACING_SOURCES}) +- add_sanitizers(dd_opentracing) + if(BUILD_COVERAGE) + target_link_options(dd_opentracing PRIVATE -fprofile-arcs -ftest-coverage) + endif() +@@ -77,6 +72,7 @@ + set_target_properties(dd_opentracing PROPERTIES SOVERSION ${SOVERSION}) + target_compile_definitions(dd_opentracing PUBLIC DD_OPENTRACING_SHARED) + install(TARGETS dd_opentracing ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() +@@ -84,13 +80,10 @@ + ## Static lib + if(BUILD_STATIC) + add_library(dd_opentracing-static STATIC ${DD_OPENTRACING_SOURCES}) +- add_sanitizers(dd_opentracing-static) + target_link_libraries(dd_opentracing-static ${DATADOG_LINK_LIBRARIES}) +- set_target_properties(dd_opentracing-static PROPERTIES OUTPUT_NAME dd_opentracing POSITION_INDEPENDENT_CODE ON) ++ set_target_properties(dd_opentracing-static PROPERTIES OUTPUT_NAME dd_opentracing) + target_compile_definitions(dd_opentracing-static PUBLIC DD_OPENTRACING_STATIC) +- install(TARGETS dd_opentracing-static +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(TARGETS dd_opentracing-static) + endif() + + ## Object lib diff --git a/recipes/dd-opentracing-cpp/all/test_package/CMakeLists.txt b/recipes/dd-opentracing-cpp/all/test_package/CMakeLists.txt index 61e5eac8d9ed0..f80f836e06bd4 100644 --- a/recipes/dd-opentracing-cpp/all/test_package/CMakeLists.txt +++ b/recipes/dd-opentracing-cpp/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(dd-opentracing-cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE dd-opentracing-cpp::dd-opentracing-cpp) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/dd-opentracing-cpp/all/test_package/conanfile.py b/recipes/dd-opentracing-cpp/all/test_package/conanfile.py index 5c09494bc67c0..ef5d7042163ec 100644 --- a/recipes/dd-opentracing-cpp/all/test_package/conanfile.py +++ b/recipes/dd-opentracing-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" + 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/android-ndk/all/test_v1_package/CMakeLists.txt b/recipes/dd-opentracing-cpp/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/android-ndk/all/test_v1_package/CMakeLists.txt rename to recipes/dd-opentracing-cpp/all/test_v1_package/CMakeLists.txt diff --git a/recipes/libgit2/0.27.x/test_package/conanfile.py b/recipes/dd-opentracing-cpp/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/libgit2/0.27.x/test_package/conanfile.py rename to recipes/dd-opentracing-cpp/all/test_v1_package/conanfile.py diff --git a/recipes/dd-opentracing-cpp/config.yml b/recipes/dd-opentracing-cpp/config.yml index 426a0e4c79e9b..670c8dce3f891 100644 --- a/recipes/dd-opentracing-cpp/config.yml +++ b/recipes/dd-opentracing-cpp/config.yml @@ -1,3 +1,5 @@ versions: + "1.3.7": + folder: all "1.3.0": folder: all diff --git a/recipes/detools/all/test_package/old b/recipes/detools/all/test_package/old deleted file mode 100644 index 0368e11feda26..0000000000000 Binary files a/recipes/detools/all/test_package/old and /dev/null differ diff --git a/recipes/detools/all/test_package/patch b/recipes/detools/all/test_package/patch deleted file mode 100644 index 99321d7000aa0..0000000000000 Binary files a/recipes/detools/all/test_package/patch and /dev/null differ diff --git a/recipes/detools/all/test_package/test_package.c b/recipes/detools/all/test_package/test_package.c index 7567264b2867b..b2e3a040fb0d5 100644 --- a/recipes/detools/all/test_package/test_package.c +++ b/recipes/detools/all/test_package/test_package.c @@ -1,38 +1,7 @@ #include #include "detools.h" -/* Helper functions. */ -static int flash_read(void *arg_p, void *dst_p, uintptr_t src, size_t size) -{ - return (0); -} - -static int flash_write(void *arg_p, uintptr_t dst, void *src_p, size_t size) -{ - return (0); -} - -static int flash_erase(void *arg_p, uintptr_t addr, size_t size) -{ - return (0); -} - -static int step_set(void *arg_p, int step) -{ - return (0); -} - -static int step_get(void *arg_p, int *step_p) -{ - return (0); -} - -static int serial_read(uint8_t *buf_p, size_t size) -{ - return (0); -} - -static int verify_written_data(int to_size, uint32_t to_crc) +static int dummy_function() { return (0); } @@ -44,16 +13,15 @@ int main() int res; size_t patch_size = 512; - /* Initialize the in-place apply patch object. */ res = detools_apply_patch_in_place_init(&apply_patch, - flash_read, - flash_write, - flash_erase, - step_set, - step_get, + dummy_function, + dummy_function, + dummy_function, + dummy_function, + dummy_function, patch_size, NULL); - + printf("detools_apply_patch_in_place_init: %d\n", res); if (res != 0) { return (res); } diff --git a/recipes/dfp/all/conandata.yml b/recipes/dfp/all/conandata.yml index ef5dd3970cc87..753d76e24d813 100644 --- a/recipes/dfp/all/conandata.yml +++ b/recipes/dfp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.3": + url: "https://github.com/epam/DFP/releases/download/1.0.3/native-sources.tar.gz" + sha256: "362e324687d6b8ca42490811331052c46cccb64a2cf078f3b6c8df92a374497c" "1.0.2": url: "https://github.com/epam/DFP/releases/download/1.0.2-cxx/native-sources.tar.gz" sha256: "f62acab311086c1207f7d58185232c7e86e11ed606596d9afcff49703c196058" diff --git a/recipes/dfp/config.yml b/recipes/dfp/config.yml index 8457ca9a4a8cd..f625d5d2b747f 100644 --- a/recipes/dfp/config.yml +++ b/recipes/dfp/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.3": + folder: all "1.0.2": folder: all diff --git a/recipes/dice-template-library/all/conandata.yml b/recipes/dice-template-library/all/conandata.yml index 8045d981c24de..f3c3a88f7edef 100644 --- a/recipes/dice-template-library/all/conandata.yml +++ b/recipes/dice-template-library/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.0": + url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v1.5.0.tar.gz" + sha256: "5ab4155097af5674dc9b34d1643db9ea8b30f78d15c1e547c58396ea31068ffd" "1.3.0": url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v1.3.0.tar.gz" sha256: "2e61e95eeedf31f7041a6694c0789c5d1a5e3f9e4db87546cb83c9189808d4f5" diff --git a/recipes/dice-template-library/config.yml b/recipes/dice-template-library/config.yml index 13451667044d0..4b83ac8cb2f11 100644 --- a/recipes/dice-template-library/config.yml +++ b/recipes/dice-template-library/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.0": + folder: all "1.3.0": folder: all "1.2.0": diff --git a/recipes/diligent-core/all/CMakeLists.txt b/recipes/diligent-core/all/CMakeLists.txt deleted file mode 100644 index a00123a14d403..0000000000000 --- a/recipes/diligent-core/all/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -cmake_minimum_required(VERSION 3.2) -project(cmake_wrapper) - -find_package(SPIRV-Tools REQUIRED CONFIG) -find_package(spirv-cross REQUIRED CONFIG) -find_package(glslang REQUIRED CONFIG) -find_package(volk REQUIRED CONFIG) -find_package(xxHash REQUIRED CONFIG) - -add_library(glslang INTERFACE) -target_link_libraries(glslang INTERFACE glslang::glslang) -target_include_directories(glslang INTERFACE ${glslang_INCLUDE_DIR}/glslang) - -add_library(SPIRV ALIAS glslang::SPIRV) -add_library(SPIRV-Headers ALIAS SPIRV-Headers::SPIRV-Headers) - -add_library(SPIRV-Tools-opt ALIAS spirv-tools::spirv-tools) -add_library(spirv-tools-core ALIAS spirv-tools::spirv-tools) -add_library(SPIRV-Tools-static ALIAS spirv-tools::spirv-tools) - -add_subdirectory(source_subfolder) - diff --git a/recipes/diligent-core/all/conan_deps.cmake b/recipes/diligent-core/all/conan_deps.cmake new file mode 100644 index 0000000000000..22d5c713e1417 --- /dev/null +++ b/recipes/diligent-core/all/conan_deps.cmake @@ -0,0 +1,15 @@ +find_package(SPIRV-Tools REQUIRED CONFIG) +find_package(spirv-cross REQUIRED CONFIG) +find_package(volk REQUIRED CONFIG) +find_package(xxHash REQUIRED CONFIG) + +if (NOT ${DILIGENT_NO_GLSLANG}) + find_package(glslang REQUIRED CONFIG) + add_library(glslang INTERFACE) + target_link_libraries(glslang INTERFACE glslang::glslang) + target_include_directories(glslang INTERFACE ${glslang_INCLUDE_DIR}/glslang) + add_library(SPIRV ALIAS glslang::SPIRV) +endif() + +add_library(SPIRV-Headers ALIAS SPIRV-Headers::SPIRV-Headers) +add_library(spirv-tools-core ALIAS spirv-tools::spirv-tools) diff --git a/recipes/diligent-core/all/conandata.yml b/recipes/diligent-core/all/conandata.yml index a48d5fbd77dc8..1b7fc1ffdeef6 100644 --- a/recipes/diligent-core/all/conandata.yml +++ b/recipes/diligent-core/all/conandata.yml @@ -23,37 +23,21 @@ sources: patches: "api.252003": - patch_file: "patches/0023-252003-fix-warning-as-error.patch" - base_path: "source_subfolder" "2.5.2": - patch_file: "patches/0014-252-exclude-tests.patch" - base_path: "source_subfolder" - patch_file: "patches/0015-252-dont-install-3d-party-license.patch" - base_path: "source_subfolder" - patch_file: "patches/0016-252-fix-glslang-usage.patch" - base_path: "source_subfolder" - patch_file: "patches/0017-252-fix-glslang-include.patch" - base_path: "source_subfolder" - patch_file: "patches/0018-252-fix-warning-as-error.patch" - base_path: "source_subfolder" "2.5.1": - patch_file: "patches/0001-remove_warning_as_error.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-use_conan_dependencies.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-use_volk_from_conan.patch" - base_path: "source_subfolder" - patch_file: "patches/0005-spirv-cross-namespace-override.patch" - base_path: "source_subfolder" - patch_file: "patches/0006-install-linux-platform-header.diff" - base_path: "source_subfolder" "api.250014": - patch_file: "patches/0007-API250014-remove_warning_as_error.patch" - base_path: "source_subfolder" - patch_file: "patches/0009-API250014-use_conan_dependencies_in_third_party.patch" - base_path: "source_subfolder" - patch_file: "patches/0010-API250014-use_volk_from_conan.patch" - base_path: "source_subfolder" - patch_file: "patches/0013-API250014-use-vulkan-headers-in-archiver.patch" - base_path: "source_subfolder" - patch_file: "patches/0005-spirv-cross-namespace-override.patch" - base_path: "source_subfolder" diff --git a/recipes/diligent-core/all/conanfile.py b/recipes/diligent-core/all/conanfile.py index a02de86844027..5b7a0c26b76e5 100644 --- a/recipes/diligent-core/all/conanfile.py +++ b/recipes/diligent-core/all/conanfile.py @@ -3,7 +3,8 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import cross_building, check_min_cppstd from conan.tools.scm import Version -from conan.tools.files import rm, get, rmdir, rename, collect_libs, patches, export_conandata_patches, copy, apply_conandata_patches +from conan.tools.files import rm, get, rmdir, rename, collect_libs, export_conandata_patches, copy, apply_conandata_patches, replace_in_file +from conan.tools.microsoft import visual from conan.tools.apple import is_apple_os import os @@ -34,6 +35,7 @@ class DiligentCoreConan(ConanFile): def _minimum_compilers_version(self): return { "Visual Studio": "16", + "msvc": "192", "gcc": "6", "clang": "3.4", "apple-clang": "5.1", @@ -48,29 +50,28 @@ def validate(self): 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.output.warning("{} recipe lacks information about the {} compiler support.".format( self.name, self.settings.compiler)) else: if Version(self.settings.compiler.version) < min_version: raise ConanInvalidConfiguration("{} requires C++{} support. The current compiler {} {} does not support it.".format( self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) - if self.settings.compiler == "Visual Studio" and "MT" in self.settings.compiler.runtime: + if visual.is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Visual Studio build with MT runtime is not supported") def export_sources(self): - copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder, keep_path=False) + copy(self, "conan_deps.cmake", src=self.recipe_folder, dst=os.path.join(self.export_sources_folder, "src"), keep_path=False) export_conandata_patches(self) def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=os.path.join(self.source_folder, "source_subfolder"), strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package_id(self): - if self.settings.compiler == "Visual Studio": - if "MD" in self.settings.compiler.runtime: - self.info.settings.compiler.runtime = "MD/MDd" - else: + if visual.is_msvc(self.info): + if visual.is_msvc_static_runtime(self.info): self.info.settings.compiler.runtime = "MT/MTd" + else: + self.info.settings.compiler.runtime = "MD/MDd" def generate(self): tc = CMakeToolchain(self) @@ -79,8 +80,7 @@ def generate(self): tc.variables["DILIGENT_BUILD_TESTS"] = False tc.variables["DILIGENT_NO_DXC"] = True tc.variables["DILIGENT_NO_GLSLANG"] = not self.options.with_glslang - tc.variables["SPIRV_CROSS_NAMESPACE_OVERRIDE"] = self.options["spirv-cross"].namespace - tc.variables["BUILD_SHARED_LIBS"] = False + tc.variables["SPIRV_CROSS_NAMESPACE_OVERRIDE"] = self.dependencies["spirv-cross"].options.namespace tc.variables["DILIGENT_CLANG_COMPILE_OPTIONS"] = "" tc.variables["DILIGENT_MSVC_COMPILE_OPTIONS"] = "" tc.variables["ENABLE_RTTI"] = True @@ -92,34 +92,37 @@ def generate(self): deps.generate() def layout(self): - cmake_layout(self) + cmake_layout(self, src_folder="src") def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + self.options.rm_safe("fPIC") def _patch_sources(self): - patches.apply_conandata_patches(self) + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "project(DiligentCore)", + "project(DiligentCore)\n\ninclude(conan_deps.cmake)") def build_requirements(self): - self.tool_requires("cmake/3.24.2") + self.tool_requires("cmake/[>=3.24 <4]") def requirements(self): self.requires("opengl/system") if self.settings.os == "Linux": - self.requires("wayland/1.21.0") + self.requires("wayland/1.22.0") self.requires("spirv-cross/1.3.224.0") self.requires("spirv-tools/1.3.224.0") if self.options.with_glslang: self.requires("glslang/1.3.224.0") - self.requires("vulkan-headers/1.3.224.1") + self.requires("vulkan-headers/1.3.224.0") self.requires("vulkan-validationlayers/1.3.224.1") - self.requires("volk/1.3.224.1") + self.requires("volk/1.3.224.0") self.requires("xxhash/0.8.1") if self.settings.os in ["Linux", "FreeBSD"]: @@ -144,21 +147,25 @@ def _diligent_platform(self): return "PLATFORM_TVOS" def build(self): - apply_conandata_patches(self) + self._patch_sources() cmake = CMake(self) - cmake.configure() + # By default, Diligent builds static and shared versions of every main library. We select the one we + # want based on options.shared in package(). To avoid building every intermediate library as SHARED, + # we have to disable BUILD_SHARED_LIBS. + # However, BUILD_SHARED_LIBS cannot be disabled normally (in the toolchain in configure()), because + # Conan outputs that override after the standard line that enables BUILD_SHARED_LIBS. Since the latter + # is a CACHE variable that cannot be overwritten with another set(), we have to specify it on the + # command-line, so it takes effect before the toolchain is parsed. + cmake.configure(variables={"BUILD_SHARED_LIBS": "OFF"}) cmake.build() def package(self): cmake = CMake(self) cmake.install() - rename(self, src=os.path.join(self.package_folder, "include", "source_subfolder"), - dst=os.path.join(self.package_folder, "include", "DiligentCore")) - rmdir(self, os.path.join(self.package_folder, "Licenses")) rmdir(self, os.path.join(self.package_folder, "lib")) rmdir(self, os.path.join(self.package_folder, "bin")) - copy(self, "License.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.package_folder, self.source_folder, "source_subfolder")) + copy(self, "License.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.package_folder, self.source_folder)) if self.options.shared: copy(self, pattern="*.dylib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) @@ -184,37 +191,37 @@ def package_info(self): self.cpp_info.libs = collect_libs(self) # included as discussed here https://github.com/conan-io/conan-center-index/pull/10732#issuecomment-1123596308 self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include")) - self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include", "DiligentCore", "Common")) - - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore")) - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Common", "interface")) - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "interface")) - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsEngine", "interface")) - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsEngineVulkan", "interface")) - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsEngineOpenGL", "interface")) - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsAccessories", "interface")) - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsTools", "interface")) - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "HLSL2GLSLConverterLib", "interface")) - archiver_path = os.path.join("include", "DiligentCore", "Graphics", "Archiver", "interface") + self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include", "Common")) + + self.cpp_info.includedirs.append(os.path.join("include")) + self.cpp_info.includedirs.append(os.path.join("include", "Common", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsEngine", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsEngineVulkan", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsEngineOpenGL", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsAccessories", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsTools", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "HLSL2GLSLConverterLib", "interface")) + archiver_path = os.path.join("include", "Graphics", "Archiver", "interface") if os.path.isdir(archiver_path): self.cpp_info.includedirs.append(archiver_path) - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Primitives", "interface")) - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Basic", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Primitives", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "Basic", "interface")) if self.settings.os == "Android": - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Android", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "Android", "interface")) elif is_apple_os(self): - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Apple", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "Apple", "interface")) elif self.settings.os == "Emscripten": - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Emscripten", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "Emscripten", "interface")) elif self.settings.os == "Linux": - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Linux", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "Linux", "interface")) elif self.settings.os == "Windows": - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Win32", "interface")) - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsEngineD3D11", "interface")) - self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsEngineD3D12", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "Win32", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsEngineD3D11", "interface")) + self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsEngineD3D12", "interface")) - self.cpp_info.defines.append("SPIRV_CROSS_NAMESPACE_OVERRIDE={}".format(self.options["spirv-cross"].namespace)) + self.cpp_info.defines.append("SPIRV_CROSS_NAMESPACE_OVERRIDE={}".format(self.dependencies["spirv-cross"].options.namespace)) self.cpp_info.defines.append("{}=1".format(self._diligent_platform())) if self.settings.os in ["Macos", "Linux"]: diff --git a/recipes/diligent-core/all/test_package/CMakeLists.txt b/recipes/diligent-core/all/test_package/CMakeLists.txt index 927e85d16c3ed..1960d37cb752f 100644 --- a/recipes/diligent-core/all/test_package/CMakeLists.txt +++ b/recipes/diligent-core/all/test_package/CMakeLists.txt @@ -1,24 +1,17 @@ cmake_minimum_required(VERSION 3.1) project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(diligent-core REQUIRED CONFIG) -if(WIN32) - set(FILE2STRING_PATH "${CONAN_BIN_DIRS_DILIGENT-CORE}/File2String.exe") -else() - set(FILE2STRING_PATH "${CONAN_BIN_DIRS_DILIGENT-CORE}/File2String") -endif() - -set(FILE "${CONAN_RES_DIRS_DILIGENT}/HLSLDefinitions.fxh") +set(FILE "${core_INCLUDE_DIR}/../res/HLSLDefinitions.fxh") set(CONVERTED_FILE "${PROJECT_BINARY_DIR}/HLSLDefinitions.h") add_custom_command(OUTPUT ${CONVERTED_FILE} - COMMAND ${FILE2STRING_PATH} ${FILE} ${CONVERTED_FILE} + COMMAND File2String ${FILE} ${CONVERTED_FILE} MAIN_DEPENDENCY ${FILE} # the primary input source file to the command COMMENT "Processing shader ${FILE}" VERBATIM) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} diligent-core::diligent-core) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/diligent-core/all/test_package/conanfile.py b/recipes/diligent-core/all/test_package/conanfile.py index f2355b8294daf..fc51d8e4aee2d 100644 --- a/recipes/diligent-core/all/test_package/conanfile.py +++ b/recipes/diligent-core/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 -from conan.tools.build import cross_building class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeDeps", "CMakeToolchain", "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 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/dispenso/all/conandata.yml b/recipes/dispenso/all/conandata.yml new file mode 100644 index 0000000000000..b025fdf2f9ff6 --- /dev/null +++ b/recipes/dispenso/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.3.0": + url: "https://github.com/facebookincubator/dispenso/archive/refs/tags/v1.3.0.tar.gz" + sha256: "824afe8d0d36bfd9bc9b1cbe9be89e7f3ed642a3612766d1c99d5f8dfc647c63" +patches: + "1.3.0": + - patch_file: "patches/1.3.0-001-unvendorize-concurrentqueue.patch" + patch_type: "conan" + patch_description: "Unvendorize concurrentqueue dependency" diff --git a/recipes/dispenso/all/conanfile.py b/recipes/dispenso/all/conanfile.py new file mode 100644 index 0000000000000..3c8d02f91bd44 --- /dev/null +++ b/recipes/dispenso/all/conanfile.py @@ -0,0 +1,118 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, export_conandata_patches, apply_conandata_patches, rm, rmdir +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + + +class DispensoPackage(ConanFile): + name = "dispenso" + description = "Dispenso is a library for working with sets of tasks in parallel" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/facebookincubator/dispenso" + topics = ("tasks", "parallel", "threads") + 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 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } + + 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 export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # Part of the public api in dispenso/thread_pool.h (and more), unvendorized + self.requires("concurrentqueue/1.0.4", transitive_headers=True) + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DISPENSO_SHARED_LIB"] = self.options.shared + if self.settings.os == "Windows": + tc.preprocessor_definitions["NOMINMAX"] = 1 + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = 1 + if self.settings.get_safe("compiler.cppstd") is None: + # TODO: Remove once Conan 1 is deprecated, this is needed so apple-clang + # can compile, as it defaults to C++98 + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.libs = ["dispenso"] + + self.cpp_info.set_property("cmake_file_name", "Dispenso") + self.cpp_info.set_property("cmake_target_name", "Dispenso::dispenso") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "m"]) + + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["synchronization", "winmm"]) + self.cpp_info.defines.append("NOMINMAX") diff --git a/recipes/dispenso/all/patches/1.3.0-001-unvendorize-concurrentqueue.patch b/recipes/dispenso/all/patches/1.3.0-001-unvendorize-concurrentqueue.patch new file mode 100644 index 0000000000000..59c0de38973fc --- /dev/null +++ b/recipes/dispenso/all/patches/1.3.0-001-unvendorize-concurrentqueue.patch @@ -0,0 +1,36 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7af1b8a..05c86a6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -48,8 +48,6 @@ elseif (THREAD_SANITIZER) + add_link_options(-fsanitize=thread) + endif() + +-set(CMAKE_CXX_STANDARD 14 CACHE STRING "the C++ standard to use for this project") +- + ########################################################### + # Targets + add_subdirectory(dispenso) +diff --git a/dispenso/CMakeLists.txt b/dispenso/CMakeLists.txt +index 24a8c48..9231949 100644 +--- a/dispenso/CMakeLists.txt ++++ b/dispenso/CMakeLists.txt +@@ -33,16 +33,15 @@ endif() + target_include_directories(dispenso + PUBLIC + $ +- $ + $ + $ +- $ + ) + + set(CMAKE_THREAD_PREFER_PTHREAD TRUE) + set(THREADS_PREFER_PTHREAD_FLAG TRUE) + find_package(Threads REQUIRED) +-target_link_libraries(dispenso PUBLIC Threads::Threads) ++find_package(concurrentqueue REQUIRED) ++target_link_libraries(dispenso PUBLIC Threads::Threads concurrentqueue::concurrentqueue) + + check_cxx_source_compiles(" + #include diff --git a/recipes/dispenso/all/test_package/CMakeLists.txt b/recipes/dispenso/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..37b4a548d33a9 --- /dev/null +++ b/recipes/dispenso/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(Dispenso REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Dispenso::dispenso) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/dispenso/all/test_package/conanfile.py b/recipes/dispenso/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/dispenso/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/dispenso/all/test_package/test_package.cpp b/recipes/dispenso/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..cd298492d0fe8 --- /dev/null +++ b/recipes/dispenso/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include "dispenso/parallel_for.h" + + +int main(void) { + dispenso::parallel_for(0, 5, [] (size_t j) { + std::cout << j << std::endl; + }); +} diff --git a/recipes/dispenso/config.yml b/recipes/dispenso/config.yml new file mode 100644 index 0000000000000..426a0e4c79e9b --- /dev/null +++ b/recipes/dispenso/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.0": + folder: all diff --git a/recipes/djvulibre/all/conandata.yml b/recipes/djvulibre/all/conandata.yml new file mode 100644 index 0000000000000..8f7d4ad051f7b --- /dev/null +++ b/recipes/djvulibre/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "3.5.28": + url: "http://downloads.sourceforge.net/djvu/djvulibre-3.5.28.tar.gz" + sha256: "fcd009ea7654fde5a83600eb80757bd3a76998e47d13c66b54c8db849f8f2edc" +patches: + "3.5.28": + - patch_file: "patches/remove-register-keyword.patch" + patch_type: "portability" + patch_description: "Remove deprecated 'register' keyword for C++17 compatibility" diff --git a/recipes/djvulibre/all/conanfile.py b/recipes/djvulibre/all/conanfile.py new file mode 100644 index 0000000000000..02736d758043d --- /dev/null +++ b/recipes/djvulibre/all/conanfile.py @@ -0,0 +1,187 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os +from conan.tools.build import cross_building, stdcpp_library +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rm, rmdir, save, rename, export_conandata_patches, apply_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path, check_min_vs +import os + +required_conan_version = ">=1.54.0" + + +class DjVuLibreConan(ConanFile): + name = "djvulibre" + description = "Library and utilities to create, manipulate and view DjVu documents" + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://djvu.sourceforge.net/" + topics = ("djvu", "file-format", "document-format") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tools": [True, False], + "with_libjpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg"], + } + default_options = { + "shared": False, + "fPIC": True, + "tools": False, + "with_libjpeg": "libjpeg", + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("libiconv/1.17") + if self.options.with_libjpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/3.0.2") + elif self.options.with_libjpeg == "mozjpeg": + self.requires("mozjpeg/4.1.5") + self.requires("libtiff/4.6.0") + + def validate(self): + if self.settings.os == "Windows" and not self.options.shared: + # __declspec(dllimport) or __declspec(dllexport) is always set for symbols + raise ConanInvalidConfiguration("Static linking is not supported on Windows") + + def build_requirements(self): + 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): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + if not cross_building(self): + VirtualRunEnv(self).generate(scope="build") + + tc = AutotoolsToolchain(self) + jpeg = self.dependencies[self.options.with_libjpeg.value].cpp_info.aggregated_components() + tiff = self.dependencies["libtiff"].cpp_info.aggregated_components() + tc.configure_args.extend([ + f"JPEG_LIBS={' '.join(f'-l{l}' for l in jpeg.libs)}", + f"TIFF_LIBS={' '.join(f'-l{l}' for l in tiff.libs)}", + ]) + if is_msvc(self): + tc.extra_cxxflags.append("-EHsc") + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.extra_ldflags.append("-ladvapi32") + 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") + env.define("NM", "dumpbin -symbols") + env.vars(self).save_script("conanbuild_msvc") + + if is_msvc(self): + # Custom AutotoolsDeps for cl-like compilers + # workaround for https://github.com/conan-io/conan/issues/12784 + includedirs = [] + defines = [] + libs = [] + libdirs = [] + linkflags = [] + cxxflags = [] + cflags = [] + for dependency in self.dependencies.values(): + deps_cpp_info = dependency.cpp_info.aggregated_components() + includedirs.extend(deps_cpp_info.includedirs) + defines.extend(deps_cpp_info.defines) + libs.extend(deps_cpp_info.libs + deps_cpp_info.system_libs) + libdirs.extend(deps_cpp_info.libdirs) + linkflags.extend(deps_cpp_info.sharedlinkflags + deps_cpp_info.exelinkflags) + cxxflags.extend(deps_cpp_info.cxxflags) + cflags.extend(deps_cpp_info.cflags) + + env = Environment() + env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in includedirs] + [f"-D{d}" for d in defines]) + env.append("_LINK_", [lib if lib.endswith(".lib") else f"{lib}.lib" for lib in libs]) + env.append("LDFLAGS", [f"-L{unix_path(self, p)}" for p in libdirs] + linkflags) + env.append("CXXFLAGS", cxxflags) + env.append("CFLAGS", cflags) + env.vars(self).save_script("conanautotoolsdeps_cl_workaround") + else: + deps = AutotoolsDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if not self.options.tools: + save(self, os.path.join(self.source_folder, "tools", "Makefile.am"), "") + save(self, os.path.join(self.source_folder, "xmltools", "Makefile.am"), "") + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share", "man")) + rmdir(self, os.path.join(self.package_folder, "share", "icons")) + rename(self, os.path.join(self.package_folder, "share"), os.path.join(self.package_folder, "res")) + fix_apple_shared_install_name(self) + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "djvulibre.dll.lib"), + os.path.join(self.package_folder, "lib", "djvulibre.lib")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "ddjvuapi") + self.cpp_info.libs = ["djvulibre"] + self.cpp_info.resdirs = ["res"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + elif is_apple_os(self): + self.cpp_info.frameworks.extend(["CoreFoundation"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("advapi32") + + # Implemented in C++ but exports a pure C API + if stdcpp_library(self): + self.cpp_info.system_libs.append(stdcpp_library(self)) diff --git a/recipes/djvulibre/all/patches/remove-register-keyword.patch b/recipes/djvulibre/all/patches/remove-register-keyword.patch new file mode 100644 index 0000000000000..d6a6af75193b6 --- /dev/null +++ b/recipes/djvulibre/all/patches/remove-register-keyword.patch @@ -0,0 +1,34 @@ +--- libdjvu/GBitmap.h ++++ libdjvu/GBitmap.h +@@ -620,7 +620,7 @@ + inline int + GBitmap::read_run(unsigned char *&data) + { +- register int z=*data++; ++ int z=*data++; + return (z>=RUNOVERFLOWVALUE)? + ((z&~RUNOVERFLOWVALUE)<<8)|(*data++):z; + } +@@ -628,7 +628,7 @@ + inline int + GBitmap::read_run(const unsigned char *&data) + { +- register int z=*data++; ++ int z=*data++; + return (z>=RUNOVERFLOWVALUE)? + ((z&~RUNOVERFLOWVALUE)<<8)|(*data++):z; + } +--- libdjvu/MMX.h ++++ libdjvu/MMX.h +@@ -172,9 +172,9 @@ + #define MMXir(op,imm,dst) \ + __asm { op dst,imm } + #define MMXar(op,addr,dst) \ +- { register __int64 var=*(__int64*)(addr); __asm { op dst,var } } ++ { __int64 var=*(__int64*)(addr); __asm { op dst,var } } + #define MMXra(op,src,addr) \ +- { register __int64 var; __asm { op [var],src }; *(__int64*)addr = var; } ++ { __int64 var; __asm { op [var],src }; *(__int64*)addr = var; } + // Probably not as efficient as GCC macros + #define MMX 1 + #endif diff --git a/recipes/djvulibre/all/test_package/CMakeLists.txt b/recipes/djvulibre/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..78eb45bda8ee3 --- /dev/null +++ b/recipes/djvulibre/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(djvulibre REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE djvulibre::djvulibre) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/djvulibre/all/test_package/conanfile.py b/recipes/djvulibre/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/djvulibre/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/djvulibre/all/test_package/test_package.c b/recipes/djvulibre/all/test_package/test_package.c new file mode 100644 index 0000000000000..9c8f3383716ca --- /dev/null +++ b/recipes/djvulibre/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include +#include + +int main() { + ddjvu_context_t* context = ddjvu_context_create("test_package"); + if (!context) { + printf("Failed to create djvu context\n"); + return 1; + } + printf("DjVu context initialized successfully.\n"); + int cache_size = ddjvu_cache_get_size(context); + printf("Cache size: %d\n", cache_size); + ddjvu_context_release(context); + return 0; +} diff --git a/recipes/djvulibre/config.yml b/recipes/djvulibre/config.yml new file mode 100644 index 0000000000000..9cb2b472d3ed1 --- /dev/null +++ b/recipes/djvulibre/config.yml @@ -0,0 +1,3 @@ +versions: + "3.5.28": + folder: all diff --git a/recipes/drogon/all/conandata.yml b/recipes/drogon/all/conandata.yml index 5ade6257a65f6..1918973ce4360 100644 --- a/recipes/drogon/all/conandata.yml +++ b/recipes/drogon/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.9.5": + url: "https://github.com/drogonframework/drogon/archive/v1.9.5.tar.gz" + sha256: "ec17882835abeb0672db29cb36ab0c5523f144d5d8ff177861b8f5865803eaae" + "1.9.4": + url: "https://github.com/drogonframework/drogon/archive/v1.9.4.tar.gz" + sha256: "b23d9d01d36fb1221298fcdbedcf7fd3e1b8b8821bf6fb8ed073c8b0c290d11d" "1.9.3": url: "https://github.com/drogonframework/drogon/archive/v1.9.3.tar.gz" sha256: "fb4ef351b3e4c06ed850cfbbf50c571502decb1738fb7d62a9d7d70077c9fc23" @@ -24,6 +30,20 @@ sources: url: "https://github.com/drogonframework/drogon/archive/v1.8.4.tar.gz" sha256: "6f2f59ead0f0c37b0aac4bc889cbaedf3c2540f3020e892596c72f0a4d887a18" patches: + "1.9.5": + - patch_file: "patches/1.8.5-0001-remove-shared-libs.patch" + patch_description: "remove shared libs option" + patch_type: "conan" + - patch_file: "patches/1.9.2-0002-find-cci-packages.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" + "1.9.4": + - patch_file: "patches/1.8.5-0001-remove-shared-libs.patch" + patch_description: "remove shared libs option" + patch_type: "conan" + - patch_file: "patches/1.9.2-0002-find-cci-packages.patch" + patch_description: "Fix jsoncpp cmake target name" + patch_type: "conan" "1.9.3": - patch_file: "patches/1.8.5-0001-remove-shared-libs.patch" patch_description: "remove shared libs option" diff --git a/recipes/drogon/all/conanfile.py b/recipes/drogon/all/conanfile.py index 953a213b3cedc..1aa59c64d8206 100644 --- a/recipes/drogon/all/conanfile.py +++ b/recipes/drogon/all/conanfile.py @@ -110,7 +110,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} requires boost on C++14") def requirements(self): - self.requires("trantor/1.5.16", transitive_headers=True, transitive_libs=True) + self.requires("trantor/1.5.19", 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.11 <2]") diff --git a/recipes/drogon/config.yml b/recipes/drogon/config.yml index e9c9e23f0ecf5..ad963339f39e6 100644 --- a/recipes/drogon/config.yml +++ b/recipes/drogon/config.yml @@ -1,4 +1,8 @@ versions: + "1.9.5": + folder: "all" + "1.9.4": + folder: "all" "1.9.3": folder: "all" "1.9.2": diff --git a/recipes/dtl/all/conanfile.py b/recipes/dtl/all/conanfile.py index c53d228db8921..f500b1f6947df 100644 --- a/recipes/dtl/all/conanfile.py +++ b/recipes/dtl/all/conanfile.py @@ -1,8 +1,7 @@ import os from conan import ConanFile -from conan.tools.build import check_min_cppstd -from conan.tools.files import copy, get +from conan.tools.files import copy, get, replace_in_file from conan.tools.layout import basic_layout required_conan_version = ">=1.52.0" @@ -28,6 +27,8 @@ def package_id(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + # See https://github.com/cubicdaiya/dtl/pull/18 + replace_in_file(self, os.path.join(self.source_folder, "dtl", "Diff.hpp"), "void enableTrivial () const {", "void enableTrivial () {") def package(self): copy(self, "COPYING", diff --git a/recipes/duckdb/all/conandata.yml b/recipes/duckdb/all/conandata.yml index 82ad639285d87..4288594f5fc5e 100644 --- a/recipes/duckdb/all/conandata.yml +++ b/recipes/duckdb/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.0.0": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v1.0.0.tar.gz" + sha256: "04e472e646f5cadd0a3f877a143610674b0d2bcf9f4102203ac3c3d02f1c5f26" + "0.10.2": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.10.2.tar.gz" + sha256: "662a0ba5c35d678ab6870db8f65ffa1c72e6096ad525a35b41b275139684cea6" + "0.10.1": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.10.1.tar.gz" + sha256: "83bd4944c070fd0bd287fbe62919fa887f35d7422ba0fa66e13d4ed098f3791a" "0.9.2": url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.9.2.tar.gz" sha256: "afff7bd925a98dc2af4039b8ab2159b0705cbf5e0ee05d97f7bb8dce5f880dc2" @@ -24,6 +33,27 @@ sources: url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.5.1.tar.gz" sha256: "3dab7ba0d0f8d024d3c73fd3d4fb8834203c31d7b0ddb1e8539ee266e11b0e9b" patches: + "1.0.0": + - patch_file: "patches/1.0.0-0001-fix-cmake.patch" + patch_description: "install static of shared library, add installation for odbc extention" + patch_type: "portability" + - patch_file: "patches/1.0.0-0002-msvc-bicobj.patch" + patch_description: "add /bigobj flag" + patch_type: "portability" + "0.10.2": + - patch_file: "patches/0.10.2-0001-fix-cmake.patch" + patch_description: "install static of shared library, add installation for odbc extention" + patch_type: "portability" + - patch_file: "patches/0.10.1-0002-msvc-bicobj.patch" + patch_description: "add /bigobj flag" + patch_type: "portability" + "0.10.1": + - patch_file: "patches/0.10.1-0001-fix-cmake.patch" + patch_description: "install static of shared library, add installation for odbc extention" + patch_type: "portability" + - patch_file: "patches/0.10.1-0002-msvc-bicobj.patch" + patch_description: "add /bigobj flag" + patch_type: "portability" "0.9.2": - patch_file: "patches/0.9.2-0001-fix-cmake.patch" patch_description: "install static of shared library, add installation for odbc extention" diff --git a/recipes/duckdb/all/conanfile.py b/recipes/duckdb/all/conanfile.py index bb764a9d7f7ea..0c71916124ae9 100644 --- a/recipes/duckdb/all/conanfile.py +++ b/recipes/duckdb/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file -from conan.tools.build import check_min_cppstd +from conan.tools.build import check_min_cppstd, cross_building from conan.tools.scm import Version from conan.tools.microsoft import is_msvc from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout @@ -108,7 +108,7 @@ def generate(self): tc.variables["DUCKDB_MINOR_VERSION"] = Version(self.version).minor tc.variables["DUCKDB_PATCH_VERSION"] = Version(self.version).patch tc.variables["DUCKDB_DEV_ITERATION"] = 0 - + tc.variables["OVERRIDE_GIT_DESCRIBE"] = f"v{self.version}" if "with_parquet" in self.options: tc.variables["BUILD_PARQUET_EXTENSION"] = self.options.with_parquet @@ -159,6 +159,8 @@ def generate(self): tc.variables["ENABLE_UBSAN"] = False if is_msvc(self) and not self.options.shared: tc.preprocessor_definitions["DUCKDB_API"] = "" + if Version(self.version) >= "0.10.0" and cross_building(self): + tc.variables["DUCKDB_EXPLICIT_PLATFORM"] = f"{self.settings.os}_{self.settings.arch}" tc.generate() dpes = CMakeDeps(self) @@ -211,6 +213,10 @@ def package_info(self): ] if Version(self.version) >= "0.6.0": self.cpp_info.libs.append("duckdb_fsst") + if Version(self.version) >= "0.10.0": + self.cpp_info.libs.append("duckdb_skiplistlib") + if Version(self.version) >= "0.10.3": + self.cpp_info.libs.append("duckdb_yyjson") if self.options.with_autocomplete: self.cpp_info.libs.append("autocomplete_extension") @@ -228,7 +234,8 @@ def package_info(self): self.cpp_info.libs.append("visualizer_extension") if self.options.with_httpfs: self.cpp_info.libs.append("httpfs_extension") - if Version(self.version) >= "0.6.0" and self.settings.os == "Linux": + if (Version(self.version) >= "0.6.0" and self.settings.os == "Linux" and + (Version(self.version) < "0.10.1" or self.settings.arch == "x86_64")): self.cpp_info.libs.append("jemalloc_extension") if self.options.with_json: self.cpp_info.libs.append("json_extension") @@ -244,6 +251,9 @@ def package_info(self): if self.settings.os == "Windows": self.cpp_info.system_libs.append("ws2_32") + if Version(self.version) >= "0.10.0": + self.cpp_info.system_libs.extend(["rstrtmgr", "bcrypt"]) + if self.options.with_shell: binpath = os.path.join(self.package_folder, "bin") diff --git a/recipes/duckdb/all/patches/0.10.1-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.10.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..7843bec6ccf0e --- /dev/null +++ b/recipes/duckdb/all/patches/0.10.1-0001-fix-cmake.patch @@ -0,0 +1,118 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aebc060..4698e32 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -836,7 +836,7 @@ function(build_static_extension NAME PARAMETERS) + set(FILES ${ARGV}) + list(REMOVE_AT FILES 0) + add_library(${NAME}_extension STATIC ${FILES}) +- target_link_libraries(${NAME}_extension duckdb_static) ++# target_link_libraries(${NAME}_extension duckdb_static) + endfunction() + + # Internal extension register function +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index d45ae7f..c13ca96 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -92,21 +92,21 @@ else() + duckdb_fastpforlib + duckdb_skiplistlib + duckdb_mbedtls) +- ++ if(BUILD_SHARED_LIBS) + add_library(duckdb SHARED ${ALL_OBJECT_FILES}) + target_link_libraries(duckdb ${DUCKDB_LINK_LIBS}) + link_threads(duckdb) + link_extension_libraries(duckdb) +- ++ endif() + add_library(duckdb_static STATIC ${ALL_OBJECT_FILES}) + target_link_libraries(duckdb_static ${DUCKDB_LINK_LIBS}) + link_threads(duckdb_static) + link_extension_libraries(duckdb_static) +- ++ if(BUILD_SHARED_LIBS) + target_include_directories( + duckdb PUBLIC $ + $) +- ++ endif() + target_include_directories( + duckdb_static PUBLIC $ + $) +@@ -121,10 +121,18 @@ else() + DESTINATION "${INSTALL_INCLUDE_DIR}") + + endif() +- ++if(BUILD_SHARED_LIBS) + install( +- TARGETS duckdb duckdb_static ++ TARGETS duckdb + EXPORT "${DUCKDB_EXPORT_SET}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++else() ++install( ++ TARGETS duckdb_static ++ EXPORT "${DUCKDB_EXPORT_SET}" ++ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" ++ RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++endif() +diff --git a/tools/odbc/CMakeLists.txt b/tools/odbc/CMakeLists.txt +index baf7823..4bef643 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -38,6 +38,14 @@ add_library(duckdb_odbc SHARED ${ALL_OBJECT_FILES} duckdb_odbc.def) + set_target_properties(duckdb_odbc PROPERTIES DEFINE_SYMBOL "DUCKDB_ODBC_API") + target_link_libraries(duckdb_odbc ${LINK_LIB_LIST} duckdb_static) + ++install( ++ TARGETS duckdb_odbc ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) ++ + if(NOT CLANG_TIDY) + add_subdirectory(test) + endif() +diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index e29c33e..fb926b5 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -26,20 +26,20 @@ if(NOT AMALGAMATION_BUILD) + endif() + link_threads(sqlite3_api_wrapper_static) + +-if(NOT WIN32 AND NOT ZOS) ++if(BUILD_SHARED_LIBS AND NOT WIN32 AND NOT ZOS) + add_library(sqlite3_api_wrapper SHARED ${SQLITE_API_WRAPPER_FILES}) + target_link_libraries(sqlite3_api_wrapper duckdb ${DUCKDB_EXTRA_LINK_FLAGS}) + link_threads(sqlite3_api_wrapper) + endif() + +-include_directories(../../third_party/catch) ++# include_directories(../../third_party/catch) + +-include_directories(test/include) +-add_subdirectory(test) ++# include_directories(test/include) ++# add_subdirectory(test) + +-add_executable(test_sqlite3_api_wrapper ${SQLITE_TEST_FILES}) +-if(WIN32 OR ZOS) +- target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper_static) +-else() +- target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) +-endif() ++# add_executable(test_sqlite3_api_wrapper ${SQLITE_TEST_FILES}) ++# if(WIN32 OR ZOS) ++# target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper_static) ++# else() ++# target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) ++# endif() diff --git a/recipes/duckdb/all/patches/0.10.1-0002-msvc-bicobj.patch b/recipes/duckdb/all/patches/0.10.1-0002-msvc-bicobj.patch new file mode 100644 index 0000000000000..4dd0c46e33839 --- /dev/null +++ b/recipes/duckdb/all/patches/0.10.1-0002-msvc-bicobj.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aebc060..4a696b6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -508,7 +508,7 @@ if(NOT MSVC) + endif() + else() + set(CMAKE_CXX_WINDOWS_FLAGS +- "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8") ++ "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8 /bigobj") + if(TREAT_WARNINGS_AS_ERRORS) + set(CMAKE_CXX_WINDOWS_FLAGS "${CMAKE_CXX_WINDOWS_FLAGS} /WX") + endif() diff --git a/recipes/duckdb/all/patches/0.10.2-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.10.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..a64da2a33b94d --- /dev/null +++ b/recipes/duckdb/all/patches/0.10.2-0001-fix-cmake.patch @@ -0,0 +1,137 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5f199d3..64c86c6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -816,12 +816,12 @@ function(build_loadable_extension_directory NAME OUTPUT_DIRECTORY EXTENSION_VERS + COMMAND emcc $.lib -o $ -sSIDE_MODULE=1 -O3 + ) + endif() +- add_custom_command( +- TARGET ${TARGET_NAME} +- POST_BUILD +- COMMAND +- ${CMAKE_COMMAND} -DEXTENSION=$ -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DDUCKDB_VERSION="${DUCKDB_NORMALIZED_VERSION}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${CMAKE_CURRENT_FUNCTION_LIST_DIR}/scripts/null.txt -P ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/scripts/append_metadata.cmake +- ) ++ # add_custom_command( ++ # TARGET ${TARGET_NAME} ++ # POST_BUILD ++ # COMMAND ++ # ${CMAKE_COMMAND} -DEXTENSION=$ -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DDUCKDB_VERSION="${DUCKDB_NORMALIZED_VERSION}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${CMAKE_CURRENT_FUNCTION_LIST_DIR}/scripts/null.txt -P ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/scripts/append_metadata.cmake ++ # ) + add_dependencies(${TARGET_NAME} duckdb_platform) + if (NOT EXTENSION_CONFIG_BUILD AND NOT ${EXTENSION_TESTS_ONLY} AND NOT CLANG_TIDY) + add_dependencies(duckdb_local_extension_repo ${TARGET_NAME}) +@@ -842,7 +842,7 @@ function(build_static_extension NAME PARAMETERS) + set(FILES "${ARGV}") + list(REMOVE_AT FILES 0) + add_library(${NAME}_extension STATIC ${FILES}) +- target_link_libraries(${NAME}_extension duckdb_static) ++# target_link_libraries(${NAME}_extension duckdb_static) + endfunction() + + # Internal extension register function +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index d45ae7f..c13ca96 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -92,21 +92,21 @@ else() + duckdb_fastpforlib + duckdb_skiplistlib + duckdb_mbedtls) +- ++ if(BUILD_SHARED_LIBS) + add_library(duckdb SHARED ${ALL_OBJECT_FILES}) + target_link_libraries(duckdb ${DUCKDB_LINK_LIBS}) + link_threads(duckdb) + link_extension_libraries(duckdb) +- ++ endif() + add_library(duckdb_static STATIC ${ALL_OBJECT_FILES}) + target_link_libraries(duckdb_static ${DUCKDB_LINK_LIBS}) + link_threads(duckdb_static) + link_extension_libraries(duckdb_static) +- ++ if(BUILD_SHARED_LIBS) + target_include_directories( + duckdb PUBLIC $ + $) +- ++ endif() + target_include_directories( + duckdb_static PUBLIC $ + $) +@@ -121,10 +121,18 @@ else() + DESTINATION "${INSTALL_INCLUDE_DIR}") + + endif() +- ++if(BUILD_SHARED_LIBS) + install( +- TARGETS duckdb duckdb_static ++ TARGETS duckdb + EXPORT "${DUCKDB_EXPORT_SET}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++else() ++install( ++ TARGETS duckdb_static ++ EXPORT "${DUCKDB_EXPORT_SET}" ++ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" ++ RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++endif() +diff --git a/tools/odbc/CMakeLists.txt b/tools/odbc/CMakeLists.txt +index baf7823..4bef643 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -38,6 +38,14 @@ add_library(duckdb_odbc SHARED ${ALL_OBJECT_FILES} duckdb_odbc.def) + set_target_properties(duckdb_odbc PROPERTIES DEFINE_SYMBOL "DUCKDB_ODBC_API") + target_link_libraries(duckdb_odbc ${LINK_LIB_LIST} duckdb_static) + ++install( ++ TARGETS duckdb_odbc ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) ++ + if(NOT CLANG_TIDY) + add_subdirectory(test) + endif() +diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index e29c33e..fb926b5 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -26,20 +26,20 @@ if(NOT AMALGAMATION_BUILD) + endif() + link_threads(sqlite3_api_wrapper_static) + +-if(NOT WIN32 AND NOT ZOS) ++if(BUILD_SHARED_LIBS AND NOT WIN32 AND NOT ZOS) + add_library(sqlite3_api_wrapper SHARED ${SQLITE_API_WRAPPER_FILES}) + target_link_libraries(sqlite3_api_wrapper duckdb ${DUCKDB_EXTRA_LINK_FLAGS}) + link_threads(sqlite3_api_wrapper) + endif() + +-include_directories(../../third_party/catch) ++# include_directories(../../third_party/catch) + +-include_directories(test/include) +-add_subdirectory(test) ++# include_directories(test/include) ++# add_subdirectory(test) + +-add_executable(test_sqlite3_api_wrapper ${SQLITE_TEST_FILES}) +-if(WIN32 OR ZOS) +- target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper_static) +-else() +- target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) +-endif() ++# add_executable(test_sqlite3_api_wrapper ${SQLITE_TEST_FILES}) ++# if(WIN32 OR ZOS) ++# target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper_static) ++# else() ++# target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) ++# endif() diff --git a/recipes/duckdb/all/patches/1.0.0-0001-fix-cmake.patch b/recipes/duckdb/all/patches/1.0.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..a557864ae780a --- /dev/null +++ b/recipes/duckdb/all/patches/1.0.0-0001-fix-cmake.patch @@ -0,0 +1,125 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ec66b57..6321321 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -843,12 +843,12 @@ function(build_loadable_extension_directory NAME OUTPUT_DIRECTORY EXTENSION_VERS + COMMAND emcc $ -o $.wasm -O3 -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="_${NAME}_init,_${NAME}_version" ${WASM_THREAD_FLAGS} ${TO_BE_LINKED} + ) + endif() +- add_custom_command( +- TARGET ${TARGET_NAME} +- POST_BUILD +- COMMAND +- ${CMAKE_COMMAND} -DEXTENSION=$${EXTENSION_POSTFIX} -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DDUCKDB_VERSION="${DUCKDB_NORMALIZED_VERSION}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${DUCKDB_MODULE_BASE_DIR}/scripts/null.txt -P ${DUCKDB_MODULE_BASE_DIR}/scripts/append_metadata.cmake +- ) ++ # add_custom_command( ++ # TARGET ${TARGET_NAME} ++ # POST_BUILD ++ # COMMAND ++ # ${CMAKE_COMMAND} -DEXTENSION=$${EXTENSION_POSTFIX} -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DDUCKDB_VERSION="${DUCKDB_NORMALIZED_VERSION}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${DUCKDB_MODULE_BASE_DIR}/scripts/null.txt -P ${DUCKDB_MODULE_BASE_DIR}/scripts/append_metadata.cmake ++ # ) + add_dependencies(${TARGET_NAME} duckdb_platform) + if (NOT EXTENSION_CONFIG_BUILD AND NOT ${EXTENSION_TESTS_ONLY} AND NOT CLANG_TIDY) + add_dependencies(duckdb_local_extension_repo ${TARGET_NAME}) +@@ -869,7 +869,7 @@ function(build_static_extension NAME PARAMETERS) + set(FILES "${ARGV}") + list(REMOVE_AT FILES 0) + add_library(${NAME}_extension STATIC ${FILES}) +- target_link_libraries(${NAME}_extension duckdb_static) ++# target_link_libraries(${NAME}_extension duckdb_static) + endfunction() + + # Internal extension register function +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 06c0c9a..ac1c4ad 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -93,21 +93,21 @@ else() + duckdb_skiplistlib + duckdb_mbedtls + duckdb_yyjson) +- ++ if(BUILD_SHARED_LIBS) + add_library(duckdb SHARED ${ALL_OBJECT_FILES}) + target_link_libraries(duckdb ${DUCKDB_LINK_LIBS}) + link_threads(duckdb) + link_extension_libraries(duckdb) +- ++ endif() + add_library(duckdb_static STATIC ${ALL_OBJECT_FILES}) + target_link_libraries(duckdb_static ${DUCKDB_LINK_LIBS}) + link_threads(duckdb_static) + link_extension_libraries(duckdb_static) +- ++ if(BUILD_SHARED_LIBS) + target_include_directories( + duckdb PUBLIC $ + $) +- ++ endif() + target_include_directories( + duckdb_static PUBLIC $ + $) +@@ -123,10 +123,18 @@ else() + DESTINATION "${INSTALL_INCLUDE_DIR}") + + endif() +- ++if(BUILD_SHARED_LIBS) + install( +- TARGETS duckdb duckdb_static ++ TARGETS duckdb + EXPORT "${DUCKDB_EXPORT_SET}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++else() ++install( ++ TARGETS duckdb_static ++ EXPORT "${DUCKDB_EXPORT_SET}" ++ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ++ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" ++ RUNTIME DESTINATION "${INSTALL_BIN_DIR}") ++endif() +diff --git a/tools/odbc/CMakeLists.txt b/tools/odbc/CMakeLists.txt +index baf7823..4447d26 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -37,6 +37,13 @@ add_library(duckdb_odbc SHARED ${ALL_OBJECT_FILES} duckdb_odbc.def) + + set_target_properties(duckdb_odbc PROPERTIES DEFINE_SYMBOL "DUCKDB_ODBC_API") + target_link_libraries(duckdb_odbc ${LINK_LIB_LIST} duckdb_static) ++install( ++ TARGETS duckdb_odbc ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) + + if(NOT CLANG_TIDY) + add_subdirectory(test) +diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index e29c33e..9e387f9 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -26,12 +26,12 @@ if(NOT AMALGAMATION_BUILD) + endif() + link_threads(sqlite3_api_wrapper_static) + +-if(NOT WIN32 AND NOT ZOS) ++if(BUILD_SHARED_LIBS AND NOT WIN32 AND NOT ZOS) + add_library(sqlite3_api_wrapper SHARED ${SQLITE_API_WRAPPER_FILES}) + target_link_libraries(sqlite3_api_wrapper duckdb ${DUCKDB_EXTRA_LINK_FLAGS}) + link_threads(sqlite3_api_wrapper) + endif() +- ++if(0) + include_directories(../../third_party/catch) + + include_directories(test/include) +@@ -43,3 +43,4 @@ if(WIN32 OR ZOS) + else() + target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) + endif() ++endif() diff --git a/recipes/duckdb/all/patches/1.0.0-0002-msvc-bicobj.patch b/recipes/duckdb/all/patches/1.0.0-0002-msvc-bicobj.patch new file mode 100644 index 0000000000000..ddefcf5673104 --- /dev/null +++ b/recipes/duckdb/all/patches/1.0.0-0002-msvc-bicobj.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 50d10e8..a06f30c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -537,7 +537,7 @@ if(NOT MSVC) + endif() + else() + set(CMAKE_CXX_WINDOWS_FLAGS +- "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8") ++ "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8 /bigobj") + if(TREAT_WARNINGS_AS_ERRORS) + set(CMAKE_CXX_WINDOWS_FLAGS "${CMAKE_CXX_WINDOWS_FLAGS} /WX") + endif() diff --git a/recipes/duckdb/config.yml b/recipes/duckdb/config.yml index 77e20cf10a797..5a30e62447ed4 100644 --- a/recipes/duckdb/config.yml +++ b/recipes/duckdb/config.yml @@ -1,4 +1,10 @@ versions: + "1.0.0": + folder: "all" + "0.10.2": + folder: "all" + "0.10.1": + folder: "all" "0.9.2": folder: "all" "0.9.0": diff --git a/recipes/elfutils/all/conanfile.py b/recipes/elfutils/all/conanfile.py index 7d15bdd2937ed..df45185883fb0 100644 --- a/recipes/elfutils/all/conanfile.py +++ b/recipes/elfutils/all/conanfile.py @@ -82,7 +82,7 @@ def requirements(self): self.requires("libmicrohttpd/0.9.75") def build_requirements(self): - self.tool_requires("gettext/0.21") + self.tool_requires("gettext/0.22.5") self.tool_requires("automake/1.16.5") self.build_requires("m4/1.4.19") self.build_requires("flex/2.6.4") @@ -171,6 +171,7 @@ def package_info(self): # library components self.cpp_info.components["libelf"].libs = ["elf"] self.cpp_info.components["libelf"].requires = ["zlib::zlib"] + self.cpp_info.components["libelf"].set_property("pkg_config_name", "libelf") if self.options.with_bzlib: self.cpp_info.components["libelf"].requires.append("bzip2::bzip2") if self.options.with_lzma: @@ -182,6 +183,7 @@ def package_info(self): self.cpp_info.components["libdw"].libs = ["dw"] self.cpp_info.components["libdw"].requires = ["libelf"] + self.cpp_info.components["libdw"].set_property("pkg_config_name", "libdw") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libdw"].system_libs.extend(["dl"]) @@ -192,6 +194,7 @@ def package_info(self): if self.options.get_safe("libdebuginfod"): self.cpp_info.components["libdebuginfod"].libs = ["debuginfod"] self.cpp_info.components["libdebuginfod"].requires = ["libcurl::curl"] + self.cpp_info.components["libdebuginfod"].set_property("pkg_config_name", "libdebuginfod") # utilities bin_path = os.path.join(self.package_folder, "bin") diff --git a/recipes/emhash/all/conandata.yml b/recipes/emhash/all/conandata.yml new file mode 100644 index 0000000000000..4034de3bcdd95 --- /dev/null +++ b/recipes/emhash/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20240601": + url: "https://github.com/ktprime/emhash/archive/3efa77ef32786a033b379071fe8af3dc705736ca.tar.gz" + sha256: "db6c524f3acb487f88221aff75a9198700478ece4ea2a9a25b013ef7375bc819" diff --git a/recipes/emhash/all/conanfile.py b/recipes/emhash/all/conanfile.py new file mode 100644 index 0000000000000..7618a4de1e403 --- /dev/null +++ b/recipes/emhash/all/conanfile.py @@ -0,0 +1,49 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + +class EmhashConan(ConanFile): + name = "emhash" + description = "Fast and memory efficient c++ flat hash map/set" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ktprime/emhash" + topics = ("flat", "map", "set", "hash", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + excludes=["bench", "test", "thirdparty",] + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/emhash/all/test_package/CMakeLists.txt b/recipes/emhash/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..123ccacccfde9 --- /dev/null +++ b/recipes/emhash/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(emhash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE emhash::emhash) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/emhash/all/test_package/conanfile.py b/recipes/emhash/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/emhash/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/emhash/all/test_package/test_package.cpp b/recipes/emhash/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0fa8241e36634 --- /dev/null +++ b/recipes/emhash/all/test_package/test_package.cpp @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include + +#define EMH_EXT +#include "hash_table5.hpp" + +int main(void) { + // constructor + emhash5::HashMap m1(4); + m1.reserve(100); + for (int i = 1; i < 100; i++) + m1.emplace_unique(i, i); //key must be unique, performance is better than emplace, operator[]. + + auto no_value = m1.at(0); //no_value = 0; no exception throw!!!. only return zero for integer value. + + // list constructor + emhash5::HashMap m2 = { + {1, "foo"}, + {3, "bar"}, + {2, "baz"}, + }; + + auto* pvalue = m2.try_get(1); //return nullptr if key is not exist + if (m2.try_set(4, "for")) printf("set success"); + if (!m2.try_set(1, "new")) printf("set failed"); + std::string ovalue = m2.set_get(1, "new"); //ovalue = "foo" and m2[1] == "new" + + for(auto& p: m2) + std::cout << " " << p.first << " => " << p.second << '\n'; + + // copy constructor + emhash5::HashMap m3 = m2; + // move constructor + emhash5::HashMap m4 = std::move(m2); + + //insert. insert_unique. emplace + m2.insert_unique(4, "four"); + m2[4] = "four_again"; + m2.emplace(std::make_pair(4, "four")); + m2.insert({{6, "six"}, {5, "five"}}); + + // range constructor + std::vector, int>> v = { {0x12, 1}, {0x01,-1} }; + emhash5::HashMap, double> m5(v.begin(), v.end()); +} diff --git a/recipes/emhash/config.yml b/recipes/emhash/config.yml new file mode 100644 index 0000000000000..155d30b32fcf1 --- /dev/null +++ b/recipes/emhash/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20240601": + folder: all diff --git a/recipes/enet/all/conandata.yml b/recipes/enet/all/conandata.yml index c03ba9c9c59fb..346f8469ae010 100644 --- a/recipes/enet/all/conandata.yml +++ b/recipes/enet/all/conandata.yml @@ -1,22 +1,17 @@ sources: + "1.3.18": + url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.18.tar.gz" + sha256: "28603c895f9ed24a846478180ee72c7376b39b4bb1287b73877e5eae7d96b0dd" "1.3.17": url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.17.tar.gz" sha256: "1e0b4bc0b7127a2d779dd7928f0b31830f5b3dcb7ec9588c5de70033e8d2434a" "1.3.16": url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.16.tar.gz" sha256: "b3aa85b43e4309fec9441b4e6639c268e22962a578bd5e2307bb3a7b6fe73714" - "1.3.15": - url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.15.tar.gz" - sha256: "e749887a19b5a4a0a16daae2d695fd7ed581ec517f3b15aedc3cdce2d999d471" - "1.3.14": - url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.14.tar.gz" - sha256: "3660e12d32164b2d814a897f50caa4e68db6396c00ef22806db45c2308b439e6" patches: + "1.3.18": + - patch_file: "patches/fix-cmake-1.3.18.patch" "1.3.17": - patch_file: "patches/fix-cmake.patch" "1.3.16": - patch_file: "patches/fix-cmake.patch" - "1.3.15": - - patch_file: "patches/fix-cmake.patch" - "1.3.14": - - patch_file: "patches/fix-cmake.patch" diff --git a/recipes/enet/all/patches/fix-cmake-1.3.18.patch b/recipes/enet/all/patches/fix-cmake-1.3.18.patch new file mode 100644 index 0000000000000..6a6af96885d57 --- /dev/null +++ b/recipes/enet/all/patches/fix-cmake-1.3.18.patch @@ -0,0 +1,41 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c6459b6..d7e68bd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -84,19 +84,27 @@ set(SOURCE_FILES + source_group(include FILES ${INCLUDE_FILES}) + source_group(source FILES ${SOURCE_FILES}) + +-add_library(enet STATIC ++if(MSVC AND BUILD_SHARED_LIBS) ++ add_definitions(-DENET_DLL) ++ add_definitions(-DENET_BUILDING_LIB) ++endif() ++add_library(enet + ${INCLUDE_FILES} + ${SOURCE_FILES} + ) + +-if (MINGW) ++if (WIN32) + target_link_libraries(enet winmm ws2_32) + endif() + +-install(TARGETS enet +- RUNTIME DESTINATION bin +- ARCHIVE DESTINATION lib/static +- LIBRARY DESTINATION lib) +- +-install(DIRECTORY include/ +- DESTINATION include) ++include(GNUInstallDirs) ++install( ++ TARGETS enet ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++) ++install( ++ DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/enet ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) diff --git a/recipes/enet/config.yml b/recipes/enet/config.yml index 1e0720325112a..9574bb80165a0 100644 --- a/recipes/enet/config.yml +++ b/recipes/enet/config.yml @@ -1,9 +1,7 @@ versions: + "1.3.18": + folder: all "1.3.17": folder: all "1.3.16": folder: all - "1.3.15": - folder: all - "1.3.14": - folder: all diff --git a/recipes/ensmallen/all/conandata.yml b/recipes/ensmallen/all/conandata.yml index a566be23b4893..31733be82e383 100644 --- a/recipes/ensmallen/all/conandata.yml +++ b/recipes/ensmallen/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.21.0": + url: "https://ensmallen.org/files/ensmallen-2.21.0.tar.gz" + sha256: "076f9d84e1ebc84c0ae19ee63accfc8fd3ec850f8993784bd9277776c3af2932" "2.19.1": url: "https://ensmallen.org/files/ensmallen-2.19.1.tar.gz" sha256: "f36ad7f08b0688d2a8152e1c73dd437c56ed7a5af5facf65db6ffd977b275b2e" diff --git a/recipes/ensmallen/all/conanfile.py b/recipes/ensmallen/all/conanfile.py index 7b6250290ad81..093bca4ec6467 100644 --- a/recipes/ensmallen/all/conanfile.py +++ b/recipes/ensmallen/all/conanfile.py @@ -25,7 +25,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("armadillo/12.2.0") + self.requires("armadillo/12.6.4") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/ensmallen/config.yml b/recipes/ensmallen/config.yml index 3af3934850762..0bd90f07549cf 100644 --- a/recipes/ensmallen/config.yml +++ b/recipes/ensmallen/config.yml @@ -1,3 +1,5 @@ versions: + "2.21.0": + folder: all "2.19.1": folder: all diff --git a/recipes/enumbitmask/all/conandata.yml b/recipes/enumbitmask/all/conandata.yml new file mode 100644 index 0000000000000..cd53c7f619e50 --- /dev/null +++ b/recipes/enumbitmask/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0": + url: "https://github.com/Reputeless/EnumBitmask/archive/refs/tags/v1.0.tar.gz" + sha256: "233efdefa4d0cfc8d8664ab7326db29835cc874b0af4926a7d93a184b250013d" diff --git a/recipes/enumbitmask/all/conanfile.py b/recipes/enumbitmask/all/conanfile.py new file mode 100644 index 0000000000000..e26040a23cf68 --- /dev/null +++ b/recipes/enumbitmask/all/conanfile.py @@ -0,0 +1,67 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.52.0" + + +class EnumBitmaskConan(ConanFile): + name = "enumbitmask" + description = "A C++ library to enable bitmask operators for an enum class type" + license = "CC0-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Reputeless/EnumBitmask" + topics = ("enum", "bitmask", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.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/enumbitmask/all/test_package/CMakeLists.txt b/recipes/enumbitmask/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7e634d8528a16 --- /dev/null +++ b/recipes/enumbitmask/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(enumbitmask REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE enumbitmask::enumbitmask) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/enumbitmask/all/test_package/conanfile.py b/recipes/enumbitmask/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/enumbitmask/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/enumbitmask/all/test_package/test_package.cpp b/recipes/enumbitmask/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..80e777f36555c --- /dev/null +++ b/recipes/enumbitmask/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include + +#include "EnumBitmask.hpp" + +enum class OpenMode { + Append = 1, + Binary = 2, + Input = 4, + Output = 8, +}; +DEFINE_BITMASK_OPERATORS(OpenMode) + + +int main() { + constexpr auto mode = OpenMode::Binary | OpenMode::Input; + + constexpr auto flag = mode & OpenMode::Binary; + + return 0; +} diff --git a/recipes/enumbitmask/config.yml b/recipes/enumbitmask/config.yml new file mode 100644 index 0000000000000..edab1ee152d36 --- /dev/null +++ b/recipes/enumbitmask/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0": + folder: all diff --git a/recipes/erkir/all/conandata.yml b/recipes/erkir/all/conandata.yml index 24a6857c0b7eb..f16d2da6950e6 100644 --- a/recipes/erkir/all/conandata.yml +++ b/recipes/erkir/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.1": + url: "https://github.com/vahancho/erkir/archive/refs/tags/v2.1.1.tar.gz" + sha256: "b314824c126bf933e2f08e5335e12b7ef3ded9ceb341d542276455d991e7e85d" "2.0.0": url: "https://github.com/vahancho/erkir/archive/refs/tags/v2.0.0.tar.gz" sha256: "98d095adcf0f2f11e3ba345bd5bbe890568cde69de9680b2c2a424f0008453ac" @@ -6,6 +9,16 @@ sources: url: "https://github.com/vahancho/erkir/archive/refs/tags/1.0.0.tar.gz" sha256: "0bc5122fe2fef0f9036de275483af7f8adb947f6e8dd63fc18ac085ef31e9421" patches: + "2.1.1": + - patch_file: "patches/2.0.0-0001-remove-specify-architecture.patch" + patch_description: "fix supported architectures limited to x86/x86_64" + patch_type: "conan" + - patch_file: "patches/2.1.1-0002-fix-cmake.patch" + patch_description: "disable shared and fPIC options" + patch_type: "conan" + - patch_file: "patches/2.1.1-0003-fix-erkir_export.patch" + patch_description: "define ERKIR_EXPORT as empty on static build" + patch_type: "conan" "2.0.0": - patch_file: "patches/2.0.0-0001-remove-specify-architecture.patch" patch_description: "fix supported architectures limited to x86/x86_64" diff --git a/recipes/erkir/all/conanfile.py b/recipes/erkir/all/conanfile.py index 941e33312f121..10808e03cf409 100644 --- a/recipes/erkir/all/conanfile.py +++ b/recipes/erkir/all/conanfile.py @@ -81,7 +81,11 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "erkir") - self.cpp_info.set_property("cmake_target_name", "erkir::erkir") postfix = "d" if Version(self.version) >= "2.0.0" and self.settings.build_type == "Debug" else "" self.cpp_info.libs = [f"erkir{postfix}"] + + if Version(self.version) >= "2.1.0" and self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + self.cpp_info.set_property("cmake_file_name", "erkir") + self.cpp_info.set_property("cmake_target_name", "erkir::erkir") diff --git a/recipes/erkir/all/patches/2.1.1-0002-fix-cmake.patch b/recipes/erkir/all/patches/2.1.1-0002-fix-cmake.patch new file mode 100644 index 0000000000000..0a92d7aabdffc --- /dev/null +++ b/recipes/erkir/all/patches/2.1.1-0002-fix-cmake.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d72f102..7bf1655 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.9) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++# set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # The project definition + project(erkir VERSION 2.1.1 +@@ -14,7 +14,7 @@ project(erkir VERSION 2.1.1 + include(GNUInstallDirs) + + # General options +-option(BUILD_SHARED_LIBS "Build using shared libraries" ON) ++# option(BUILD_SHARED_LIBS "Build using shared libraries" ON) + option(ENABLE_TESTING "Enable unit test build" OFF) + + if (0) diff --git a/recipes/erkir/all/patches/2.1.1-0003-fix-erkir_export.patch b/recipes/erkir/all/patches/2.1.1-0003-fix-erkir_export.patch new file mode 100644 index 0000000000000..a12676d0ed400 --- /dev/null +++ b/recipes/erkir/all/patches/2.1.1-0003-fix-erkir_export.patch @@ -0,0 +1,28 @@ +diff --git a/include/export.h b/include/export.h +index edcb0b3..e090174 100644 +--- a/include/export.h ++++ b/include/export.h +@@ -1,7 +1,7 @@ + #ifndef __EXPORT_H_ + #define __EXPORT_H_ + +-#ifdef _WIN32 ++#if defined(_WIN32) && defined(ERKIR_SHARED) + #ifdef MAKEDLL + # define ERKIR_EXPORT __declspec(dllexport) + #else +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index ad88fd6..519a300 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -38,6 +38,10 @@ if (MSVC) + target_compile_definitions(${TARGET} PUBLIC MAKEDLL) + endif() + ++if (BUILD_SHARED_LIBS) ++ target_compile_definitions(${TARGET} PUBLIC ERKIR_SHARED) ++endif() ++ + ############################################################################### + # The installation and packaging + # diff --git a/recipes/erkir/config.yml b/recipes/erkir/config.yml index 870fb33e55af0..65dc9fbda0110 100644 --- a/recipes/erkir/config.yml +++ b/recipes/erkir/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.1": + folder: all "2.0.0": folder: all "1.0.0": diff --git a/recipes/etl/all/conandata.yml b/recipes/etl/all/conandata.yml index 74e149bfbcab5..d43f353b12095 100644 --- a/recipes/etl/all/conandata.yml +++ b/recipes/etl/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "20.38.17": + url: "https://github.com/ETLCPP/etl/archive/20.38.17.tar.gz" + sha256: "5b490aca3faad3796a48bf0980e74f2a67953967fad3c051a6d4981051cb0b9a" + "20.38.16": + url: "https://github.com/ETLCPP/etl/archive/20.38.16.tar.gz" + sha256: "6d05e33d6e7eb2c8d4654c77dcd083adc70da29aba808f471ba7c6e2b8fcbf03" + "20.38.15": + url: "https://github.com/ETLCPP/etl/archive/20.38.15.tar.gz" + sha256: "c4f3108b35eb669ce4a6a217264ca133fe52cc8b5bce026a474ec81c0a2c4026" + "20.38.14": + url: "https://github.com/ETLCPP/etl/archive/20.38.14.tar.gz" + sha256: "d286191f0617e1c6c85e1ecb2175e84035918a7bf67d0bb347a8cb6fca3b2db4" + "20.38.13": + url: "https://github.com/ETLCPP/etl/archive/20.38.13.tar.gz" + sha256: "e606083e189a8fe6211c30c8c579b60c29658a531b5cafbb511daab1a2861a69" + "20.38.11": + url: "https://github.com/ETLCPP/etl/archive/20.38.11.tar.gz" + sha256: "c73b6b076ab59e02398a9f90a66198a9f8bf0cfa91af7be2eebefb3bb264ba83" "20.38.10": url: "https://github.com/ETLCPP/etl/archive/20.38.10.tar.gz" sha256: "562f9b5d9e6786350b09d87be9c5f030073e34d7bf0a975de3e91476ddd471a3" @@ -20,30 +38,6 @@ sources: "20.37.3": url: "https://github.com/ETLCPP/etl/archive/20.37.3.tar.gz" sha256: "fbdf60c770772cd96d1eb25bdf56e4f45f23bf4029e18ef1f2af1f2056b9ea41" - "20.37.2": - url: "https://github.com/ETLCPP/etl/archive/20.37.2.tar.gz" - sha256: "13bd5d9d1bfbc887e3182895ca0291df0008a1c5770ddd12ef6cd2215c2bc6af" - "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" - "20.35.14": - url: "https://github.com/ETLCPP/etl/archive/20.35.14.tar.gz" - sha256: "6af1baf039d38f405f932451615f9bcf227f5767b463f33e17fcbbbc02e4632e" - "20.35.11": - url: "https://github.com/ETLCPP/etl/archive/20.35.11.tar.gz" - sha256: "64a9eed9b9ac8a278349aac8e5888320fda0e090ba24373651767b7a8b8793fc" - "20.35.8": - url: "https://github.com/ETLCPP/etl/archive/20.35.8.tar.gz" - sha256: "7d0a6402b24fc91cf66328b95391a38c52d20f582f42497fb9b0a99d71ab8879" - "20.35.7": - url: "https://github.com/ETLCPP/etl/archive/20.35.7.tar.gz" - sha256: "20127e36c12a33142645dd5ec0a08d12b34ce9b33986847eeaa8c4201e025895" - "20.34.0": - url: "https://github.com/ETLCPP/etl/archive/20.34.0.tar.gz" - sha256: "56e25968f20167a161ee50c3eecda3daa91f696660ba59654c1afd22e502c465" diff --git a/recipes/etl/all/conanfile.py b/recipes/etl/all/conanfile.py index a1737588ee965..52ededc6ecbe6 100644 --- a/recipes/etl/all/conanfile.py +++ b/recipes/etl/all/conanfile.py @@ -1,20 +1,17 @@ from conan import ConanFile -from conan.tools.files import get, copy, save +from conan.tools.files import get, copy from conan.tools.layout import basic_layout import os -import textwrap - required_conan_version = ">=1.50.0" - class EmbeddedTemplateLibraryConan(ConanFile): name = "etl" description = "A C++ template library for embedded applications" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.etlcpp.com/" - topics = ("cpp", "embedded", "template", "container", "utility", "framework", "messaging") + topics = ("cpp", "embedded", "template", "container", "utility", "framework", "messaging", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -28,36 +25,10 @@ def package_id(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build(self): - pass - def package(self): copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self._create_cmake_module_alias_targets( - self, - os.path.join(self.package_folder, self._module_file_rel_path), - {"etl": "etl::etl"} - ) - - @staticmethod - def _create_cmake_module_alias_targets(conanfile, 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(conanfile, 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", "etl") self.cpp_info.set_property("cmake_target_name", "etl::etl") @@ -65,8 +36,3 @@ def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/etl/all/test_package/CMakeLists.txt b/recipes/etl/all/test_package/CMakeLists.txt index abf67a0fae7ee..b93512c6b9e61 100644 --- a/recipes/etl/all/test_package/CMakeLists.txt +++ b/recipes/etl/all/test_package/CMakeLists.txt @@ -4,5 +4,5 @@ project(test_package LANGUAGES CXX) find_package(etl REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) target_link_libraries(${PROJECT_NAME} PRIVATE etl::etl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/etl/all/test_v1_package/CMakeLists.txt b/recipes/etl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 19dd51b438baa..0000000000000 --- a/recipes/etl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(etl REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -target_link_libraries(${PROJECT_NAME} etl::etl) diff --git a/recipes/etl/config.yml b/recipes/etl/config.yml index 57618035ca09f..e0622751730c6 100644 --- a/recipes/etl/config.yml +++ b/recipes/etl/config.yml @@ -1,4 +1,16 @@ versions: + "20.38.17": + folder: all + "20.38.16": + folder: all + "20.38.15": + folder: all + "20.38.14": + folder: all + "20.38.13": + folder: all + "20.38.11": + folder: all "20.38.10": folder: all "20.38.7": @@ -13,21 +25,5 @@ versions: folder: all "20.37.3": folder: all - "20.37.2": - folder: all - "20.37.1": - folder: all - "20.37.0": - folder: all "20.36.0": folder: all - "20.35.14": - folder: all - "20.35.11": - folder: all - "20.35.8": - folder: all - "20.35.7": - folder: all - "20.34.0": - folder: all diff --git a/recipes/eudev/all/conanfile.py b/recipes/eudev/all/conanfile.py index 85b6e2350551c..c419d6928cfbe 100644 --- a/recipes/eudev/all/conanfile.py +++ b/recipes/eudev/all/conanfile.py @@ -56,7 +56,7 @@ def layout(self): def requirements(self): self.requires("acl/2.3.1") self.requires("libcap/2.69") - self.requires("libxslt/1.1.34") + self.requires("libxslt/1.1.39") self.requires("linux-headers-generic/6.5.9") if self.options.with_kmod: @@ -73,7 +73,7 @@ def validate(self): def build_requirements(self): self.tool_requires("gperf/3.1") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.1.0") + self.tool_requires("pkgconf/2.2.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/exiv2/all/conandata.yml b/recipes/exiv2/all/conandata.yml index 55858f820d83f..0b36cf903900d 100644 --- a/recipes/exiv2/all/conandata.yml +++ b/recipes/exiv2/all/conandata.yml @@ -1,10 +1,10 @@ sources: + "0.28.2": + url: "https://github.com/Exiv2/exiv2/archive/refs/tags/v0.28.2.tar.gz" + sha256: "543bead934135f20f438e0b6d8858c55c5fcb7ff80f5d1d55489965f1aad58b9" "0.28.1": url: "https://github.com/Exiv2/exiv2/archive/refs/tags/v0.28.1.tar.gz" sha256: "3078651f995cb6313b1041f07f4dd1bf0e9e4d394d6e2adc6e92ad0b621291fa" - "0.28.0": - url: "https://github.com/Exiv2/exiv2/releases/download/v0.28.0/exiv2-0.28.0-Source.tar.gz" - sha256: "89af3b5ef7277753ef7a7b5374ae017c6b9e304db3b688f1948e73e103491f3d" "0.27.5": url: "https://github.com/Exiv2/exiv2/releases/download/v0.27.5/exiv2-0.27.5-Source.tar.gz" sha256: "35a58618ab236a901ca4928b0ad8b31007ebdc0386d904409d825024e45ea6e2" diff --git a/recipes/exiv2/all/conanfile.py b/recipes/exiv2/all/conanfile.py index 84f13196b12f9..749096cccd372 100644 --- a/recipes/exiv2/all/conanfile.py +++ b/recipes/exiv2/all/conanfile.py @@ -76,13 +76,13 @@ def requirements(self): self.requires("libpng/[>=1.6 <2]") self.requires("zlib/[>=1.2.11 <2]") if self.options.with_xmp == "bundled": - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.with_curl: self.requires("libcurl/[>=7.78.0 <9]") if self.options.get_safe("with_brotli"): self.requires("brotli/1.1.0") if self.options.get_safe("with_inih"): - self.requires("inih/57") + self.requires("inih/58") def validate(self): if Version(self.version) >= "0.28.0": diff --git a/recipes/exiv2/config.yml b/recipes/exiv2/config.yml index d503f95292a28..f9244e625c48f 100644 --- a/recipes/exiv2/config.yml +++ b/recipes/exiv2/config.yml @@ -1,7 +1,7 @@ versions: - "0.28.1": + "0.28.2": folder: all - "0.28.0": + "0.28.1": folder: all "0.27.5": folder: all diff --git a/recipes/expected-lite/all/conandata.yml b/recipes/expected-lite/all/conandata.yml index d3a6677071af2..bbd60fdda1306 100644 --- a/recipes/expected-lite/all/conandata.yml +++ b/recipes/expected-lite/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.8.0": + url: "https://github.com/martinmoene/expected-lite/archive/v0.8.0.tar.gz" + sha256: "27649f30bd9d4fe7b193ab3eb6f78c64d0f585c24c085f340b4722b3d0b5e701" + "0.7.0": + url: "https://github.com/martinmoene/expected-lite/archive/v0.7.0.tar.gz" + sha256: "8e266cd304d405e02a6b4abf881ab7d8e203ca719c513711cf89a3b4e5d97918" "0.6.3": url: "https://github.com/martinmoene/expected-lite/archive/v0.6.3.tar.gz" sha256: "b2f90d5f03f6423ec67cc3c06fd0c4e813ec10c4313062b875b37d17593b57b4" diff --git a/recipes/expected-lite/all/conanfile.py b/recipes/expected-lite/all/conanfile.py index 591dbe00d1ead..d964e10b21ad2 100644 --- a/recipes/expected-lite/all/conanfile.py +++ b/recipes/expected-lite/all/conanfile.py @@ -9,11 +9,11 @@ class ExpectedLiteConan(ConanFile): name = "expected-lite" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/martinmoene/expected-lite" description = "expected lite - Expected objects in C++11 and later in a single-file header-only library" - topics = ("cpp11", "cpp14", "cpp17", "expected", "expected-implementations") license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/expected-lite" + topics = ("cpp11", "cpp14", "cpp17", "expected", "expected-implementations", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/expected-lite/all/test_package/conanfile.py b/recipes/expected-lite/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/expected-lite/all/test_package/conanfile.py +++ b/recipes/expected-lite/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/expected-lite/config.yml b/recipes/expected-lite/config.yml index 9fcad808e37e7..1cfd509cacf71 100644 --- a/recipes/expected-lite/config.yml +++ b/recipes/expected-lite/config.yml @@ -1,4 +1,8 @@ versions: + "0.8.0": + folder: all + "0.7.0": + folder: all "0.6.3": folder: all "0.6.2": diff --git a/recipes/extra-cmake-modules/all/conandata.yml b/recipes/extra-cmake-modules/all/conandata.yml index 1879a975409f5..f556f71e55d06 100644 --- a/recipes/extra-cmake-modules/all/conandata.yml +++ b/recipes/extra-cmake-modules/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.2.0": + url: "https://download.kde.org/stable/frameworks/6.2/extra-cmake-modules-6.2.0.tar.xz" + sha256: "6374bfa0dded8be265c702acd5de11eecd2851c625b93e1c87d8d0f5f1a8ebe1" "5.113.0": url: "https://download.kde.org/stable/frameworks/5.113/extra-cmake-modules-5.113.0.tar.xz" sha256: "265e5440eebeca07351a469e617a4bf35748927bd907b00ace9c018392bb3bc4" diff --git a/recipes/extra-cmake-modules/config.yml b/recipes/extra-cmake-modules/config.yml index 789c28809f9ae..101fb016a65c8 100644 --- a/recipes/extra-cmake-modules/config.yml +++ b/recipes/extra-cmake-modules/config.yml @@ -1,4 +1,6 @@ versions: + "6.2.0": + folder: "all" "5.113.0": folder: "all" "5.111.0": diff --git a/recipes/faker-cxx/all/conandata.yml b/recipes/faker-cxx/all/conandata.yml new file mode 100644 index 0000000000000..7125cc87621a1 --- /dev/null +++ b/recipes/faker-cxx/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.0": + url: "https://github.com/cieslarmichal/faker-cxx/archive/refs/tags/v2.0.0.tar.gz" + sha256: "8a7f5441f4453af868444675878a2d9a74918c1595caa65d537d3ea327e46a49" diff --git a/recipes/faker-cxx/all/conanfile.py b/recipes/faker-cxx/all/conanfile.py new file mode 100644 index 0000000000000..326381b2e9f9c --- /dev/null +++ b/recipes/faker-cxx/all/conanfile.py @@ -0,0 +1,103 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import 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 FakerCXXConan(ConanFile): + name = "faker-cxx" + description = "C++ Faker library based on faker-js/faker. " + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cieslarmichal/faker-cxx" + topics = ("faker", "fake",) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_std_format": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_std_format": False, + } + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "12", + "clang": "16", + "apple-clang": "16", + "Visual Studio": "17", + "msvc": "193", + } + + 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 not self.options.with_std_format: + self.requires("fmt/10.2.1") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if self.settings.os == "Windows" and self.options.shared: + # https://github.com/cieslarmichal/faker-cxx/issues/753 + raise ConanInvalidConfiguration(f"{self.ref} is not prepared to generated shared library on Windows.") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.22 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_SYSTEM_DEPENDENCIES"] = True + tc.variables["BUILD_TESTING"] = False + tc.variables["WARNINGS_AS_ERRORS"] = False + tc.variables["WITH_STD_FORMAT"] = self.options.with_std_format + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["faker-cxx"] + + self.cpp_info.set_property("cmake_file_name", "faker-cxx") + self.cpp_info.set_property("cmake_target_name", "faker-cxx::faker-cxx") diff --git a/recipes/faker-cxx/all/test_package/CMakeLists.txt b/recipes/faker-cxx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..23e8286ff283c --- /dev/null +++ b/recipes/faker-cxx/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(faker-cxx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE faker-cxx::faker-cxx) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/faker-cxx/all/test_package/conanfile.py b/recipes/faker-cxx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/faker-cxx/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/faker-cxx/all/test_package/test_package.cpp b/recipes/faker-cxx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ed71cb953c909 --- /dev/null +++ b/recipes/faker-cxx/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include "faker-cxx/Internet.h" +#include "faker-cxx/String.h" +#include "faker-cxx/Date.h" + +int main() +{ + const auto id = faker::string::uuid(); + const auto email = faker::internet::email(); + const auto password = faker::internet::password(); + const auto createdAt = faker::date::pastDate(5, faker::date::DateFormat::ISO); + const auto updatedAt = faker::date::recentDate(2, faker::date::DateFormat::ISO); + + std::cout << "id: " << id << ", email: " << email << ", password: " << password << ", createdAt: " << createdAt << ", updatedAt: " << updatedAt << "\n"; + + return 0; +} diff --git a/recipes/faker-cxx/config.yml b/recipes/faker-cxx/config.yml new file mode 100644 index 0000000000000..d77ad03cbf510 --- /dev/null +++ b/recipes/faker-cxx/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0.0": + folder: all diff --git a/recipes/fast-dds/all/conandata.yml b/recipes/fast-dds/all/conandata.yml index 02a8d037bcc07..9e3502b8efbdc 100644 --- a/recipes/fast-dds/all/conandata.yml +++ b/recipes/fast-dds/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.14.0": + url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.14.0.tar.gz" + sha256: "a6f12bce6b77f265cab81abde5dc2e08133be9a55bc29e573c84571d44eddbc2" "2.13.3": url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.13.3.tar.gz" sha256: "0f33596a8a48b5da4c43a964f2dc70127c6449defd5698944dddbdfb16d2b268" @@ -12,6 +15,13 @@ sources: url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.3.4.tar.gz" sha256: "b1b2322de0ca55a16495666e3fbda8aca32b888bbfaecda29f2ffc4b072ef7ac" patches: + "2.14.0": + - patch_file: "patches/2.13.3-0001-fix-find-asio-and-tinyxml2.patch" + patch_type: "conan" + patch_description: "Fixup find asio and tinyxml2" + - patch_file: "patches/2.13.3-0002-add-gettid-macro-for-glibc-compat.patch" + patch_type: "conan" + patch_description: "Add gettid macro for glibc compat. See: eProsima/Fast-DDS#4565" "2.13.3": - patch_file: "patches/2.13.3-0001-fix-find-asio-and-tinyxml2.patch" patch_type: "conan" diff --git a/recipes/fast-dds/all/conanfile.py b/recipes/fast-dds/all/conanfile.py index 624cba722a1e1..bdeaac9382380 100644 --- a/recipes/fast-dds/all/conanfile.py +++ b/recipes/fast-dds/all/conanfile.py @@ -49,11 +49,18 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): - return { - "gcc": "10", - "clang": "3.9", - "apple-clang": "8", - } + if Version(self.version) < "2.11.0": + return { + "gcc": "8", + "clang": "12", + "apple-clang": "12", + } + else: + return { + "gcc": "9", + "clang": "15", + "apple-clang": "15", + } def export_sources(self): export_conandata_patches(self) @@ -83,6 +90,7 @@ def requirements(self): self.requires("openssl/[>=1.1 <4]") def validate(self): + # fast-dds requires C++11 if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) check_min_vs(self, "192") @@ -92,10 +100,11 @@ def validate(self): raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) + if self.options.shared and is_msvc(self) and "MT" in msvc_runtime_flag(self): # This combination leads to an fast-dds error when linking # linking dynamic '*.dll' and static MT runtime - raise ConanInvalidConfiguration("Mixing a dll {} library with a static runtime is a bad idea".format(self.name)) + raise ConanInvalidConfiguration("Mixing a dll {} library with a static runtime is not supported".format(self.name)) def build_requirements(self): if Version(self.version) >= "2.7.0": diff --git a/recipes/fast-dds/config.yml b/recipes/fast-dds/config.yml index 7b157442d779f..29bc2c57212d7 100644 --- a/recipes/fast-dds/config.yml +++ b/recipes/fast-dds/config.yml @@ -1,4 +1,6 @@ versions: + "2.14.0": + folder: all "2.13.3": folder: all "2.11.2": diff --git a/recipes/fast_double_parser/all/conandata.yml b/recipes/fast_double_parser/all/conandata.yml index e6359076757f6..b8e8bab6d1227 100644 --- a/recipes/fast_double_parser/all/conandata.yml +++ b/recipes/fast_double_parser/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8.0": + url: "https://github.com/lemire/fast_double_parser/archive/v0.8.0.tar.gz" + sha256: "9ad74e059cc7c3e53a3057ca97a74c88ae2a6a7d36ce470193557cbd05ee8f92" "0.7.0": url: "https://github.com/lemire/fast_double_parser/archive/v0.7.0.tar.gz" sha256: "eb80a1d9c406bbe8cb22fffd3c007651f716abd03225009302d8aba8e9c4df77" diff --git a/recipes/fast_double_parser/all/conanfile.py b/recipes/fast_double_parser/all/conanfile.py index 872d82f578707..824ad38a512bb 100644 --- a/recipes/fast_double_parser/all/conanfile.py +++ b/recipes/fast_double_parser/all/conanfile.py @@ -10,12 +10,12 @@ class FastDoubleParserConan(ConanFile): name = "fast_double_parser" description = "Fast function to parse strings into double (binary64) floating-point values, enforces the RFC 7159 (JSON standard) grammar: 4x faster than strtod" - topics = ("numerical", "header-only") + license = ("Apache-2.0", "BSL-1.0") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/lemire/fast_double_parser" - license = ("Apache-2.0", "BSL-1.0") + topics = ("numerical", "header-only") package_type = "header-library" - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True def layout(self): diff --git a/recipes/fast_double_parser/all/test_package/CMakeLists.txt b/recipes/fast_double_parser/all/test_package/CMakeLists.txt index 00ff6376bfebe..0da8cca9a71e9 100644 --- a/recipes/fast_double_parser/all/test_package/CMakeLists.txt +++ b/recipes/fast_double_parser/all/test_package/CMakeLists.txt @@ -4,5 +4,5 @@ project(test_package LANGUAGES CXX) find_package(fast_double_parser REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} fast_double_parser::fast_double_parser) +target_link_libraries(${PROJECT_NAME} PRIVATE fast_double_parser::fast_double_parser) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fast_double_parser/config.yml b/recipes/fast_double_parser/config.yml index d61439bae1bc3..4dec0affe6753 100644 --- a/recipes/fast_double_parser/config.yml +++ b/recipes/fast_double_parser/config.yml @@ -1,4 +1,6 @@ versions: + "0.8.0": + folder: all "0.7.0": folder: all "0.6.0": diff --git a/recipes/ffmpeg/all/conandata.yml b/recipes/ffmpeg/all/conandata.yml index b51138c1bc00b..72d6f47cd55d3 100644 --- a/recipes/ffmpeg/all/conandata.yml +++ b/recipes/ffmpeg/all/conandata.yml @@ -1,40 +1,22 @@ sources: + "6.1.1": + url: "http://ffmpeg.org/releases/ffmpeg-6.1.1.tar.bz2" + sha256: "5e3133939a61ef64ac9b47ffd29a5ea6e337a4023ef0ad972094b4da844e3a20" "6.1": url: "http://ffmpeg.org/releases/ffmpeg-6.1.tar.bz2" sha256: "eb7da3de7dd3ce48a9946ab447a7346bd11a3a85e6efb8f2c2ce637e7f547611" "6.0.1": url: "http://ffmpeg.org/releases/ffmpeg-6.0.1.tar.bz2" sha256: "2c6e294569d1ba8e99cbf1acbe49e060a23454228a540a0f45d679d72ec69a06" - "6.0": - url: "https://ffmpeg.org/releases/ffmpeg-6.0.tar.bz2" - sha256: "47d062731c9f66a78380e35a19aac77cebceccd1c7cc309b9c82343ffc430c3d" "5.1.3": url: "https://ffmpeg.org/releases/ffmpeg-5.1.3.tar.bz2" sha256: "5d5bef6a11f0c500588f9870ec965a30acc0d54d8b1e535da6554a32902d236d" - "5.1": - url: "https://ffmpeg.org/releases/ffmpeg-5.1.tar.bz2" - sha256: "32b56fb01ce90d452958ae25e91c9564abf49ed5453c127bec23c63e530aa8fa" "5.0.3": url: "https://ffmpeg.org/releases/ffmpeg-5.0.3.tar.bz2" sha256: "664e8fa8ac4cc5dce03277f022798461998d9bb8d96b9e1859b24e74511229fd" - "5.0": - url: "https://ffmpeg.org/releases/ffmpeg-5.0.tar.bz2" - sha256: "c0130b8db2c763430fd1c6905288d61bc44ee0548ad5fcd2dfd650b88432bed9" "4.4.4": url: "https://ffmpeg.org/releases/ffmpeg-4.4.4.tar.bz2" sha256: "47b1fbf70a2c090d9c0fae5910da11c6406ca92408bb69d8c935cd46c622c7ce" - "4.4.3": - url: "https://ffmpeg.org/releases/ffmpeg-4.4.3.tar.bz2" - sha256: "33b8c2dbcd530fe1db5710415345609b4ca227bd0da1e3a9332dbb0f11fd273a" - "4.4": - url: "https://ffmpeg.org/releases/ffmpeg-4.4.tar.bz2" - sha256: "42093549751b582cf0f338a21a3664f52e0a9fbe0d238d3c992005e493607d0e" - "4.3.2": - url: "https://ffmpeg.org/releases/ffmpeg-4.3.2.tar.bz2" - sha256: "ab3a6d6a70358ba0a5f67f37f91f6656b7302b02e98e5b8c846c16763c99913a" - "4.2.1": - url: "https://ffmpeg.org/releases/ffmpeg-4.2.1.tar.bz2" - sha256: "682a9fa3f6864d7f0dbf224f86b129e337bc60286e0d00dffcd710998d521624" patches: "5.1.3": - patch_file: "patches/5.1-0001-fix-libsvtav1-compressed_ten_bit_format.patch" @@ -53,55 +35,13 @@ patches: patch_description: "Compatibility with vulkan >= 1.3.239" patch_type: "portability" patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/eb0455d64690eed0068e5cb202f72ecdf899837c" - "5.1": - - patch_file: "patches/5.1-0001-fix-libsvtav1-compressed_ten_bit_format.patch" - patch_description: "Compatibility with libsvtav1 > 1.2.0" - patch_type: "portability" - patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/031f1561cd286596cdb374da32f8aa816ce3b135" - - patch_file: "patches/5.1-0002-fix-libsvtav1-vbv_bufsize-1.patch" - patch_description: "Compatibility with libsvtav1 > 1.2.0" - patch_type: "portability" - patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/1c6fd7d756afe0f8b7df14dbf7a95df275f8f5ee" - - patch_file: "patches/5.1-0003-fix-libsvtav1-vbv_bufsize-2.patch" - patch_description: "Compatibility with libsvtav1 > 1.2.0" - patch_type: "portability" - patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/96748ac54f998ba6fe22802799c16b4eba8d4ccc" - - patch_file: "patches/5.0-0001-fix-hwcontext_vulkan.patch" - patch_description: "Compatibility with vulkan >= 1.3.239" - patch_type: "portability" - patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/eb0455d64690eed0068e5cb202f72ecdf899837c" "5.0.3": - patch_file: "patches/5.0-0001-fix-hwcontext_vulkan.patch" patch_description: "Compatibility with vulkan >= 1.3.239" patch_type: "portability" patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/eb0455d64690eed0068e5cb202f72ecdf899837c" - "5.0": - - patch_file: "patches/5.0-0001-fix-hwcontext_vulkan.patch" - patch_description: "Compatibility with vulkan >= 1.3.239" - patch_type: "portability" - patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/eb0455d64690eed0068e5cb202f72ecdf899837c" "4.4.4": - patch_file: "patches/4.4-0001-fix-aom_codec_av1_dx_algo.patch" patch_description: "Compatibility with shared libaom" patch_type: "portability" patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/d92fdc714496d43234733c315894abe0beeb3529" - "4.4.3": - - patch_file: "patches/4.4-0001-fix-aom_codec_av1_dx_algo.patch" - patch_description: "Compatibility with shared libaom" - patch_type: "portability" - patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/d92fdc714496d43234733c315894abe0beeb3529" - "4.4": - - patch_file: "patches/4.4-0001-fix-aom_codec_av1_dx_algo.patch" - patch_description: "Compatibility with shared libaom" - patch_type: "portability" - patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/d92fdc714496d43234733c315894abe0beeb3529" - "4.3.2": - - patch_file: "patches/4.2-0001-fix-aom_codec_av1_dx_algo.patch" - patch_description: "Compatibility with shared libaom" - patch_type: "portability" - patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/d92fdc714496d43234733c315894abe0beeb3529" - "4.2.1": - - patch_file: "patches/4.2-0001-fix-aom_codec_av1_dx_algo.patch" - patch_description: "Compatibility with shared libaom" - patch_type: "portability" - patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/d92fdc714496d43234733c315894abe0beeb3529" diff --git a/recipes/ffmpeg/all/conanfile.py b/recipes/ffmpeg/all/conanfile.py index faccb5c3993a9..0d94387010d3c 100644 --- a/recipes/ffmpeg/all/conanfile.py +++ b/recipes/ffmpeg/all/conanfile.py @@ -1,4 +1,4 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os from conan.tools.build import cross_building @@ -190,6 +190,8 @@ class FFMpegConan(ConanFile): "disable_filters": None, "enable_filters": None, } + # Fix for mslink: Argument list too long + short_paths = True @property def _settings_build(self): @@ -347,6 +349,10 @@ def validate(self): raise ConanInvalidConfiguration("FFmpeg '{}' option requires '{}' option to be enabled".format( dependency, "' or '".join(features))) + if conan_version.major == 1 and is_msvc(self) and self.options.shared: + # Linking fails with "Argument list too long" for some reason on Conan v1 + raise ConanInvalidConfiguration("MSVC shared build is not supported for Conan v1") + def build_requirements(self): if self.settings.arch in ("x86", "x86_64"): self.tool_requires("yasm/1.3.0") @@ -490,35 +496,25 @@ def opt_append_disable_if_set(args, what, v): opt_enable_disable("libaom", self.options.with_libaom), opt_enable_disable("openssl", self.options.with_ssl == "openssl"), opt_enable_disable("alsa", self.options.get_safe("with_libalsa")), - opt_enable_disable( - "libpulse", self.options.get_safe("with_pulse")), + opt_enable_disable("libpulse", self.options.get_safe("with_pulse")), opt_enable_disable("vaapi", self.options.get_safe("with_vaapi")), opt_enable_disable("vdpau", self.options.get_safe("with_vdpau")), opt_enable_disable("libxcb", self.options.get_safe("with_xcb")), - opt_enable_disable( - "libxcb-shm", self.options.get_safe("with_xcb")), - opt_enable_disable( - "libxcb-shape", self.options.get_safe("with_xcb")), - opt_enable_disable( - "libxcb-xfixes", self.options.get_safe("with_xcb")), + opt_enable_disable("libxcb-shm", self.options.get_safe("with_xcb")), + opt_enable_disable("libxcb-shape", self.options.get_safe("with_xcb")), + opt_enable_disable("libxcb-xfixes", self.options.get_safe("with_xcb")), opt_enable_disable("appkit", self.options.get_safe("with_appkit")), - opt_enable_disable( - "avfoundation", self.options.get_safe("with_avfoundation")), - opt_enable_disable( - "coreimage", self.options.get_safe("with_coreimage")), - opt_enable_disable( - "audiotoolbox", self.options.get_safe("with_audiotoolbox")), - opt_enable_disable( - "videotoolbox", self.options.get_safe("with_videotoolbox")), - opt_enable_disable("securetransport", - self.options.with_ssl == "securetransport"), + opt_enable_disable("avfoundation", self.options.get_safe("with_avfoundation")), + opt_enable_disable("coreimage", self.options.get_safe("with_coreimage")), + opt_enable_disable("audiotoolbox", self.options.get_safe("with_audiotoolbox")), + opt_enable_disable("videotoolbox", self.options.get_safe("with_videotoolbox")), + opt_enable_disable("securetransport", self.options.with_ssl == "securetransport"), "--disable-cuda", # FIXME: CUDA support "--disable-cuvid", # FIXME: CUVID support # Licenses opt_enable_disable("nonfree", self.options.with_libfdk_aac or (self.options.with_ssl and ( self.options.with_libx264 or self.options.with_libx265 or self.options.postproc))), - opt_enable_disable( - "gpl", self.options.with_libx264 or self.options.with_libx265 or self.options.postproc) + opt_enable_disable("gpl", self.options.with_libx264 or self.options.with_libx265 or self.options.postproc) ] # Individual Component Options @@ -760,265 +756,148 @@ def _set_component_version(self, component_name): def package_info(self): if self.options.with_programs: if self.options.with_sdl: - self.cpp_info.components["programs"].requires = [ - "sdl::libsdl2"] - + self.cpp_info.components["programs"].requires = ["sdl::libsdl2"] + + def _add_component(name, dependencies): + component = self.cpp_info.components[name] + component.set_property("pkg_config_name", f"lib{name}") + self._set_component_version(name) + component.libs = [name] + if name != "avutil": + component.requires = ["avutil"] + for dep in dependencies: + if self.options.get_safe(dep): + component.requires.append(dep) + if self.settings.os in ("FreeBSD", "Linux"): + component.system_libs.append("m") + return component + + avutil = _add_component("avutil", []) if self.options.avdevice: - self.cpp_info.components["avdevice"].set_property( - "pkg_config_name", "libavdevice") - self.cpp_info.components["avdevice"].libs = ["avdevice"] - self.cpp_info.components["avdevice"].requires = ["avutil"] - if self.options.avfilter: - self.cpp_info.components["avdevice"].requires.append( - "avfilter") - if self.options.swscale: - self.cpp_info.components["avdevice"].requires.append("swscale") - if self.options.avformat: - self.cpp_info.components["avdevice"].requires.append( - "avformat") - if self.options.avcodec: - self.cpp_info.components["avdevice"].requires.append("avcodec") - if self.options.swresample: - self.cpp_info.components["avdevice"].requires.append( - "swresample") - if self.options.postproc: - self.cpp_info.components["avdevice"].requires.append( - "postproc") - self._set_component_version("avdevice") - + avdevice = _add_component("avdevice", ["avfilter", "swscale", "avformat", "avcodec", "swresample", "postproc"]) if self.options.avfilter: - self.cpp_info.components["avfilter"].set_property( - "pkg_config_name", "libavfilter") - self.cpp_info.components["avfilter"].libs = ["avfilter"] - self.cpp_info.components["avfilter"].requires = ["avutil"] - if self.options.swscale: - self.cpp_info.components["avfilter"].requires.append("swscale") - if self.options.avformat: - self.cpp_info.components["avfilter"].requires.append( - "avformat") - if self.options.avcodec: - self.cpp_info.components["avfilter"].requires.append("avcodec") - if self.options.swresample: - self.cpp_info.components["avfilter"].requires.append( - "swresample") - if self.options.postproc: - self.cpp_info.components["avfilter"].requires.append( - "postproc") - self._set_component_version("avfilter") - + avfilter = _add_component("avfilter", ["swscale", "avformat", "avcodec", "swresample", "postproc"]) if self.options.avformat: - self.cpp_info.components["avformat"].set_property( - "pkg_config_name", "libavformat") - self.cpp_info.components["avformat"].libs = ["avformat"] - self.cpp_info.components["avformat"].requires = ["avutil"] - if self.options.avcodec: - self.cpp_info.components["avformat"].requires.append("avcodec") - if self.options.swresample: - self.cpp_info.components["avformat"].requires.append( - "swresample") - self._set_component_version("avformat") - + avformat = _add_component("avformat", ["avcodec", "swscale"]) if self.options.avcodec: - self.cpp_info.components["avcodec"].set_property( - "pkg_config_name", "libavcodec") - self.cpp_info.components["avcodec"].libs = ["avcodec"] - self.cpp_info.components["avcodec"].requires = ["avutil"] - if self.options.swresample: - self.cpp_info.components["avcodec"].requires.append( - "swresample") - self._set_component_version("avcodec") - + avcodec = _add_component("avcodec", ["swresample"]) if self.options.swscale: - self.cpp_info.components["swscale"].set_property( - "pkg_config_name", "libswscale") - self.cpp_info.components["swscale"].libs = ["swscale"] - self.cpp_info.components["swscale"].requires = ["avutil"] - self._set_component_version("swscale") - + _add_component("swscale", []) if self.options.swresample: - self.cpp_info.components["swresample"].set_property( - "pkg_config_name", "libswresample") - self.cpp_info.components["swresample"].libs = ["swresample"] - self.cpp_info.components["swresample"].requires = ["avutil"] - self._set_component_version("swresample") - + _add_component("swresample", []) if self.options.postproc: - self.cpp_info.components["postproc"].set_property( - "pkg_config_name", "libpostproc") - self.cpp_info.components["postproc"].libs = ["postproc"] - self.cpp_info.components["postproc"].requires = ["avutil"] - self._set_component_version("postproc") - - self.cpp_info.components["avutil"].set_property( - "pkg_config_name", "libavutil") - self.cpp_info.components["avutil"].libs = ["avutil"] - self._set_component_version("avutil") + _add_component("postproc", []) if self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.components["avutil"].system_libs = [ - "pthread", "m", "dl"] - if self.options.swresample: - self.cpp_info.components["swresample"].system_libs = ["m"] - if self.options.swscale: - self.cpp_info.components["swscale"].system_libs = ["m"] - if self.options.postproc: - self.cpp_info.components["postproc"].system_libs = ["m"] + avutil.system_libs.extend(["pthread", "dl"]) if self.options.get_safe("fPIC"): if self.settings.compiler in ("gcc", "clang"): # https://trac.ffmpeg.org/ticket/1713 # https://ffmpeg.org/platform.html#Advanced-linking-configuration # https://ffmpeg.org/pipermail/libav-user/2014-December/007719.html - self.cpp_info.components["avcodec"].exelinkflags.append( - "-Wl,-Bsymbolic") - self.cpp_info.components["avcodec"].sharedlinkflags.append( - "-Wl,-Bsymbolic") - if self.options.avformat: - self.cpp_info.components["avformat"].system_libs = ["m"] + avcodec.exelinkflags.append("-Wl,-Bsymbolic") + avcodec.sharedlinkflags.append("-Wl,-Bsymbolic") if self.options.avfilter: - self.cpp_info.components["avfilter"].system_libs = [ - "m", "pthread"] - if self.options.avdevice: - self.cpp_info.components["avdevice"].system_libs = ["m"] + avfilter.system_libs.append("pthread") elif self.settings.os == "Windows": if self.options.avcodec: - self.cpp_info.components["avcodec"].system_libs = ["mfplat", "mfuuid", "strmiids"] + avcodec.system_libs = ["mfplat", "mfuuid", "strmiids"] if self.options.avdevice: - self.cpp_info.components["avdevice"].system_libs = [ - "ole32", "psapi", "strmiids", "uuid", "oleaut32", "shlwapi", "gdi32", "vfw32"] - self.cpp_info.components["avutil"].system_libs = [ - "user32", "bcrypt"] - self.cpp_info.components["avformat"].system_libs = ["secur32"] + avdevice.system_libs = ["ole32", "psapi", "strmiids", "uuid", "oleaut32", "shlwapi", "gdi32", "vfw32"] + avutil.system_libs = ["user32", "bcrypt"] + avformat.system_libs = ["secur32"] elif is_apple_os(self): if self.options.avdevice: - self.cpp_info.components["avdevice"].frameworks = [ - "CoreFoundation", "Foundation", "CoreGraphics"] + avdevice.frameworks = ["CoreFoundation", "Foundation", "CoreGraphics"] if self.options.avfilter: - self.cpp_info.components["avfilter"].frameworks = [ - "CoreGraphics"] + avfilter.frameworks = ["CoreGraphics"] if self.options.avcodec: - self.cpp_info.components["avcodec"].frameworks = [ - "CoreFoundation", "CoreVideo", "CoreMedia"] + avcodec.frameworks = ["CoreFoundation", "CoreVideo", "CoreMedia"] if self.settings.os == "Macos": if self.options.avdevice: - self.cpp_info.components["avdevice"].frameworks.append( - "OpenGL") + avdevice.frameworks.append("OpenGL") if self.options.avfilter: - self.cpp_info.components["avfilter"].frameworks.append( - "OpenGL") + avfilter.frameworks.append("OpenGL") if self.options.avdevice: if self.options.get_safe("with_libalsa"): - self.cpp_info.components["avdevice"].requires.append( - "libalsa::libalsa") + avdevice.requires.append("libalsa::libalsa") if self.options.get_safe("with_xcb"): - self.cpp_info.components["avdevice"].requires.append( - "xorg::xcb") + avdevice.requires.extend(["xorg::xcb", "xorg::xcb-shm", "xorg::xcb-xfixes", "xorg::xcb-shape", "xorg::xv", "xorg::xext"]) if self.options.get_safe("with_pulse"): - self.cpp_info.components["avdevice"].requires.append( - "pulseaudio::pulseaudio") + avdevice.requires.append("pulseaudio::pulseaudio") if self.options.get_safe("with_appkit"): - self.cpp_info.components["avdevice"].frameworks.append( - "AppKit") + avdevice.frameworks.append("AppKit") if self.options.get_safe("with_avfoundation"): - self.cpp_info.components["avdevice"].frameworks.append( - "AVFoundation") + avdevice.frameworks.append("AVFoundation") if self.options.get_safe("with_audiotoolbox"): - self.cpp_info.components["avdevice"].frameworks.append( - "CoreAudio") + avdevice.frameworks.append("CoreAudio") if self.options.avcodec: if self.options.with_zlib: - self.cpp_info.components["avcodec"].requires.append( - "zlib::zlib") + avcodec.requires.append("zlib::zlib") if self.options.with_lzma: - self.cpp_info.components["avcodec"].requires.append( - "xz_utils::xz_utils") + avcodec.requires.append("xz_utils::xz_utils") if self.options.with_libiconv: - self.cpp_info.components["avcodec"].requires.append( - "libiconv::libiconv") + avcodec.requires.append("libiconv::libiconv") if self.options.with_openjpeg: - self.cpp_info.components["avcodec"].requires.append( - "openjpeg::openjpeg") + avcodec.requires.append("openjpeg::openjpeg") if self.options.with_openh264: - self.cpp_info.components["avcodec"].requires.append( - "openh264::openh264") + avcodec.requires.append("openh264::openh264") if self.options.with_vorbis: - self.cpp_info.components["avcodec"].requires.append( - "vorbis::vorbis") + avcodec.requires.append("vorbis::vorbis") if self.options.with_opus: - self.cpp_info.components["avcodec"].requires.append( - "opus::opus") + avcodec.requires.append("opus::opus") if self.options.with_libx264: - self.cpp_info.components["avcodec"].requires.append( - "libx264::libx264") + avcodec.requires.append("libx264::libx264") if self.options.with_libx265: - self.cpp_info.components["avcodec"].requires.append( - "libx265::libx265") + avcodec.requires.append("libx265::libx265") if self.options.with_libvpx: - self.cpp_info.components["avcodec"].requires.append( - "libvpx::libvpx") + avcodec.requires.append("libvpx::libvpx") if self.options.with_libmp3lame: - self.cpp_info.components["avcodec"].requires.append( - "libmp3lame::libmp3lame") + avcodec.requires.append("libmp3lame::libmp3lame") if self.options.with_libfdk_aac: - self.cpp_info.components["avcodec"].requires.append( - "libfdk_aac::libfdk_aac") + avcodec.requires.append("libfdk_aac::libfdk_aac") if self.options.with_libwebp: - self.cpp_info.components["avcodec"].requires.append( - "libwebp::libwebp") + avcodec.requires.append("libwebp::libwebp") if self.options.get_safe("with_audiotoolbox"): - self.cpp_info.components["avcodec"].frameworks.append( - "AudioToolbox") + avcodec.frameworks.append("AudioToolbox") if self.options.get_safe("with_videotoolbox"): - self.cpp_info.components["avcodec"].frameworks.append( - "VideoToolbox") + avcodec.frameworks.append("VideoToolbox") if self.options.get_safe("with_libsvtav1"): - self.cpp_info.components["avcodec"].requires.extend( - ["libsvtav1::decoder", "libsvtav1::encoder"]) + avcodec.requires.extend(["libsvtav1::decoder", "libsvtav1::encoder"]) if self.options.get_safe("with_libaom"): - self.cpp_info.components["avcodec"].requires.append( - "libaom-av1::libaom-av1") + avcodec.requires.append("libaom-av1::libaom-av1") if self.options.get_safe("with_libdav1d"): - self.cpp_info.components["avcodec"].requires.append( - "dav1d::dav1d") + avcodec.requires.append("dav1d::dav1d") if self.options.avformat: if self.options.with_bzip2: - self.cpp_info.components["avformat"].requires.append( - "bzip2::bzip2") + avformat.requires.append("bzip2::bzip2") if self.options.with_zeromq: - self.cpp_info.components["avformat"].requires.append( - "zeromq::libzmq") + avformat.requires.append("zeromq::libzmq") if self.options.with_ssl == "openssl": - self.cpp_info.components["avformat"].requires.append( - "openssl::ssl") + avformat.requires.append("openssl::ssl") elif self.options.with_ssl == "securetransport": - self.cpp_info.components["avformat"].frameworks.append( - "Security") + avformat.frameworks.append("Security") if self.options.avfilter: if self.options.with_freetype: - self.cpp_info.components["avfilter"].requires.append( - "freetype::freetype") + avfilter.requires.append("freetype::freetype") if self.options.with_zeromq: - self.cpp_info.components["avfilter"].requires.append( - "zeromq::libzmq") + avfilter.requires.append("zeromq::libzmq") if self.options.get_safe("with_appkit"): - self.cpp_info.components["avfilter"].frameworks.append( - "AppKit") + avfilter.frameworks.append("AppKit") if self.options.get_safe("with_coreimage"): - self.cpp_info.components["avfilter"].frameworks.append( - "CoreImage") + avfilter.frameworks.append("CoreImage") if Version(self.version) >= "5.0" and is_apple_os(self): - self.cpp_info.components["avfilter"].frameworks.append("Metal") + avfilter.frameworks.append("Metal") if self.options.get_safe("with_vaapi"): - self.cpp_info.components["avutil"].requires.extend( - ["vaapi::vaapi", "xorg::x11"]) + avutil.requires.extend(["vaapi::vaapi", "xorg::x11"]) if self.options.get_safe("with_vdpau"): - self.cpp_info.components["avutil"].requires.append("vdpau::vdpau") + avutil.requires.append("vdpau::vdpau") if self._version_supports_vulkan and self.options.get_safe("with_vulkan"): - self.cpp_info.components["avutil"].requires.append( - "vulkan-loader::vulkan-loader") + avutil.requires.append("vulkan-loader::vulkan-loader") diff --git a/recipes/ffmpeg/all/patches/4.2-0001-fix-aom_codec_av1_dx_algo.patch b/recipes/ffmpeg/all/patches/4.2-0001-fix-aom_codec_av1_dx_algo.patch deleted file mode 100644 index 7ed8995ec2e47..0000000000000 --- a/recipes/ffmpeg/all/patches/4.2-0001-fix-aom_codec_av1_dx_algo.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libavcodec/libaomdec.c -+++ b/libavcodec/libaomdec.c -@@ -216,7 +216,7 @@ static av_cold int aom_free(AVCodecContext *avctx) - - static av_cold int av1_init(AVCodecContext *avctx) - { -- return aom_init(avctx, &aom_codec_av1_dx_algo); -+ return aom_init(avctx, aom_codec_av1_dx()); - } - - AVCodec ff_libaom_av1_decoder = { diff --git a/recipes/ffmpeg/config.yml b/recipes/ffmpeg/config.yml index 0ea4ae6cca888..7c2f1e0428fcb 100644 --- a/recipes/ffmpeg/config.yml +++ b/recipes/ffmpeg/config.yml @@ -1,25 +1,13 @@ versions: + "6.1.1": + folder: "all" "6.1": folder: "all" "6.0.1": folder: "all" - "6.0": - folder: "all" "5.1.3": folder: "all" - "5.1": - folder: "all" "5.0.3": folder: "all" - "5.0": - folder: "all" "4.4.4": folder: "all" - "4.4.3": - folder: "all" - "4.4": - folder: "all" - "4.3.2": - folder: "all" - "4.2.1": - folder: "all" diff --git a/recipes/fftw/all/conanfile.py b/recipes/fftw/all/conanfile.py index a5537aff62517..48fcc3185c1a8 100644 --- a/recipes/fftw/all/conanfile.py +++ b/recipes/fftw/all/conanfile.py @@ -49,7 +49,6 @@ class FFTWConan(ConanFile): "combinedthreads": False, "simd": False, } - _current_precision = None def export_sources(self): export_conandata_patches(self) @@ -93,11 +92,6 @@ def generate(self): tc.variables["ENABLE_AVX2"] = self.options.simd == "avx2" tc.generate() - @property - def build_folder(self): - bf = super().build_folder - return os.path.join(bf, self._current_precision) if self._current_precision else bf - @property def _all_precisions(self): return [p for p in ALL if self.options.get_safe(f"precision_{p}")] @@ -107,29 +101,21 @@ def on_off(value): return "ON" if value else 'OFF' apply_conandata_patches(self) - for self._current_precision in self._all_precisions: + for current_precision in self._all_precisions: cmake = CMake(self) variables = { - "ENABLE_FLOAT": on_off(self._current_precision == SINGLE), - "ENABLE_LONG_DOUBLE": on_off(self._current_precision == LONGDOUBLE), - "ENABLE_QUAD_PRECISION": on_off(self._current_precision == QUAD) + "ENABLE_FLOAT": on_off(current_precision == SINGLE), + "ENABLE_LONG_DOUBLE": on_off(current_precision == LONGDOUBLE), + "ENABLE_QUAD_PRECISION": on_off(current_precision == QUAD) } cmake.configure(variables=variables) cmake.build() - - # Potentially avoid side effects due to build_folder property tweak. - self._current_precision = None + cmake.install() def package(self): copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - for self._current_precision in self._all_precisions: - 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")) - - # Potentially avoid side effects due to build_folder property tweak. - self._current_precision = None + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): cmake_config_name = cmake_namespace = "FFTW3" diff --git a/recipes/fixed-containers/all/conanfile.py b/recipes/fixed-containers/all/conanfile.py index cdfe73d72c2b9..9729326c0e725 100644 --- a/recipes/fixed-containers/all/conanfile.py +++ b/recipes/fixed-containers/all/conanfile.py @@ -37,6 +37,9 @@ def _compilers_minimum_version(self): def layout(self): basic_layout(self, src_folder="src") + def requirements(self): + self.requires("magic_enum/0.9.3", transitive_headers=True) + def package_id(self): self.info.clear() @@ -64,3 +67,6 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "fixed_containers") + self.cpp_info.set_property("cmake_target_name", "fixed_containers::fixed_containers") diff --git a/recipes/fixed-containers/all/test_package/CMakeLists.txt b/recipes/fixed-containers/all/test_package/CMakeLists.txt index 697ff29d18c1a..24c19844b253b 100644 --- a/recipes/fixed-containers/all/test_package/CMakeLists.txt +++ b/recipes/fixed-containers/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -find_package(fixed-containers REQUIRED CONFIG) +find_package(fixed_containers) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE fixed-containers::fixed-containers) +target_link_libraries(${PROJECT_NAME} PRIVATE fixed_containers::fixed_containers) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/fixed-containers/all/test_package/test_package.cpp b/recipes/fixed-containers/all/test_package/test_package.cpp index aed686f3d1107..d129e8622b3d9 100644 --- a/recipes/fixed-containers/all/test_package/test_package.cpp +++ b/recipes/fixed-containers/all/test_package/test_package.cpp @@ -1,10 +1,9 @@ #include "fixed_containers/fixed_vector.hpp" - -using namespace fixed_containers; +#include "fixed_containers/enum_utils.hpp" int main(void) { constexpr auto v1 = []() { - FixedVector v{}; + fixed_containers::FixedVector v{}; v.push_back(0); v.emplace_back(1); v.push_back(2); diff --git a/recipes/flac/all/conandata.yml b/recipes/flac/all/conandata.yml index e2b6d7651827c..da984a86264a9 100644 --- a/recipes/flac/all/conandata.yml +++ b/recipes/flac/all/conandata.yml @@ -9,6 +9,14 @@ sources: url: "https://github.com/xiph/flac/archive/1.3.3.tar.gz" sha256: "668cdeab898a7dd43cf84739f7e1f3ed6b35ece2ef9968a5c7079fe9adfe1689" patches: + "1.4.3": + - patch_file: "patches/1.4.2-002-ignore-dll_export-define.patch" + patch_description: "Ignore autotools-specific DLL_EXPORT define in export.h" + patch_type: "conan" + "1.4.2": + - patch_file: "patches/1.4.2-002-ignore-dll_export-define.patch" + patch_description: "Ignore autotools-specific DLL_EXPORT define in export.h" + patch_type: "conan" "1.3.3": - patch_file: "patches/fix-cmake-1.3.3.patch" patch_description: "Various adaptations in CMakeLists.txt files to improve compatibility with Conan." diff --git a/recipes/flac/all/conanfile.py b/recipes/flac/all/conanfile.py index e8bc14ed2a18c..2e622f2d8d125 100644 --- a/recipes/flac/all/conanfile.py +++ b/recipes/flac/all/conanfile.py @@ -56,6 +56,7 @@ def generate(self): tc.variables["BUILD_EXAMPLES"] = False tc.variables["BUILD_DOCS"] = False tc.variables["BUILD_TESTING"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() cd = CMakeDeps(self) cd.generate() @@ -105,7 +106,6 @@ def package_info(self): self.cpp_info.components["libflac"].system_libs += ["m"] bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) self.env_info.PATH.append(bin_path) # TODO: to remove in conan v2 diff --git a/recipes/flac/all/patches/1.4.2-002-ignore-dll_export-define.patch b/recipes/flac/all/patches/1.4.2-002-ignore-dll_export-define.patch new file mode 100644 index 0000000000000..0ce0853b69c7e --- /dev/null +++ b/recipes/flac/all/patches/1.4.2-002-ignore-dll_export-define.patch @@ -0,0 +1,22 @@ +--- include/FLAC/export.h ++++ include/FLAC/export.h +@@ -74,7 +74,7 @@ + */ + #if defined(_WIN32) + +-#if defined(FLAC__NO_DLL) && !(defined(DLL_EXPORT)) ++#if defined(FLAC__NO_DLL) + #define FLAC_API + #else + #ifdef FLAC_API_EXPORTS +--- include/FLAC++/export.h ++++ include/FLAC++/export.h +@@ -73,7 +73,7 @@ + * by libtool, must override FLAC__NO_DLL on building shared components + */ + #if defined(_WIN32) +-#if defined(FLAC__NO_DLL) && !(defined(DLL_EXPORT)) ++#if defined(FLAC__NO_DLL) + #define FLACPP_API + #else + #ifdef FLACPP_API_EXPORTS diff --git a/recipes/flatbuffers/all/conandata.yml b/recipes/flatbuffers/all/conandata.yml index 0cb168b6cedaa..f334b7432aac3 100644 --- a/recipes/flatbuffers/all/conandata.yml +++ b/recipes/flatbuffers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "24.3.25": + url: "https://github.com/google/flatbuffers/archive/v24.3.25.tar.gz" + sha256: "4157c5cacdb59737c5d627e47ac26b140e9ee28b1102f812b36068aab728c1ed" "24.3.7": url: "https://github.com/google/flatbuffers/archive/v24.3.7.tar.gz" sha256: "bfff9d2150fcff88f844e8c608b02b2a0e94c92aea39b04c0624783464304784" diff --git a/recipes/flatbuffers/config.yml b/recipes/flatbuffers/config.yml index 7828770c7bd8a..5bc4e9c3e21fd 100644 --- a/recipes/flatbuffers/config.yml +++ b/recipes/flatbuffers/config.yml @@ -1,4 +1,6 @@ versions: + "24.3.25": + folder: all "24.3.7": folder: all "23.5.26": diff --git a/recipes/flatbush/all/conandata.yml b/recipes/flatbush/all/conandata.yml index f43d2fb04fed7..4382ecd215405 100644 --- a/recipes/flatbush/all/conandata.yml +++ b/recipes/flatbush/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.1": + url: "https://github.com/chusitoo/flatbush/archive/refs/tags/v1.2.1.zip" + sha256: "7f8226cb9a58cc75c99800a8fb213b1c2c5df81051ec559d5ff7b4ed0e8c097a" "1.2.0": url: "https://github.com/chusitoo/flatbush/archive/refs/tags/v1.2.0.zip" sha256: "d8d0471ad6aba1e4b1160abc38a0fe21a35e3ea1c2a9509ce9910072f7fc24bb" diff --git a/recipes/flatbush/config.yml b/recipes/flatbush/config.yml index 2424e32f70b3e..7b2fedacd7387 100644 --- a/recipes/flatbush/config.yml +++ b/recipes/flatbush/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.1": + folder: "all" "1.2.0": folder: "all" "1.1.0": diff --git a/recipes/flecs/all/conandata.yml b/recipes/flecs/all/conandata.yml index aa41772cdfb91..3094ffc04d061 100644 --- a/recipes/flecs/all/conandata.yml +++ b/recipes/flecs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.11": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.2.11.tar.gz" + sha256: "8ebc5f6f3ec7bbba30b0afe9d22f157437925772857ea1c6e4201eb5d31b4fe5" "3.2.8": url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.2.8.tar.gz" sha256: "b40453a77b66e220408c50b119da54b153c248cf6f7025575e3fd1a8ff79f748" diff --git a/recipes/flecs/config.yml b/recipes/flecs/config.yml index df52862429336..3122441aef13c 100644 --- a/recipes/flecs/config.yml +++ b/recipes/flecs/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.11": + folder: all "3.2.8": folder: all "3.2.4": diff --git a/recipes/fltk/all/conanfile.py b/recipes/fltk/all/conanfile.py index bd7f4d5b1b6f2..57f2437f1fe63 100644 --- a/recipes/fltk/all/conanfile.py +++ b/recipes/fltk/all/conanfile.py @@ -4,6 +4,8 @@ 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, collect_libs, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.microsoft import msvc_runtime_flag +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -36,6 +38,14 @@ class FltkConan(ConanFile): "with_xft": False, } + @property + def _is_cl_like(self): + return self.settings.compiler.get_safe("runtime") is not None + + @property + def _is_cl_like_static_runtime(self): + return self._is_cl_like and "MT" in msvc_runtime_flag(self) + def export_sources(self): export_conandata_patches(self) @@ -96,6 +106,9 @@ def generate(self): tc.variables["OPTION_USE_SYSTEM_LIBJPEG"] = True tc.variables["OPTION_USE_SYSTEM_ZLIB"] = True tc.variables["OPTION_USE_SYSTEM_LIBPNG"] = True + if Version(self.version) >= "1.3.9": + if self._is_cl_like: + tc.variables["FLTK_MSVC_RUNTIME_DLL"] = not self._is_cl_like_static_runtime tc.generate() tc = CMakeDeps(self) diff --git a/recipes/fmt/all/conandata.yml b/recipes/fmt/all/conandata.yml index 1c4bb54e9bf65..2e5c98f10fb1b 100644 --- a/recipes/fmt/all/conandata.yml +++ b/recipes/fmt/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "11.0.1": + url: "https://github.com/fmtlib/fmt/releases/download/11.0.1/fmt-11.0.1.zip" + sha256: "62ca45531814109b5d6cef0cf2fd17db92c32a30dd23012976e768c685534814" + "11.0.0": + url: "https://github.com/fmtlib/fmt/releases/download/11.0.0/fmt-11.0.0.zip" + sha256: "583ce480ef07fad76ef86e1e2a639fc231c3daa86c4aa6bcba524ce908f30699" "10.2.1": url: "https://github.com/fmtlib/fmt/releases/download/10.2.1/fmt-10.2.1.zip" sha256: "312151a2d13c8327f5c9c586ac6cf7cddc1658e8f53edae0ec56509c8fa516c9" diff --git a/recipes/fmt/all/conanfile.py b/recipes/fmt/all/conanfile.py index fb9118c45657f..86da321d03862 100644 --- a/recipes/fmt/all/conanfile.py +++ b/recipes/fmt/all/conanfile.py @@ -6,17 +6,18 @@ from conan.tools.layout import basic_layout from conan.tools.build import check_min_cppstd from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc required_conan_version = ">=1.53.0" class FmtConan(ConanFile): name = "fmt" - homepage = "https://github.com/fmtlib/fmt" description = "A safe and fast alternative to printf and IOStreams." - topics = ("format", "iostream", "printf") - url = "https://github.com/conan-io/conan-center-index" license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/fmtlib/fmt" + topics = ("format", "iostream", "printf") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -25,6 +26,7 @@ class FmtConan(ConanFile): "fPIC": [True, False], "with_fmt_alias": [True, False], "with_os_api": [True, False], + "with_unicode": [True, False], } default_options = { "header_only": False, @@ -32,12 +34,17 @@ class FmtConan(ConanFile): "fPIC": True, "with_fmt_alias": False, "with_os_api": True, + "with_unicode": True, } @property def _has_with_os_api_option(self): return Version(self.version) >= "7.0.0" + @property + def _has_with_unicode_option(self): + return Version(self.version) >= "11.0.0" + def export_sources(self): export_conandata_patches(self) @@ -48,6 +55,8 @@ def config_options(self): del self.options.with_os_api elif str(self.settings.os) == "baremetal": self.options.with_os_api = False + if not self._has_with_unicode_option: + del self.options.with_unicode def configure(self): if self.options.header_only: @@ -85,6 +94,8 @@ def generate(self): tc.cache_variables["FMT_LIB_DIR"] = "lib" if self._has_with_os_api_option: tc.cache_variables["FMT_OS"] = bool(self.options.with_os_api) + if self._has_with_unicode_option: + tc.cache_variables["FMT_UNICODE"] = bool(self.options.with_unicode) tc.generate() def build(self): @@ -115,6 +126,9 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", f"fmt::{target}") self.cpp_info.set_property("pkg_config_name", "fmt") + if self.options.get_safe("with_unicode") and is_msvc(self): + self.cpp_info.components["_fmt"].cxxflags.append("/utf-8") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed if self.options.with_fmt_alias: self.cpp_info.components["_fmt"].defines.append("FMT_STRING_ALIAS=1") @@ -123,7 +137,6 @@ def package_info(self): self.cpp_info.components["_fmt"].defines.append("FMT_HEADER_ONLY=1") self.cpp_info.components["_fmt"].libdirs = [] self.cpp_info.components["_fmt"].bindirs = [] - else: postfix = "d" if self.settings.build_type == "Debug" else "" libname = "fmt" + postfix diff --git a/recipes/fmt/all/patches/fix-install-6.0.0.patch b/recipes/fmt/all/patches/fix-install-6.0.0.patch deleted file mode 100644 index c64f2ea628b1b..0000000000000 --- a/recipes/fmt/all/patches/fix-install-6.0.0.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -259,7 +259,9 @@ if (FMT_INSTALL) - - # Install the library and headers. - install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name} -- DESTINATION ${FMT_LIB_DIR}) -+ LIBRARY DESTINATION ${FMT_LIB_DIR} -+ ARCHIVE DESTINATION ${FMT_LIB_DIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - - install(FILES $ - DESTINATION ${FMT_LIB_DIR} OPTIONAL) diff --git a/recipes/fmt/all/patches/fix-mingw-msvc2015-export-assert-fail-6.1.0.patch b/recipes/fmt/all/patches/fix-mingw-msvc2015-export-assert-fail-6.1.0.patch deleted file mode 100644 index 4623c31cff962..0000000000000 --- a/recipes/fmt/all/patches/fix-mingw-msvc2015-export-assert-fail-6.1.0.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/include/fmt/core.h -+++ b/include/fmt/core.h -@@ -167,9 +167,9 @@ - - #if !defined(FMT_HEADER_ONLY) && defined(_WIN32) - # ifdef FMT_EXPORT --# define FMT_API __pragma(warning(suppress : 4275)) __declspec(dllexport) -+# define FMT_API __declspec(dllexport) - # elif defined(FMT_SHARED) --# define FMT_API __pragma(warning(suppress : 4275)) __declspec(dllimport) -+# define FMT_API __declspec(dllimport) - # define FMT_EXTERN_TEMPLATE_API FMT_API - # endif - #endif -@@ -224,7 +224,7 @@ namespace internal { - // A workaround for gcc 4.8 to make void_t work in a SFINAE context. - template struct void_t_impl { using type = void; }; - --void assert_fail(const char* file, int line, const char* message); -+FMT_API void assert_fail(const char* file, int line, const char* message); - - #ifndef FMT_ASSERT - # ifdef NDEBUG diff --git a/recipes/fmt/all/test_package/test_package.cpp b/recipes/fmt/all/test_package/test_package.cpp index 736bcb6a40958..c8074af5f8eff 100644 --- a/recipes/fmt/all/test_package/test_package.cpp +++ b/recipes/fmt/all/test_package/test_package.cpp @@ -40,7 +40,6 @@ namespace fmt { int main() { const std::string thing("World"); fmt::print("PRINT: Hello {}!\n", thing); - fmt::printf("PRINTF: Hello, %s!\n", thing); const std::string formatted = fmt::format("{0}{1}{0}", "abra", "cad"); fmt::print("{}\n", formatted); diff --git a/recipes/fmt/config.yml b/recipes/fmt/config.yml index fdd60b40c6f86..34d172078c697 100644 --- a/recipes/fmt/config.yml +++ b/recipes/fmt/config.yml @@ -1,4 +1,8 @@ versions: + "11.0.1": + folder: all + "11.0.0": + folder: all "10.2.1": folder: all "10.2.0": diff --git a/recipes/fontconfig/all/conandata.yml b/recipes/fontconfig/all/conandata.yml deleted file mode 100644 index d4f92f5455a44..0000000000000 --- a/recipes/fontconfig/all/conandata.yml +++ /dev/null @@ -1,7 +0,0 @@ -sources: - "2.13.92": - url: "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.92.tar.gz" - sha256: "3406a05b83a42231e3df68d02bc0a0cf47b3f2e8f11c8ede62267daf5f130016" - "2.13.91": - url: "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.91.tar.gz" - sha256: "19e5b1bc9d013a52063a44e1307629711f0bfef35b9aca16f9c793971e2eb1e5" diff --git a/recipes/fontconfig/all/conanfile.py b/recipes/fontconfig/all/conanfile.py deleted file mode 100644 index 543e746cf6bf8..0000000000000 --- a/recipes/fontconfig/all/conanfile.py +++ /dev/null @@ -1,150 +0,0 @@ -from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import fix_apple_shared_install_name -from conan.tools.build import cross_building -from conan.tools.env import VirtualBuildEnv, VirtualRunEnv -from conan.tools.files import copy, get, replace_in_file, rm, rmdir -from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps -from conan.tools.layout import basic_layout -from conan.tools.microsoft import is_msvc -import os - -required_conan_version = ">=1.54.0" - - -class FontconfigConan(ConanFile): - name = "fontconfig" - license = "MIT" - url = "https://github.com/conan-io/conan-center-index" - description = "Fontconfig is a library for configuring and customizing font access" - homepage = "https://gitlab.freedesktop.org/fontconfig/fontconfig" - topics = ("fonts", "freedesktop") - settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - } - default_options = { - "shared": False, - "fPIC": True, - } - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - self.settings.rm_safe("compiler.cppstd") - self.settings.rm_safe("compiler.libcxx") - - def layout(self): - basic_layout(self, src_folder="src") - - def requirements(self): - self.requires("freetype/2.13.2") - self.requires("expat/2.6.0") - if self.settings.os == "Linux": - self.requires("util-linux-libuuid/2.39.2") - - def validate(self): - if is_msvc(self): - raise ConanInvalidConfiguration("fontconfig does not support Visual Studio for versions < 2.13.93.") - - def build_requirements(self): - self.tool_requires("gperf/3.1") - if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") - if self._settings_build.os == "Windows": - self.win_bash = True - if not self.conf.get("tools.microsoft.bash:path", check_type=str): - self.tool_requires("msys2/cci.latest") - - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) - - def generate(self): - env = VirtualBuildEnv(self) - env.generate() - if not cross_building(self): - env = VirtualRunEnv(self) - env.generate(scope="build") - - tc = AutotoolsToolchain(self) - yes_no = lambda v: "yes" if v else "no" - tc.configure_args.extend([ - f"--enable-shared={yes_no(self.options.shared)}", - f"--enable-static={yes_no(not self.options.shared)}", - "--disable-docs", - "--disable-nls", - "--sysconfdir=${prefix}/bin/etc", - "--datadir=${prefix}/bin/share", - "--datarootdir=${prefix}/bin/share", - "--localstatedir=${prefix}/bin/var", - ]) - tc.generate() - - deps = AutotoolsDeps(self) - deps.generate() - deps = PkgConfigDeps(self) - deps.generate() - - def _patch_files(self): - # fontconfig requires libtool version number, change it for the corresponding freetype one - replace_in_file( - self, os.path.join(self.generators_folder, "freetype2.pc"), - "Version: {}".format(self.dependencies["freetype"].ref.version), - "Version: {}".format(self.dependencies["freetype"].conf_info.get("user.freetype:libtool_version")), - ) - # disable fc-cache test to enable cross compilation but also builds with shared libraries on MacOS - replace_in_file(self, - os.path.join(self.source_folder, "Makefile.in"), - "@CROSS_COMPILING_TRUE@RUN_FC_CACHE_TEST = false", - "RUN_FC_CACHE_TEST=false" - ) - - def build(self): - self._patch_files() - autotools = Autotools(self) - autotools.configure() - replace_in_file(self, os.path.join(self.build_folder, "Makefile"), "po-conf test", "po-conf") - autotools.make() - - def package(self): - copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - autotools = Autotools(self) - autotools.install() - rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - rm(self, "*.conf", os.path.join(self.package_folder, "bin", "etc", "fonts", "conf.d")) - rm(self, "*.def", os.path.join(self.package_folder, "lib")) - rm(self, "*.la", os.path.join(self.package_folder, "lib")) - rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - rmdir(self, os.path.join(self.package_folder, "etc")) - rmdir(self, os.path.join(self.package_folder, "share")) - fix_apple_shared_install_name(self) - - def package_info(self): - self.cpp_info.set_property("cmake_find_mode", "both") - self.cpp_info.set_property("cmake_file_name", "Fontconfig") - self.cpp_info.set_property("cmake_target_name", "Fontconfig::Fontconfig") - self.cpp_info.set_property("pkg_config_name", "fontconfig") - self.cpp_info.libs = ["fontconfig"] - if self.settings.os in ("Linux", "FreeBSD"): - self.cpp_info.system_libs.extend(["m", "pthread"]) - - fontconfig_file = os.path.join(self.package_folder, "bin", "etc", "fonts", "fonts.conf") - self.runenv_info.prepend_path("FONTCONFIG_FILE", fontconfig_file) - - fontconfig_path = os.path.join(self.package_folder, "bin", "etc", "fonts") - self.runenv_info.prepend_path("FONTCONFIG_PATH", fontconfig_path) - - # TODO: to remove in conan v2 - self.cpp_info.names["cmake_find_package"] = "Fontconfig" - self.cpp_info.names["cmake_find_package_multi"] = "Fontconfig" - self.env_info.FONTCONFIG_FILE = fontconfig_file - self.env_info.FONTCONFIG_PATH = fontconfig_path diff --git a/recipes/fontconfig/all/test_package/CMakeLists.txt b/recipes/fontconfig/all/test_package/CMakeLists.txt deleted file mode 100644 index 5def13d67bcff..0000000000000 --- a/recipes/fontconfig/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(test_package LANGUAGES C) - -find_package(Fontconfig REQUIRED) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE Fontconfig::Fontconfig) -target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/fontconfig/all/test_package/conanfile.py b/recipes/fontconfig/all/test_package/conanfile.py deleted file mode 100644 index 98ab55852ad56..0000000000000 --- a/recipes/fontconfig/all/test_package/conanfile.py +++ /dev/null @@ -1,26 +0,0 @@ -from conan import ConanFile -from conan.tools.build import can_run -from conan.tools.cmake import CMake, cmake_layout -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" - test_type = "explicit" - - def layout(self): - cmake_layout(self) - - def requirements(self): - self.requires(self.tested_reference_str) - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(bin_path, env="conanrun") diff --git a/recipes/fontconfig/all/test_package/test_package.c b/recipes/fontconfig/all/test_package/test_package.c deleted file mode 100644 index 3d2556b9cca2e..0000000000000 --- a/recipes/fontconfig/all/test_package/test_package.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() { - FcInit(); - return 0; -} diff --git a/recipes/fontconfig/all/test_v1_package/CMakeLists.txt b/recipes/fontconfig/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/fontconfig/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/fontconfig/all/test_v1_package/conanfile.py b/recipes/fontconfig/all/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/fontconfig/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/fontconfig/config.yml b/recipes/fontconfig/config.yml index 41c4db45e111e..dafaaf15309ac 100644 --- a/recipes/fontconfig/config.yml +++ b/recipes/fontconfig/config.yml @@ -5,7 +5,3 @@ versions: folder: meson "2.13.93": folder: meson - "2.13.92": - folder: all - "2.13.91": - folder: all diff --git a/recipes/fontconfig/meson/conanfile.py b/recipes/fontconfig/meson/conanfile.py index 95e3579f0f549..7e8180d100b57 100644 --- a/recipes/fontconfig/meson/conanfile.py +++ b/recipes/fontconfig/meson/conanfile.py @@ -3,16 +3,15 @@ from conan.tools.env import VirtualBuildEnv from conan.tools.files import ( apply_conandata_patches, copy, export_conandata_patches, get, - replace_in_file, rm, rmdir + rm, rmdir ) from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain -from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class FontconfigConan(ConanFile): @@ -50,15 +49,15 @@ def layout(self): def requirements(self): self.requires("freetype/2.13.2") - self.requires("expat/2.6.0") + self.requires("expat/[>=2.6.2 <3]") if self.settings.os == "Linux": self.requires("util-linux-libuuid/2.39.2") def build_requirements(self): self.tool_requires("gperf/3.1") - self.tool_requires("meson/1.2.3") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -75,15 +74,14 @@ def generate(self): "doc": "disabled", "nls": "disabled", "tests": "disabled", - "tools": "disabled" + "tools": "disabled", + "sysconfdir": os.path.join("res", "etc"), + "datadir": os.path.join("res", "share"), }) tc.generate() def _patch_files(self): apply_conandata_patches(self) - replace_in_file(self, os.path.join(self.source_folder, "meson.build"), - "freetype_req = '>= 21.0.15'", - f"freetype_req = '{Version(self.dependencies['freetype'].ref.version)}'") def build(self): self._patch_files() @@ -96,11 +94,9 @@ def package(self): meson = Meson(self) meson.install() rm(self, "*.pdb", self.package_folder, recursive=True) - rm(self, "*.conf", os.path.join(self.package_folder, "bin", "etc", "fonts", "conf.d")) + rm(self, "*.conf", os.path.join(self.package_folder, "res", "etc", "fonts", "conf.d")) rm(self, "*.def", os.path.join(self.package_folder, "lib")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - rmdir(self, os.path.join(self.package_folder, "etc")) - rmdir(self, os.path.join(self.package_folder, "share")) fix_apple_shared_install_name(self) fix_msvc_libname(self) @@ -113,16 +109,12 @@ def package_info(self): if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.system_libs.extend(["m", "pthread"]) - fontconfig_file = os.path.join(self.package_folder, "bin", "etc", "fonts", "fonts.conf") - self.runenv_info.prepend_path("FONTCONFIG_FILE", fontconfig_file) - - fontconfig_path = os.path.join(self.package_folder, "bin", "etc", "fonts") - self.runenv_info.prepend_path("FONTCONFIG_PATH", fontconfig_path) + fontconfig_path = os.path.join(self.package_folder, "res", "etc", "fonts") + self.runenv_info.append_path("FONTCONFIG_PATH", fontconfig_path) # TODO: to remove in conan v2 self.cpp_info.names["cmake_find_package"] = "Fontconfig" self.cpp_info.names["cmake_find_package_multi"] = "Fontconfig" - self.env_info.FONTCONFIG_FILE = fontconfig_file self.env_info.FONTCONFIG_PATH = fontconfig_path def fix_msvc_libname(conanfile, remove_lib_prefix=True): diff --git a/recipes/foxglove-schemas-protobuf/all/conanfile.py b/recipes/foxglove-schemas-protobuf/all/conanfile.py index 5a5291f2d6ec4..c4e016879327e 100644 --- a/recipes/foxglove-schemas-protobuf/all/conanfile.py +++ b/recipes/foxglove-schemas-protobuf/all/conanfile.py @@ -8,7 +8,7 @@ import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.60.0" class FoxgloveSchemasProtobufConan(ConanFile): @@ -64,11 +64,11 @@ def validate(self): 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) + self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True) + + def build_requirements(self): + self.tool_requires("protobuf/") def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/freeglut/all/conanfile.py b/recipes/freeglut/all/conanfile.py index 9b7f21448c416..dc8ac66bf9e42 100644 --- a/recipes/freeglut/all/conanfile.py +++ b/recipes/freeglut/all/conanfile.py @@ -85,8 +85,6 @@ def configure(self): self.options["libglvnd"].gles2 = True if self._requires_libglvnd_glx: self.options["libglvnd"].glx = True - if self.options.get_safe("with_wayland"): - self.options["xkbcommon"].with_wayland = True def layout(self): cmake_layout(self, src_folder="src") @@ -126,8 +124,6 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} requires the gles2 option of libglvnd to be enabled when the gles option is enabled") if self._requires_libglvnd_glx and not self.dependencies["libglvnd"].options.glx: raise ConanInvalidConfiguration(f"{self.ref} requires the glx option of libglvnd to be enabled when the gles option is disabled") - if self.options.get_safe("with_wayland") and not self.dependencies["xkbcommon"].options.with_wayland: - raise ConanInvalidConfiguration(f"{self.ref} requires the with_wayland option of xkbcommon to be enabled when the with_wayland option is enabled") def source(self): diff --git a/recipes/freeglut/all/test_package/conanfile.py b/recipes/freeglut/all/test_package/conanfile.py index 6e146f0e38642..0a6bc68712d90 100644 --- a/recipes/freeglut/all/test_package/conanfile.py +++ b/recipes/freeglut/all/test_package/conanfile.py @@ -14,7 +14,6 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("opengl/system") def build(self): cmake = CMake(self) diff --git a/recipes/freeglut/all/test_package_module/conanfile.py b/recipes/freeglut/all/test_package_module/conanfile.py index 6e146f0e38642..0a6bc68712d90 100644 --- a/recipes/freeglut/all/test_package_module/conanfile.py +++ b/recipes/freeglut/all/test_package_module/conanfile.py @@ -14,7 +14,6 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("opengl/system") def build(self): cmake = CMake(self) diff --git a/recipes/freeimage/all/test_package/conanfile.py b/recipes/freeimage/all/test_package/conanfile.py index 9f97d7f9f47a9..0a6bc68712d90 100644 --- a/recipes/freeimage/all/test_package/conanfile.py +++ b/recipes/freeimage/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - bees = os.path.join(self.source_folder, "test.png") - self.run(f"{bin_path} {bees}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/freeimage/all/test_package/test.png b/recipes/freeimage/all/test_package/test.png deleted file mode 100644 index 11640c7488fb1..0000000000000 Binary files a/recipes/freeimage/all/test_package/test.png and /dev/null differ diff --git a/recipes/freeimage/all/test_package/test_package.cpp b/recipes/freeimage/all/test_package/test_package.cpp index 0adc1a0375b01..b2164b2ffb68d 100644 --- a/recipes/freeimage/all/test_package/test_package.cpp +++ b/recipes/freeimage/all/test_package/test_package.cpp @@ -11,39 +11,14 @@ void FreeImageErrorHandler(FREE_IMAGE_FORMAT fif, const char* message) std::cerr << "FreeImage error: " << message << std::endl; } -int main(int argc, char** argv ) -{ - if (argc < 2) { - std::cerr << "Need at least one argument" << std::endl; - return 1; - } +int main(int argc, char** argv ) { #if NEED_INIT FreeImage_Initialise(); #endif FreeImage_SetOutputMessage(FreeImageErrorHandler); - - std::cout << "FreeImage " << FreeImage_GetVersion() << ", with:" << std::endl; - - for (int i = 0; i < FreeImage_GetFIFCount(); ++i) - { - std::cout << "\t- " << FreeImage_GetFIFExtensionList((FREE_IMAGE_FORMAT)i) << std::endl; - } - - const char * image_file = argv[1]; - FREE_IMAGE_FORMAT fif = FIF_UNKNOWN; - fif = FreeImage_GetFileType(image_file, 0); - if (fif == FIF_UNKNOWN) { - fif = FreeImage_GetFIFFromFilename(image_file); - } - if ((fif != FIF_UNKNOWN) && FreeImage_FIFSupportsReading(fif)) { - FIBITMAP* dib = FreeImage_Load(fif, image_file, 0); - if (dib) - { - FreeImage_Unload(dib); - } - } + std::cout << "FreeImage " << FreeImage_GetVersion() << std::endl; #if NEED_INIT FreeImage_DeInitialise(); diff --git a/recipes/freeimage/all/test_v1_package/conanfile.py b/recipes/freeimage/all/test_v1_package/conanfile.py index 6895afd01c85c..38f4483872d47 100644 --- a/recipes/freeimage/all/test_v1_package/conanfile.py +++ b/recipes/freeimage/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - bees = os.path.join(self.source_folder, os.pardir, "test_package", "test.png") - self.run(f"{bin_path} {bees}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/freetype/all/conandata.yml b/recipes/freetype/all/conandata.yml index 8e6b6b6c5bfe8..ffe78e299e4fb 100644 --- a/recipes/freetype/all/conandata.yml +++ b/recipes/freetype/all/conandata.yml @@ -1,14 +1,4 @@ sources: - "2.13.2": - url: - - "https://download.savannah.gnu.org/releases/freetype/freetype-2.13.2.tar.xz" - - "https://sourceforge.net/projects/freetype/files/freetype2/2.13.2/freetype-2.13.2.tar.xz" - sha256: "12991c4e55c506dd7f9b765933e62fd2be2e06d421505d7950a132e4f1bb484d" - "2.13.0": - url: - - "https://download.savannah.gnu.org/releases/freetype/freetype-2.13.0.tar.xz" - - "https://sourceforge.net/projects/freetype/files/freetype2/2.13.0/freetype-2.13.0.tar.xz" - sha256: "5ee23abd047636c24b2d43c6625dcafc66661d1aca64dec9e0d05df29592624c" "2.12.1": url: - "https://download.savannah.gnu.org/releases/freetype/freetype-2.12.1.tar.xz" @@ -24,8 +14,3 @@ sources: - "https://download.savannah.gnu.org/releases/freetype/freetype-2.10.4.tar.xz" - "https://sourceforge.net/projects/freetype/files/freetype2/2.10.4/freetype-2.10.4.tar.xz" sha256: "86a854d8905b19698bbc8f23b860bc104246ce4854dcea8e3b0fb21284f75784" -patches: - "2.13.0": - - patch_file: "patches/2.13.0-0001-fix-fallthrough.patch" - patch_description: "Fix FALL_THROUGH macro for clang 10 & 11" - patch_type: "portability" diff --git a/recipes/freetype/all/conanfile.py b/recipes/freetype/all/conanfile.py index 5543e9e0a5962..30f77de96b06e 100644 --- a/recipes/freetype/all/conanfile.py +++ b/recipes/freetype/all/conanfile.py @@ -40,18 +40,12 @@ class FreetypeConan(ConanFile): "subpixel": False, } - @property - def _has_with_brotli_option(self): - return Version(self.version) >= "2.10.2" - def export_sources(self): export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if not self._has_with_brotli_option: - del self.options.with_brotli def configure(self): if self.options.shared: @@ -69,7 +63,7 @@ def requirements(self): self.requires("zlib/[>=1.2.10 <2]") if self.options.with_bzip2: self.requires("bzip2/1.0.8") - if self.options.get_safe("with_brotli"): + if self.options.with_brotli: self.requires("brotli/1.1.0") def source(self): @@ -90,17 +84,15 @@ def generate(self): # TODO: Harfbuzz can be added as an option as soon as it is available. tc.variables["FT_REQUIRE_HARFBUZZ"] = False tc.variables["FT_DISABLE_HARFBUZZ"] = True - if self._has_with_brotli_option: - tc.variables["FT_REQUIRE_BROTLI"] = self.options.with_brotli - tc.variables["FT_DISABLE_BROTLI"] = not self.options.with_brotli + tc.variables["FT_REQUIRE_BROTLI"] = self.options.with_brotli + tc.variables["FT_DISABLE_BROTLI"] = not self.options.with_brotli else: tc.variables["FT_WITH_ZLIB"] = self.options.with_zlib tc.variables["FT_WITH_PNG"] = self.options.with_png tc.variables["FT_WITH_BZIP2"] = self.options.with_bzip2 # TODO: Harfbuzz can be added as an option as soon as it is available. tc.variables["FT_WITH_HARFBUZZ"] = False - if self._has_with_brotli_option: - tc.variables["FT_WITH_BROTLI"] = self.options.with_brotli + tc.variables["FT_WITH_BROTLI"] = self.options.with_brotli # Generate a relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" tc.generate() @@ -109,9 +101,8 @@ def _patch_sources(self): apply_conandata_patches(self) # Do not accidentally enable dependencies we have disabled cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - find_harfbuzz = "find_package(HarfBuzz {})".format("1.3.0" if Version(self.version) < "2.10.2" else "${HARFBUZZ_MIN_VERSION}") if_harfbuzz_found = "if ({})".format("HARFBUZZ_FOUND" if Version(self.version) < "2.11.0" else "HarfBuzz_FOUND") - replace_in_file(self, cmakelists, find_harfbuzz, "") + replace_in_file(self, cmakelists, "find_package(HarfBuzz ${HARFBUZZ_MIN_VERSION})", "") replace_in_file(self, cmakelists, if_harfbuzz_found, "if(0)") if not self.options.with_png: replace_in_file(self, cmakelists, "find_package(PNG)", "") @@ -122,16 +113,15 @@ def _patch_sources(self): if not self.options.with_bzip2: replace_in_file(self, cmakelists, "find_package(BZip2)", "") replace_in_file(self, cmakelists, "if (BZIP2_FOUND)", "if(0)") - if self._has_with_brotli_option: - # the custom FindBrotliDec of upstream is too fragile - replace_in_file(self, cmakelists, - "find_package(BrotliDec REQUIRED)", - "find_package(Brotli REQUIRED)\n" - "set(BROTLIDEC_FOUND 1)\n" - "set(BROTLIDEC_LIBRARIES \"brotli::brotli\")") - if not self.options.with_brotli: - replace_in_file(self, cmakelists, "find_package(BrotliDec)", "") - replace_in_file(self, cmakelists, "if (BROTLIDEC_FOUND)", "if(0)") + # the custom FindBrotliDec of upstream is too fragile + replace_in_file(self, cmakelists, + "find_package(BrotliDec REQUIRED)", + "find_package(Brotli REQUIRED)\n" + "set(BROTLIDEC_FOUND 1)\n" + "set(BROTLIDEC_LIBRARIES \"brotli::brotli\")") + if not self.options.with_brotli: + replace_in_file(self, cmakelists, "find_package(BrotliDec)", "") + replace_in_file(self, cmakelists, "if (BROTLIDEC_FOUND)", "if(0)") config_h = os.path.join(self.source_folder, "include", "freetype", "config", "ftoption.h") if self.options.subpixel: @@ -254,10 +244,10 @@ def package_info(self): libtool_version = load(self, self._libtool_version_txt).strip() self.conf_info.define("user.freetype:libtool_version", libtool_version) - # FIXME: need to do override the pkg_config version (pkg_config_custom_content does not work) - # self.cpp_info.version["pkg_config"] = pkg_config_version + self.cpp_info.set_property("system_package_version", libtool_version) # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.set_property("component_version", libtool_version) self.cpp_info.filenames["cmake_find_package"] = "Freetype" self.cpp_info.filenames["cmake_find_package_multi"] = "freetype" self.cpp_info.names["cmake_find_package"] = "Freetype" diff --git a/recipes/freetype/all/patches/2.13.0-0001-fix-fallthrough.patch b/recipes/freetype/all/patches/2.13.0-0001-fix-fallthrough.patch deleted file mode 100644 index 0386998dea7bb..0000000000000 --- a/recipes/freetype/all/patches/2.13.0-0001-fix-fallthrough.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/include/freetype/internal/compiler-macros.h -+++ b/include/freetype/internal/compiler-macros.h -@@ -42,8 +42,8 @@ FT_BEGIN_HEADER - ( defined( __cplusplus ) && __cplusplus > 201402L ) - # define FALL_THROUGH [[__fallthrough__]] - # elif ( defined( __GNUC__ ) && __GNUC__ >= 7 ) || \ -- ( defined( __clang__ ) && __clang_major__ >= 10 ) --# define FALL_THROUGH __attribute__(( __fallthrough__ )) -+ ( defined( __clang__ ) && __clang_major__ >= 12 ) -+# define FALL_THROUGH __attribute__((fallthrough)) - # else - # define FALL_THROUGH ( (void)0 ) - # endif diff --git a/recipes/freetype/all/test_package/OpenSans-Bold.ttf b/recipes/freetype/all/test_package/OpenSans-Bold.ttf index fd79d43bea029..1588c2ced3a6c 100644 Binary files a/recipes/freetype/all/test_package/OpenSans-Bold.ttf and b/recipes/freetype/all/test_package/OpenSans-Bold.ttf differ diff --git a/recipes/freetype/all/test_package/conanfile.py b/recipes/freetype/all/test_package/conanfile.py index 5da019d033eb1..7c01d32f07d5a 100644 --- a/recipes/freetype/all/test_package/conanfile.py +++ b/recipes/freetype/all/test_package/conanfile.py @@ -8,6 +8,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" + license = "OFL-1.1-no-RFN" def layout(self): cmake_layout(self) diff --git a/recipes/freetype/all/test_package_module/conanfile.py b/recipes/freetype/all/test_package_module/conanfile.py index e789c017730b3..c01bc5d128062 100644 --- a/recipes/freetype/all/test_package_module/conanfile.py +++ b/recipes/freetype/all/test_package_module/conanfile.py @@ -8,6 +8,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" + license = "OFL-1.1-no-RFN" def layout(self): cmake_layout(self) diff --git a/recipes/freetype/all/test_v1_package/conanfile.py b/recipes/freetype/all/test_v1_package/conanfile.py index da2d908b1d4a7..fba25cb7ecbbc 100644 --- a/recipes/freetype/all/test_v1_package/conanfile.py +++ b/recipes/freetype/all/test_v1_package/conanfile.py @@ -5,6 +5,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package_multi" + license = "OFL-1.1-no-RFN" def build(self): cmake = CMake(self) diff --git a/recipes/freetype/all/test_v1_package_module/conanfile.py b/recipes/freetype/all/test_v1_package_module/conanfile.py index 7834358365541..1ddffa6741246 100644 --- a/recipes/freetype/all/test_v1_package_module/conanfile.py +++ b/recipes/freetype/all/test_v1_package_module/conanfile.py @@ -5,6 +5,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package" + license = "OFL-1.1-no-RFN" def build(self): cmake = CMake(self) diff --git a/recipes/freetype/config.yml b/recipes/freetype/config.yml index a1ef7bebb603a..6b0e065841f8b 100644 --- a/recipes/freetype/config.yml +++ b/recipes/freetype/config.yml @@ -1,8 +1,8 @@ versions: "2.13.2": - folder: all + folder: meson "2.13.0": - folder: all + folder: meson "2.12.1": folder: all "2.11.1": diff --git a/recipes/freetype/meson/conandata.yml b/recipes/freetype/meson/conandata.yml new file mode 100644 index 0000000000000..21126b5af9cd8 --- /dev/null +++ b/recipes/freetype/meson/conandata.yml @@ -0,0 +1,22 @@ +sources: + "2.13.2": + url: + - "https://download.savannah.gnu.org/releases/freetype/freetype-2.13.2.tar.xz" + - "https://sourceforge.net/projects/freetype/files/freetype2/2.13.2/freetype-2.13.2.tar.xz" + sha256: "12991c4e55c506dd7f9b765933e62fd2be2e06d421505d7950a132e4f1bb484d" + "2.13.0": + url: + - "https://download.savannah.gnu.org/releases/freetype/freetype-2.13.0.tar.xz" + - "https://sourceforge.net/projects/freetype/files/freetype2/2.13.0/freetype-2.13.0.tar.xz" + sha256: "5ee23abd047636c24b2d43c6625dcafc66661d1aca64dec9e0d05df29592624c" +patches: + "2.13.2": + - patch_file: "patches/2.13.0-0001-meson-Use-the-standard-dependency-mechanism-to-find-.patch" + patch_description: "meson: Use the standard dependency mechanism to find bzip2" + patch_source: "https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/318" + patch_type: "portability" + "2.13.0": + - patch_file: "patches/2.13.0-0001-meson-Use-the-standard-dependency-mechanism-to-find-.patch" + patch_description: "meson: Use the standard dependency mechanism to find bzip2" + patch_source: "https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/318" + patch_type: "portability" diff --git a/recipes/freetype/meson/conanfile.py b/recipes/freetype/meson/conanfile.py new file mode 100644 index 0000000000000..470342ce2982c --- /dev/null +++ b/recipes/freetype/meson/conanfile.py @@ -0,0 +1,257 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.files import ( + apply_conandata_patches, copy, export_conandata_patches, load, + get, rename, replace_in_file, rm, rmdir, save +) +from conan.tools.env import VirtualBuildEnv +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.scm import Version +import os +import re +import shutil +import textwrap + +required_conan_version = ">=1.53.0" + + +class FreetypeConan(ConanFile): + name = "freetype" + description = "FreeType is a freely available software library to render fonts." + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.freetype.org" + license = "FTL" + topics = ("freetype", "fonts") + package_type = "library" + short_paths = True + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_png": [True, False], + "with_zlib": [True, False], + "with_bzip2": [True, False], + "with_brotli": [True, False], + "subpixel": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_png": True, + "with_zlib": True, + "with_bzip2": True, + "with_brotli": True, + "subpixel": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_png: + self.requires("libpng/[>=1.6 <2]") + if self.options.with_zlib: + self.requires("zlib/[>=1.2.10 <2]") + if self.options.with_bzip2: + self.requires("bzip2/1.0.8") + if self.options.get_safe("with_brotli"): + self.requires("brotli/1.1.0") + + def build_requirements(self): + self.tool_requires("meson/1.3.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def feature(option): + return "enabled" if option else "disabled" + + tc = MesonToolchain(self) + tc.project_options["brotli"] = feature(self.options.with_brotli) + tc.project_options["bzip2"] = feature(self.options.with_bzip2) + # Harfbuzz support introduces a circular dependency between Harfbuzz and Freetype. + # They both have options to require each other. + tc.project_options["harfbuzz"] = "disabled" + tc.project_options["png"] = feature(self.options.with_png) + tc.project_options["tests"] = "disabled" + tc.project_options["zlib"] = "system" if self.options.with_zlib else "disabled" + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + config_h = os.path.join(self.source_folder, "include", "freetype", "config", "ftoption.h") + if self.options.subpixel: + replace_in_file(self, config_h, "/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */", "#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING") + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def _make_freetype_config(self, version): + freetype_config_in = os.path.join(self.source_folder, "builds", "unix", "freetype-config.in") + if not os.path.isdir(os.path.join(self.package_folder, "bin")): + os.makedirs(os.path.join(self.package_folder, "bin")) + freetype_config = os.path.join(self.package_folder, "bin", "freetype-config") + rename(self, freetype_config_in, freetype_config) + staticlibs = "-lm -lfreetype" if self.settings.os == "Linux" else "-lfreetype" + replace_in_file(self, freetype_config, r"%PKG_CONFIG%", r"/bin/false") # never use pkg-config + replace_in_file(self, freetype_config, r"%prefix%", r"$conan_prefix") + replace_in_file(self, freetype_config, r"%exec_prefix%", r"$conan_exec_prefix") + replace_in_file(self, freetype_config, r"%includedir%", r"$conan_includedir") + replace_in_file(self, freetype_config, r"%libdir%", r"$conan_libdir") + replace_in_file(self, freetype_config, r"%ft_version%", r"$conan_ftversion") + replace_in_file(self, freetype_config, r"%LIBSSTATIC_CONFIG%", r"$conan_staticlibs") + replace_in_file(self, freetype_config, r"export LC_ALL", textwrap.dedent("""\ + export LC_ALL + BINDIR=$(dirname $0) + conan_prefix=$(dirname $BINDIR) + conan_exec_prefix=${{conan_prefix}}/bin + conan_includedir=${{conan_prefix}}/include + conan_libdir=${{conan_prefix}}/lib + conan_ftversion={version} + conan_staticlibs="{staticlibs}" + """).format(version=version, staticlibs=staticlibs)) + + def _extract_libtool_version(self): + conf_raw = load(self, os.path.join(self.source_folder, "builds", "unix", "configure.raw")) + return re.search(r"^version_info='([0-9:]+)'", conf_raw, flags=re.M).group(1).replace(":", ".") + + @property + def _libtool_version_txt(self): + return os.path.join(self.package_folder, "res", "freetype-libtool-version.txt") + + def package(self): + meson = Meson(self) + meson.install() + + # As a workaround to support versions of CMake before 3.29, rename the libfreetype.a static library to freetype.lib on Windows. + if self.settings.os == "Windows" and not self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "libfreetype.a"), os.path.join(self.package_folder, "lib", "freetype.lib")) + + ver = Version(self.version) + if self.settings.os == "Windows" and self.options.shared and ver >= "2.13.0" and ver < "2.14.0": + # Duplicate DLL name for backwards compatibility with earlier recipe revisions + # See https://github.com/conan-io/conan-center-index/issues/23768 + suffix = "d" if self.settings.build_type == "Debug" else "" + src = os.path.join(self.package_folder, "bin", "freetype-6.dll") + dst = os.path.join(self.package_folder, "bin", f"freetype{suffix}.dll") + shutil.copyfile(src, dst) + + libtool_version = self._extract_libtool_version() + + save(self, self._libtool_version_txt, libtool_version) + self._make_freetype_config(libtool_version) + + doc_folder = os.path.join(self.source_folder, "docs") + license_folder = os.path.join(self.package_folder, "licenses") + copy(self, "FTL.TXT", doc_folder, license_folder) + copy(self, "GPLv2.TXT", doc_folder, license_folder) + copy(self, "LICENSE.TXT", doc_folder, license_folder) + + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_vars_rel_path) + ) + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_target_rel_path), + {"freetype": "Freetype::Freetype"} + ) + + fix_apple_shared_install_name(self) + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent(f"""\ + set(FREETYPE_FOUND TRUE) + if(DEFINED Freetype_INCLUDE_DIRS) + set(FREETYPE_INCLUDE_DIRS ${{Freetype_INCLUDE_DIRS}}) + endif() + if(DEFINED Freetype_LIBRARIES) + set(FREETYPE_LIBRARIES ${{Freetype_LIBRARIES}}) + endif() + set(FREETYPE_VERSION_STRING "{self.version}") + """) + save(self, module_file, content) + + def _create_cmake_module_alias_targets(self, module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + save(self, module_file, content) + + @property + def _module_vars_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + @property + def _module_target_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") + + @staticmethod + def _chmod_plus_x(filename): + if os.name == "posix" and (os.stat(filename).st_mode & 0o111) != 0o111: + os.chmod(filename, os.stat(filename).st_mode | 0o111) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "Freetype") + self.cpp_info.set_property("cmake_file_name", "freetype") + self.cpp_info.set_property("cmake_target_name", "Freetype::Freetype") + self.cpp_info.set_property("cmake_target_aliases", ["freetype"]) # other possible target name in upstream config file + self.cpp_info.set_property("cmake_build_modules", [self._module_vars_rel_path]) + self.cpp_info.set_property("pkg_config_name", "freetype2") + self.cpp_info.libs = ["freetype"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.includedirs.append(os.path.join("include", "freetype2")) + + libtool_version = load(self, self._libtool_version_txt).strip() + self.conf_info.define("user.freetype:libtool_version", libtool_version) + self.cpp_info.set_property("system_package_version", libtool_version) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.set_property("component_version", libtool_version) + self.cpp_info.filenames["cmake_find_package"] = "Freetype" + self.cpp_info.filenames["cmake_find_package_multi"] = "freetype" + self.cpp_info.names["cmake_find_package"] = "Freetype" + self.cpp_info.names["cmake_find_package_multi"] = "Freetype" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_vars_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_target_rel_path] + self.cpp_info.names["pkg_config"] = "freetype2" + freetype_config = os.path.join(self.package_folder, "bin", "freetype-config") + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.FT2_CONFIG = freetype_config + self._chmod_plus_x(freetype_config) + self.user_info.LIBTOOL_VERSION = libtool_version diff --git a/recipes/freetype/meson/patches/2.13.0-0001-meson-Use-the-standard-dependency-mechanism-to-find-.patch b/recipes/freetype/meson/patches/2.13.0-0001-meson-Use-the-standard-dependency-mechanism-to-find-.patch new file mode 100644 index 0000000000000..c38db5d6a0d6c --- /dev/null +++ b/recipes/freetype/meson/patches/2.13.0-0001-meson-Use-the-standard-dependency-mechanism-to-find-.patch @@ -0,0 +1,31 @@ +From 2598fa002859d2af1c846363ff64e72d2ebde16a Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Mon, 4 Mar 2024 12:14:51 -0600 +Subject: [PATCH] meson: Use the standard dependency mechanism to find bzip2 + +This follows standard conventions in Meson by using the pkg-config file. +This change allows Conan to switch to the Meson build system. +--- + meson.build | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index f81de3e2f..c5cb8ea52 100644 +--- a/meson.build ++++ b/meson.build +@@ -316,8 +316,10 @@ else + endif + + # BZip2 support +-bzip2_dep = cc.find_library('bz2', +- required: get_option('bzip2')) ++bzip2_dep = dependency('bzip2', required: false) ++if not bzip2_dep.found() ++ bzip2_dep = cc.find_library('bz2', has_headers: ['bzlib.h'], required: get_option('bzip2')) ++endif + + if bzip2_dep.found() + ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_BZIP2'] +-- +2.44.0 + diff --git a/recipes/freetype/meson/test_package/CMakeLists.txt b/recipes/freetype/meson/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..daf57e167b0ad --- /dev/null +++ b/recipes/freetype/meson/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(freetype REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE freetype) diff --git a/recipes/freetype/meson/test_package/OpenSans-Bold.ttf b/recipes/freetype/meson/test_package/OpenSans-Bold.ttf new file mode 100644 index 0000000000000..1588c2ced3a6c Binary files /dev/null and b/recipes/freetype/meson/test_package/OpenSans-Bold.ttf differ diff --git a/recipes/freetype/meson/test_package/conanfile.py b/recipes/freetype/meson/test_package/conanfile.py new file mode 100644 index 0000000000000..c762b4d9a11e2 --- /dev/null +++ b/recipes/freetype/meson/test_package/conanfile.py @@ -0,0 +1,29 @@ +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 = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + license = "OFL-1.1-no-RFN" + short_paths = True + + 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") + font_path = os.path.join(self.source_folder, "OpenSans-Bold.ttf") + self.run(f"{bin_path} {font_path}", env="conanrun") diff --git a/recipes/freetype/meson/test_package/test_package.c b/recipes/freetype/meson/test_package/test_package.c new file mode 100644 index 0000000000000..332eeaeae1c39 --- /dev/null +++ b/recipes/freetype/meson/test_package/test_package.c @@ -0,0 +1,142 @@ +/* example1.c */ +/* */ +/* This small program shows how to print a rotated string with the */ +/* FreeType 2 library. */ + +#include "ft2build.h" +#include FT_FREETYPE_H + +#include +#include +#include +#include + + + +#define WIDTH 640 +#define HEIGHT 480 + + +/* origin is the upper left corner */ +unsigned char image[HEIGHT][WIDTH]; + + +/* Replace this function with something useful. */ + +void +draw_bitmap( FT_Bitmap* bitmap, + FT_Int x, + FT_Int y) +{ + FT_Int i, j, p, q; + FT_Int x_max = x + bitmap->width; + FT_Int y_max = y + bitmap->rows; + + + /* for simplicity, we assume that `bitmap->pixel_mode' */ + /* is `FT_PIXEL_MODE_GRAY' (i.e., not a bitmap font) */ + + for ( i = x, p = 0; i < x_max; i++, p++ ) + { + for ( j = y, q = 0; j < y_max; j++, q++ ) + { + if ( i < 0 || j < 0 || + i >= WIDTH || j >= HEIGHT ) + continue; + + image[j][i] |= bitmap->buffer[q * bitmap->width + p]; + } + } +} + + +int +main( int argc, + char** argv ) +{ + FT_Library library; + FT_Face face; + + FT_GlyphSlot slot; + FT_Matrix matrix; /* transformation matrix */ + FT_Vector pen; /* untransformed origin */ + FT_Error error; + + char* filename; + char* text; + + double angle; + int target_height; + size_t n, num_chars; + + if (argc < 2) { + fprintf(stderr, "Usage: %s FONT\n", argv[0]); + return EXIT_FAILURE; + } + + filename = argv[1]; + text = "conan-center-index"; + num_chars = strlen( text ); + angle = ( 25.0 / 360 ) * 3.14159 * 2; /* use 25 degrees */ + target_height = HEIGHT; + + error = FT_Init_FreeType( &library ); /* initialize library */ + if (error) { + exit(EXIT_FAILURE); + } + + error = FT_New_Face( library, filename, 0, &face );/* create face object */ + if (error) { + exit(EXIT_FAILURE); + } + + /* use 50pt at 100dpi */ + error = FT_Set_Char_Size( face, 50 * 64, 0, 100, 0 ); + if (error) { + exit(EXIT_FAILURE); + } + + /* cmap selection omitted; */ + /* for simplicity we assume that the font contains a Unicode cmap */ + + slot = face->glyph; + + /* set up matrix */ + matrix.xx = (FT_Fixed)( cos( angle ) * 0x10000L ); + matrix.xy = (FT_Fixed)(-sin( angle ) * 0x10000L ); + matrix.yx = (FT_Fixed)( sin( angle ) * 0x10000L ); + matrix.yy = (FT_Fixed)( cos( angle ) * 0x10000L ); + + /* the pen position in 26.6 cartesian space coordinates; */ + /* start at (300,200) relative to the upper left corner */ + pen.x = 300 * 64; + pen.y = ( target_height - 200 ) * 64; + + for ( n = 0; n < num_chars; n++ ) + { + /* set transformation */ + FT_Set_Transform( face, &matrix, &pen ); + + /* load glyph image into the slot (erase previous one) */ + error = FT_Load_Char( face, text[n], FT_LOAD_RENDER); + if (error) { + exit(EXIT_FAILURE); + } + + /* now, draw to our target surface (convert position) */ + draw_bitmap( &slot->bitmap, + slot->bitmap_left, + target_height - slot->bitmap_top ); + + /* increment pen position */ + pen.x += slot->advance.x; + pen.y += slot->advance.y; + } + + FT_Done_Face ( face ); + FT_Done_FreeType( library ); + + return EXIT_SUCCESS; +} + +/* EOF */ diff --git a/recipes/freetype/meson/test_package_module/CMakeLists.txt b/recipes/freetype/meson/test_package_module/CMakeLists.txt new file mode 100644 index 0000000000000..a6125556234ed --- /dev/null +++ b/recipes/freetype/meson/test_package_module/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(Freetype REQUIRED MODULE) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindFreetype.html +# are properly defined in conan generators +set(_custom_vars + FREETYPE_FOUND + FREETYPE_INCLUDE_DIRS + FREETYPE_LIBRARIES + FREETYPE_VERSION_STRING +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Freetype::Freetype) diff --git a/recipes/freetype/meson/test_package_module/conanfile.py b/recipes/freetype/meson/test_package_module/conanfile.py new file mode 100644 index 0000000000000..ac4c13a76a824 --- /dev/null +++ b/recipes/freetype/meson/test_package_module/conanfile.py @@ -0,0 +1,29 @@ +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", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + license = "OFL-1.1-no-RFN" + short_paths = True + + 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") + font_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") + self.run(f"{bin_path} {font_path}", env="conanrun") diff --git a/recipes/freetype/meson/test_v1_package/CMakeLists.txt b/recipes/freetype/meson/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..b21cc49efde95 --- /dev/null +++ b/recipes/freetype/meson/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/freetype/meson/test_v1_package/conanfile.py b/recipes/freetype/meson/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..fba25cb7ecbbc --- /dev/null +++ b/recipes/freetype/meson/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" + license = "OFL-1.1-no-RFN" + + 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") + font_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") + self.run(f"{bin_path} {font_path}", run_environment=True) diff --git a/recipes/freetype/meson/test_v1_package_module/CMakeLists.txt b/recipes/freetype/meson/test_v1_package_module/CMakeLists.txt new file mode 100644 index 0000000000000..8d5fc09fe6811 --- /dev/null +++ b/recipes/freetype/meson/test_v1_package_module/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_module + ${CMAKE_CURRENT_BINARY_DIR}/test_package_module) diff --git a/recipes/freetype/meson/test_v1_package_module/conanfile.py b/recipes/freetype/meson/test_v1_package_module/conanfile.py new file mode 100644 index 0000000000000..1ddffa6741246 --- /dev/null +++ b/recipes/freetype/meson/test_v1_package_module/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" + license = "OFL-1.1-no-RFN" + + 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") + font_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") + self.run(f"{bin_path} {font_path}", run_environment=True) diff --git a/recipes/freexl/all/conanfile.py b/recipes/freexl/all/conanfile.py index 6f97355b38f7c..7cbab97fd7d07 100644 --- a/recipes/freexl/all/conanfile.py +++ b/recipes/freexl/all/conanfile.py @@ -54,7 +54,7 @@ def layout(self): def requirements(self): self.requires("libiconv/1.17") if Version(self.version) >= "2.0.0": - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") self.requires("minizip/1.2.13") def build_requirements(self): diff --git a/recipes/freexl/all/test_package/conanfile.py b/recipes/freexl/all/test_package/conanfile.py index fa2bdcf79755e..0a6bc68712d90 100644 --- a/recipes/freexl/all/test_package/conanfile.py +++ b/recipes/freexl/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - xls_path = os.path.join(self.source_folder, "simple2003_21.xls") - self.run(f"{bin_path} {xls_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/freexl/all/test_package/simple2003_21.xls b/recipes/freexl/all/test_package/simple2003_21.xls deleted file mode 100644 index 20e5d1313430a..0000000000000 Binary files a/recipes/freexl/all/test_package/simple2003_21.xls and /dev/null differ diff --git a/recipes/freexl/all/test_package/test_package.c b/recipes/freexl/all/test_package/test_package.c index 8c12ee6b6e6ed..17c8e6a9e25c3 100644 --- a/recipes/freexl/all/test_package/test_package.c +++ b/recipes/freexl/all/test_package/test_package.c @@ -1,317 +1,11 @@ -#include - -#include #include -#include - -int main(int argc, char **argv) { - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return -1; - } - - const void *handle; - int ret; - unsigned int info; - const char *worksheet_name; - unsigned short active_idx; - unsigned int num_rows; - unsigned short num_columns; - FreeXL_CellValue cell_value; - - ret = freexl_open(argv[1], &handle); - if (ret != FREEXL_OK) { - fprintf(stderr, "OPEN ERROR: %d\n", ret); - return -1; - } - - ret = freexl_get_info(handle, FREEXL_CFBF_VERSION, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for CFBF version: %d\n", ret); - return -3; - } - if (info != FREEXL_UNKNOWN) { - fprintf(stderr, "Unexpected CFBF_VERSION: %d\n", info); - return -4; - } - - ret = freexl_get_info(handle, FREEXL_CFBF_SECTOR_SIZE, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for sector size: %d\n", ret); - return -5; - } - if (info != FREEXL_UNKNOWN) { - fprintf(stderr, "Unexpected CFBF_SECTOR_SIZE: %d\n", info); - return -6; - } - - ret = freexl_get_info(handle, FREEXL_CFBF_FAT_COUNT, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for fat count: %d\n", ret); - return -7; - } - if (info != 0) { - fprintf(stderr, "Unexpected CFBF_FAT_COUNT: %d\n", info); - return -8; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_VERSION, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF version: %d\n", ret); - return -9; - } - if (info != FREEXL_BIFF_VER_2) { - fprintf(stderr, "Unexpected BIFF version: %d\n", info); - return -10; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_MAX_RECSIZE, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF record size: %d\n", ret); - return -11; - } - if (info != FREEXL_UNKNOWN) { - fprintf(stderr, "Unexpected BIFF max record size: %d\n", info); - return -12; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_DATEMODE, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF date mode: %d\n", ret); - return -13; - } - if (info != FREEXL_BIFF_DATEMODE_1900) { - fprintf(stderr, "Unexpected BIFF date mode: %d\n", info); - return -14; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_PASSWORD, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF password mode: %d\n", ret); - return -15; - } - if (info != FREEXL_BIFF_PLAIN) { - fprintf(stderr, "Unexpected BIFF password mode: %d\n", info); - return -16; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_CODEPAGE, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF codepage: %d\n", ret); - return -17; - } - if (info != FREEXL_BIFF_CP1252) { - fprintf(stderr, "Unexpected BIFF codepage: %d\n", info); - return -18; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_SHEET_COUNT, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF worksheet count: %d\n", ret); - return -19; - } - if (info != 1) { - fprintf(stderr, "Unexpected BIFF worksheet count: %d\n", info); - return -20; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_FORMAT_COUNT, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF format count: %d\n", ret); - return -21; - } - if (info != 10) { - fprintf(stderr, "Unexpected BIFF format count: %d\n", info); - return -22; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_XF_COUNT, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF extended format count: %d\n", ret); - return -23; - } - if (info != 6) { - fprintf(stderr, "Unexpected BIFF extended format count: %d\n", info); - return -24; - } - - /* We only have one worksheet, zero index */ - ret = freexl_get_worksheet_name(handle, 0, &worksheet_name); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting worksheet name: %d\n", ret); - return -25; - } - if (strcmp(worksheet_name, "Worksheet") != 0) { - fprintf(stderr, "Unexpected worksheet name: %s\n", worksheet_name); - return -26; - } - - ret = freexl_select_active_worksheet(handle, 0); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error setting active worksheet: %d\n", ret); - return -27; - } - - ret = freexl_get_active_worksheet(handle, &active_idx); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting active worksheet: %d\n", ret); - return -28; - } - if (active_idx != 0) { - fprintf(stderr, "Unexpected active sheet: %d\n", info); - return -29; - } - - ret = freexl_worksheet_dimensions(handle, &num_rows, &num_columns); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting worksheet dimensions: %d\n", ret); - return -30; - } - if ((num_rows != 4) || (num_columns != 6)) { - fprintf(stderr, "Unexpected active sheet dimensions: %u x %u\n", - num_rows, num_columns); - return -31; - } - - ret = freexl_get_cell_value(handle, 0, 0, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (0,0): %d\n", ret); - return -32; - } - if (cell_value.type != FREEXL_CELL_TEXT) { - fprintf(stderr, "Unexpected cell (0,0) type: %u\n", cell_value.type); - return -33; - } - if (strcmp(cell_value.value.text_value, "Column 1") != 0) { - fprintf(stderr, "Unexpected cell (0,0) value: %s\n", cell_value.value.text_value); - return -34; - } - - ret = freexl_get_cell_value(handle, 3, 0, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (3,0): %d\n", ret); - return -35; - } - if (cell_value.type != FREEXL_CELL_DOUBLE) { - fprintf(stderr, "Unexpected cell (3,0) type: %u\n", cell_value.type); - return -36; - } - if (cell_value.value.double_value != 3.14) { - fprintf(stderr, "Unexpected cell (3,0) value: %g\n", cell_value.value.double_value); - return -37; - } - - ret = freexl_get_cell_value(handle, 3, 1, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (3,1): %d\n", ret); - return -38; - } - if (cell_value.type != FREEXL_CELL_DOUBLE) { - fprintf(stderr, "Unexpected cell (3,1) type: %u\n", cell_value.type); - return -39; - } - if (cell_value.value.double_value != -56.3089) { - fprintf(stderr, "Unexpected cell (3,1) value: %g\n", cell_value.value.double_value); - return -40; - } - - ret = freexl_get_cell_value(handle, 3, 2, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (3,2): %d\n", ret); - return -41; - } - if (cell_value.type != FREEXL_CELL_DOUBLE) { - fprintf(stderr, "Unexpected cell (3,2) type: %u\n", cell_value.type); - return -42; - } - if (cell_value.value.double_value != 0.67) { - fprintf(stderr, "Unexpected cell (3,2) value: %g\n", cell_value.value.double_value); - return -43; - } - - ret = freexl_get_cell_value(handle, 3, 3, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (3,3): %d\n", ret); - return -44; - } - if (cell_value.type != FREEXL_CELL_DATE) { - fprintf(stderr, "Unexpected cell (3,3) type: %u\n", cell_value.type); - return -45; - } - if (strcmp(cell_value.value.text_value, "1967-10-01") != 0) { - fprintf(stderr, "Unexpected cell (3,3) value: %s\n", cell_value.value.text_value); - return -46; - } - - ret = freexl_get_cell_value(handle, 3, 4, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (3,4): %d\n", ret); - return -47; - } - if (cell_value.type != FREEXL_CELL_INT) { - fprintf(stderr, "Unexpected cell (3,4) type: %u\n", cell_value.type); - return -48; - } - if (cell_value.value.int_value != 4) { - fprintf(stderr, "Unexpected cell (3,4) value: %d\n", cell_value.value.int_value); - return -49; - } - - ret = freexl_get_cell_value(handle, 3, 5, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (3,5): %d\n", ret); - return -50; - } - if (cell_value.type != FREEXL_CELL_INT) { - fprintf(stderr, "Unexpected cell (3,5) type: %u\n", cell_value.type); - return -51; - } - if (cell_value.value.int_value != 237) { - fprintf(stderr, "Unexpected cell (3,5) value: %d\n", cell_value.value.int_value); - return -52; - } - - ret = freexl_get_cell_value(handle, 1, 5, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (1,5): %d\n", ret); - return -53; - } - if (cell_value.type != FREEXL_CELL_TIME) { - fprintf(stderr, "Unexpected cell (1,5) type: %u\n", cell_value.type); - return -54; - } - if (strcmp(cell_value.value.text_value, "23:34:04") != 0) { - fprintf(stderr, "Unexpected cell (1,5) value: %s\n", cell_value.value.text_value); - return -55; - } +#include "freexl.h" - /* error cases */ - ret = freexl_get_cell_value(handle, 7, 3, &cell_value); - if (ret != FREEXL_ILLEGAL_CELL_ROW_COL) { - fprintf(stderr, "Unexpected result for (7,3): %d\n", ret); - return -56; - } - ret = freexl_get_cell_value(handle, 2, 99, &cell_value); - if (ret != FREEXL_ILLEGAL_CELL_ROW_COL) { - fprintf(stderr, "Unexpected result for (2,99): %d\n", ret); - return -57; - } - ret = freexl_get_cell_value(handle, 4, 2, &cell_value); - if (ret != FREEXL_ILLEGAL_CELL_ROW_COL) { - fprintf(stderr, "Unexpected result for (4,2): %d\n", ret); - return -58; - } - ret = freexl_get_cell_value(handle, 3, 6, &cell_value); - if (ret != FREEXL_ILLEGAL_CELL_ROW_COL) { - fprintf(stderr, "Unexpected result for (3,6): %d\n", ret); - return -59; - } - ret = freexl_close(handle); - if (ret != FREEXL_OK) { - fprintf(stderr, "CLOSE ERROR: %d\n", ret); - return -2; - } +int main() { + const void *handle; + int ret; + ret = freexl_open("", &handle); + freexl_close(handle); - return 0; } diff --git a/recipes/freexl/all/test_v1_package/conanfile.py b/recipes/freexl/all/test_v1_package/conanfile.py index 305903625c5ac..38f4483872d47 100644 --- a/recipes/freexl/all/test_v1_package/conanfile.py +++ b/recipes/freexl/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - xls_path = os.path.join(self.source_folder, os.pardir, "test_package", "simple2003_21.xls") - self.run(f"{bin_path} {xls_path}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/frugally-deep/all/conandata.yml b/recipes/frugally-deep/all/conandata.yml index e666368bd2a72..8e2ab1f676fe6 100644 --- a/recipes/frugally-deep/all/conandata.yml +++ b/recipes/frugally-deep/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.16.0": + url: "https://github.com/Dobiasd/frugally-deep/archive/v0.16.0.tar.gz" + sha256: "5ffe8dddb43a645094b2ca1d48e4ee78e685fbef3c89f08cea8425a39dad9865" "0.15.31": url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.31.tar.gz" sha256: "49bf5e30ad2d33e464433afbc8b6fe8536fc959474004a1ce2ac03d7c54bc8ba" @@ -8,24 +11,3 @@ sources: "0.15.29": url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.29.tar.gz" sha256: "032cd525d4a7b9b3ebe28fd5e3984ac3e569da496f65d52c81030aabd9d0c52e" - "0.15.25-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.25-p0.tar.gz" - sha256: "d1204bc13ace603e97696aa7a1331d6af819c3a9b4952b4fd1e3d72dd8f524c3" - "0.15.24-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.24-p0.tar.gz" - sha256: "118b0219a3f17c6d5a3535874acb145ee2079fd309e1fb83884facc684810baf" - "0.15.19-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.19-p0.tar.gz" - sha256: "acaba428ae19ef8d57a53b3767373cd96770c190dd57909e52d2759be89ac942" - "0.15.18-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.18-p0.tar.gz" - sha256: "b721bd7b2fa842a1a10f00008e079c057fab7a5cfc4c394d64238ee59ad7e189" - "0.15.16-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.16-p0.tar.gz" - sha256: "778b8cf0da847239a2ad21c611331b231831c6c175154c68ca30dd87489336a5" - "0.15.13-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.13-p0.tar.gz" - sha256: "ca18c7b8dc0df3a36dba3c2578df35592e61ff51e5bbaa1c1ed3e6c529e14075" - "0.15.1-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.1-p0.tar.gz" - sha256: "ab15cb540a8ddeffa56cd8235bfdf709f5d6b3b2543d9ec83658c5d9bad02f18" diff --git a/recipes/frugally-deep/all/conanfile.py b/recipes/frugally-deep/all/conanfile.py index 5fb9992a315dc..f2070b97639e6 100644 --- a/recipes/frugally-deep/all/conanfile.py +++ b/recipes/frugally-deep/all/conanfile.py @@ -39,7 +39,7 @@ def layout(self): def requirements(self): self.requires("eigen/3.4.0") - self.requires("functionalplus/0.2.23") + self.requires("functionalplus/0.2.24") self.requires("nlohmann_json/3.11.3") def package_id(self): diff --git a/recipes/frugally-deep/config.yml b/recipes/frugally-deep/config.yml index ef73eeeb31a1b..4b946ca53d49d 100644 --- a/recipes/frugally-deep/config.yml +++ b/recipes/frugally-deep/config.yml @@ -1,21 +1,9 @@ versions: + "0.16.0": + folder: all "0.15.31": folder: all "0.15.30": folder: all "0.15.29": folder: all - "0.15.25-p0": - folder: all - "0.15.24-p0": - folder: all - "0.15.19-p0": - folder: all - "0.15.18-p0": - folder: all - "0.15.16-p0": - folder: all - "0.15.13-p0": - folder: all - "0.15.1-p0": - folder: all diff --git a/recipes/functionalplus/all/conandata.yml b/recipes/functionalplus/all/conandata.yml index a99f4612ba4db..995124a2aca90 100644 --- a/recipes/functionalplus/all/conandata.yml +++ b/recipes/functionalplus/all/conandata.yml @@ -1,28 +1,10 @@ sources: + "0.2.24": + url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.24.tar.gz" + sha256: "446c63ac3f2045e7587f694501882a3d7c7b962b70bcc08deacf5777bdaaff8c" "0.2.23": url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.23.tar.gz" sha256: "5c2d28d2ba7d0cdeab9e31bbf2e7f8a9d6f2ff6111a54bfc11d1b05422096f19" "0.2.22": url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.22.tar.gz" sha256: "79378668dff6ffa8abc1abde2c2fe37dc6fe1ac040c55d5ee7886924fa6a1376" - "0.2.20-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.20-p0.tar.gz" - sha256: "6a8e56bd7976b7d5a6a31001f36bc199c2997f1144994fa0b48a1a5b8497abbc" - "0.2.18-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.18-p0.tar.gz" - sha256: "ffc63fc86f89a205accafa85c35790eda307adf5f1d6d51bb7ceb5c5e21e013b" - "0.2.17-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.17-p0.tar.gz" - sha256: "c41514b24a81ad47a8f98b3ef3a3bd3fe8109085f7965e9678386b08721e3620" - "0.2.16": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.16-p0.tar.gz" - sha256: "6026e64260afbd6941aaf19559d6e5dc51cbb3e045ef8d8e158d96bcd8651ed6" - "0.2.15": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.15-p0.tar.gz" - sha256: "4c76104ec8f6da5e66ed768380bdf128e0ba01725056c40a3c1b850cf4b441ad" - "0.2.14-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/v0.2.14-p0.tar.gz" - sha256: "68a0e715aa18d2fe558fede06d65ec125959895efe4d0ef21b102037c9864ba1" - "0.2.13-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.13-p0.tar.gz" - sha256: "62f61ce6500859f0d77306b1644b5c6992287688de38e170b17b8a66b2448b54" diff --git a/recipes/functionalplus/config.yml b/recipes/functionalplus/config.yml index ebd7ef7a33637..13685d2ebceaf 100644 --- a/recipes/functionalplus/config.yml +++ b/recipes/functionalplus/config.yml @@ -1,19 +1,7 @@ versions: + "0.2.24": + folder: all "0.2.23": folder: all "0.2.22": folder: all - "0.2.20-p0": - folder: all - "0.2.18-p0": - folder: all - "0.2.17-p0": - folder: all - "0.2.16": - folder: all - "0.2.15": - folder: all - "0.2.14-p0": - folder: all - "0.2.13-p0": - folder: all diff --git a/recipes/gcc/all/conanfile.py b/recipes/gcc/all/conanfile.py index 103152cf95e82..da18e51121b44 100644 --- a/recipes/gcc/all/conanfile.py +++ b/recipes/gcc/all/conanfile.py @@ -29,20 +29,23 @@ def configure(self): if self.settings.compiler in ["clang", "apple-clang"]: # Can't remove this from cxxflags with autotools - so get rid of it del self.settings.compiler.libcxx + + # https://github.com/gcc-mirror/gcc/blob/6b5248d15c6d10325c6cbb92a0e0a9eb04e3f122/libcody/configure#L2505C11-L2505C25 + del self.settings.compiler.cppstd def build_requirements(self): if self.settings.os == "Linux": # binutils recipe is broken for Macos, and Windows uses tools # distributed with msys/mingw - self.tool_requires("binutils/2.38") + self.tool_requires("binutils/2.42") self.tool_requires("flex/2.6.4") def requirements(self): self.requires("mpc/1.2.0") - self.requires("mpfr/4.1.0") - self.requires("gmp/6.2.1") - self.requires("zlib/1.2.13") - self.requires("isl/0.24") + self.requires("mpfr/4.2.0") + self.requires("gmp/6.3.0") + self.requires("zlib/[>=1.2.13 <2]") + self.requires("isl/0.26") def package_id(self): del self.info.settings.compiler diff --git a/recipes/gcem/all/conandata.yml b/recipes/gcem/all/conandata.yml index 5aa429fe457fd..08aecb09abbd3 100644 --- a/recipes/gcem/all/conandata.yml +++ b/recipes/gcem/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.18.0": + url: "https://github.com/kthohr/gcem/archive/v1.18.0.tar.gz" + sha256: "8e71a9f5b62956da6c409dda44b483f98c4a98ae72184f3aa4659ae5b3462e61" "1.17.0": url: "https://github.com/kthohr/gcem/archive/v1.17.0.tar.gz" sha256: "74cc499e2db247c32f1ce82fc22022d22e0f0a110ecd19281269289a9e78a6f8" diff --git a/recipes/gcem/config.yml b/recipes/gcem/config.yml index f63fe5ab6f014..93586d1055a3b 100644 --- a/recipes/gcem/config.yml +++ b/recipes/gcem/config.yml @@ -1,4 +1,6 @@ versions: + "1.18.0": + folder: all "1.17.0": folder: all "1.16.0": diff --git a/recipes/gdal/config.yml b/recipes/gdal/config.yml index a7240af75cc2e..60275f391db83 100644 --- a/recipes/gdal/config.yml +++ b/recipes/gdal/config.yml @@ -9,5 +9,3 @@ versions: folder: "pre_3.5.0" "3.4.1": folder: "pre_3.5.0" - "3.3.3": - folder: "pre_3.5.0" diff --git a/recipes/gdal/pre_3.5.0/conandata.yml b/recipes/gdal/pre_3.5.0/conandata.yml index 49983edc62730..16129b5ac3029 100644 --- a/recipes/gdal/pre_3.5.0/conandata.yml +++ b/recipes/gdal/pre_3.5.0/conandata.yml @@ -5,9 +5,6 @@ sources: "3.4.1": url: "https://github.com/OSGeo/gdal/releases/download/v3.4.1/gdal-3.4.1.tar.gz" sha256: "e360387bc25ec24940f46afbeada48002d72c74aaf9eccf2a40e8d74e711a2e4" - "3.3.3": - url: "https://github.com/OSGeo/gdal/releases/download/v3.3.3/gdal-3.3.3.tar.gz" - sha256: "28925ea4717b02185ee208bfc121a94fa0bc1dfe9cb862fd3868c2a0394d605a" patches: "3.4.3": - patch_file: "patches/3.4.x/fix-autotools-3.4.3.patch" @@ -21,9 +18,3 @@ patches: - patch_file: "patches/3.4.x/fix-include-jsonc-3.4.1.patch" - patch_file: "patches/3.4.x/fix-include-xerces.patch" - patch_file: "patches/3.4.x/fix-include-podofo.patch" - "3.3.3": - - patch_file: "patches/3.3.x/fix-autotools-3.3.3.patch" - - patch_file: "patches/3.3.x/fix-nmake.patch" - - patch_file: "patches/3.3.x/fix-include-jsonc.patch" - - patch_file: "patches/3.3.x/fix-include-xerces.patch" - - patch_file: "patches/3.3.x/fix-include-podofo.patch" diff --git a/recipes/gdal/pre_3.5.0/conanfile.py b/recipes/gdal/pre_3.5.0/conanfile.py index 65bbd7d92d812..0270a1825c5cf 100644 --- a/recipes/gdal/pre_3.5.0/conanfile.py +++ b/recipes/gdal/pre_3.5.0/conanfile.py @@ -165,37 +165,6 @@ class GdalConan(ConanFile): def _settings_build(self): return getattr(self, "settings_build", self.settings) - @property - def _has_with_exr_option(self): - return Version(self.version) >= "3.1.0" - - @property - def _has_with_libdeflate_option(self): - return Version(self.version) >= "3.2.0" - - @property - def _has_with_heif_option(self): - return Version(self.version) >= "3.2.0" - - @property - def _has_with_blosc_option(self): - return Version(self.version) >= "3.4.0" - - @property - def _has_with_lz4_option(self): - return Version(self.version) >= "3.4.0" - - @property - def _has_with_brunsli_option(self): - return Version(self.version) >= "3.4.0" - - @property - def _has_with_pcre2_option(self): - return Version(self.version) >= "3.4.1" - - @property - def _has_reentrant_qhull_support(self): - return Version(self.version) >= "3.4.1" def export_sources(self): export_conandata_patches(self) @@ -203,22 +172,6 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - # if Version(self.version) < "3.0.0": - # del self.options.with_tiledb - if not self._has_with_exr_option: - del self.options.with_exr - if not self._has_with_libdeflate_option: - del self.options.with_libdeflate - if not self._has_with_heif_option: - del self.options.with_heif - if not self._has_with_blosc_option: - del self.options.with_blosc - if not self._has_with_lz4_option: - del self.options.with_lz4 - if not self._has_with_brunsli_option: - del self.options.with_brunsli - if not self._has_with_pcre2_option: - del self.options.with_pcre2 def configure(self): if self.options.shared: @@ -239,7 +192,7 @@ def configure(self): self.options.rm_safe("with_png") # and it's not trivial to fix if self.options.with_qhull: - self.options["qhull"].reentrant = self._has_reentrant_qhull_support + self.options["qhull"].reentrant = True def layout(self): basic_layout(self, src_folder="src") @@ -249,24 +202,23 @@ def requirements(self): self.requires("json-c/0.17") self.requires("libgeotiff/1.7.1") # self.requires("libopencad/0.0.2") # TODO: use conan recipe when available instead of internal one - self.requires("libtiff/4.5.1") - self.requires("proj/9.2.1") - if Version(self.version) >= "3.1.0": - self.requires("flatbuffers/2.0.5") + self.requires("libtiff/4.6.0") + self.requires("proj/9.3.1") + self.requires("flatbuffers/2.0.5") if self.options.get_safe("with_zlib", True): - self.requires("zlib/1.2.13") - if self.options.get_safe("with_libdeflate"): - self.requires("libdeflate/1.18") + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_libdeflate: + self.requires("libdeflate/1.19") if self.options.with_libiconv: self.requires("libiconv/1.17") if self.options.get_safe("with_zstd"): self.requires("zstd/1.5.5") - if self.options.get_safe("with_blosc"): + if self.options.with_blosc: self.requires("c-blosc/1.21.3") - if self.options.get_safe("with_lz4"): + if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_pg: - self.requires("libpq/14.5") + self.requires("libpq/15.4") # if self.options.with_libgrass: # self.requires("libgrass/x.x.x") if self.options.with_cfitsio: @@ -274,7 +226,7 @@ def requirements(self): # if self.options.with_pcraster: # self.requires("pcraster-rasterformat/1.3.2") if self.options.get_safe("with_png", True): - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_dds: self.requires("crunch/cci.20190615") if self.options.with_gta: @@ -318,7 +270,7 @@ def requirements(self): if self.options.with_xerces: self.requires("xerces-c/3.2.4") if self.options.with_expat: - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.with_libkml: self.requires("libkml/1.3.0") if self.options.with_odbc and self.settings.os != "Windows": @@ -326,13 +278,13 @@ def requirements(self): # if self.options.with_dods_root: # self.requires("libdap/3.20.6") if self.options.with_curl: - self.requires("libcurl/8.2.1") + self.requires("libcurl/[>=8.2 <9]") if self.options.with_xml2: self.requires("libxml2/2.10.3") # if self.options.with_spatialite: # self.requires("libspatialite/4.3.0a") if self.options.get_safe("with_sqlite3"): - self.requires("sqlite3/3.42.0") + self.requires("sqlite3/3.44.2") # if self.options.with_rasterlite2: # self.requires("rasterlite2/x.x.x") if self.options.get_safe("with_pcre"): @@ -367,12 +319,12 @@ def requirements(self): if self.options.with_cryptopp: self.requires("cryptopp/8.7.0") if self.options.with_crypto: - self.requires("openssl/1.1.1u") + self.requires("openssl/[>=1.1 <4]") # if not self.options.without_lerc: # self.requires("lerc/2.1") # TODO: use conan recipe (not possible yet because lerc API is broken for GDAL) - if self.options.get_safe("with_exr"): + if self.options.with_exr: self.requires("openexr/3.1.9") - if self.options.get_safe("with_heif"): + if self.options.with_heif: self.requires("libheif/1.13.0") def validate(self): @@ -383,15 +335,13 @@ def validate(self): raise ConanInvalidConfiguration("Enable either pcre or pcre2, not both") if self.options.get_safe("with_pcre2") and not self.dependencies["pcre2"].options.build_pcre2_8: raise ConanInvalidConfiguration("gdal:with_pcre2=True requires pcre2:build_pcre2_8=True") - if self.options.get_safe("with_brunsli"): + if self.options.with_brunsli: raise ConanInvalidConfiguration("brunsli not available in conan-center yet") - if self.options.get_safe("with_libdeflate") and not self.options.get_safe("with_zlib", True): + if self.options.with_libdeflate and not self.options.get_safe("with_zlib", True): raise ConanInvalidConfiguration("gdal:with_libdeflate=True requires gdal:with_zlib=True") if self.options.with_qhull: - if self._has_reentrant_qhull_support and not self.dependencies["qhull"].options.reentrant: + if not self.dependencies["qhull"].options.reentrant: raise ConanInvalidConfiguration(f"{self.ref} depends on reentrant qhull.") - elif not self._has_reentrant_qhull_support and self.dependencies["qhull"].options.reentrant: - raise ConanInvalidConfiguration(f"{self.ref} depends on non-reentrant qhull.") if hasattr(self, "settings_build") and cross_building(self): if self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} can't cross-build shared lib") @@ -405,14 +355,14 @@ def validate(self): if mongocxx_version < "3.0.0": # TODO: handle mongo-cxx-driver v2 raise ConanInvalidConfiguration(f"{self.ref} with mongo-cxx-driver < 3.0.0 not yet supported in this recipe.") - elif mongocxx_version < "3.4.0": + if mongocxx_version < "3.4.0": raise ConanInvalidConfiguration(f"{self.ref} with mongo-cxx-driver v3 requires 3.4.0 at least.") def build_requirements(self): if not is_msvc(self): self.tool_requires("libtool/2.4.7") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.1.0") if self._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): @@ -433,9 +383,8 @@ def _patch_sources(self): os.path.join("frmts", "zlib"), # os.path.join("ogr", "ogrsf_frmts", "cad", "libopencad"), # TODO: uncomment when libopencad available os.path.join("ogr", "ogrsf_frmts", "geojson", "libjson"), + os.path.join("ogr", "ogrsf_frmts", "flatgeobuf", "flatbuffers"), ] - if Version(self.version) >= "3.1.0": - embedded_libs.append(os.path.join("ogr", "ogrsf_frmts", "flatgeobuf", "flatbuffers")) for lib_subdir in embedded_libs: rmdir(self, os.path.join(self.source_folder, lib_subdir)) @@ -467,12 +416,8 @@ def _patch_sources(self): replace_in_file(self, gnumakefile_apps, "default: gdal-config-inst gdal-config $(BIN_LIST)", "default: gdal-config-inst gdal-config") - if Version(self.version) < "3.4.0": - clean_pattern = "$(RM) *.o $(BIN_LIST) core gdal-config gdal-config-inst" - else: - clean_pattern = "$(RM) *.o $(BIN_LIST) $(NON_DEFAULT_LIST) core gdal-config gdal-config-inst" replace_in_file(self, gnumakefile_apps, - clean_pattern, + "$(RM) *.o $(BIN_LIST) $(NON_DEFAULT_LIST) core gdal-config gdal-config-inst", "$(RM) *.o core gdal-config gdal-config-inst") replace_in_file(self, gnumakefile_apps, "for f in $(BIN_LIST) ; do $(INSTALL) $$f $(DESTDIR)$(INST_BIN) ; done", @@ -599,8 +544,7 @@ def _nmake_args(self): ]) if self.dependencies["netcdf"].options.netcdf4 and self.dependencies["netcdf"].options.with_hdf5: args.append("NETCDF_HAS_NC4=YES") - if Version(self.version) >= "3.3.0" and \ - os.path.isfile(os.path.join(rootpath("netcdf"), "include", "netcdf_mem.h")): + if os.path.isfile(os.path.join(rootpath("netcdf"), "include", "netcdf_mem.h")): args.append("NETCDF_HAS_NETCDF_MEM=YES") if self.options.with_curl: args.append("CURL_INC=\"-I{}\"".format(include_paths("libcurl"))) @@ -611,7 +555,7 @@ def _nmake_args(self): if self.options.get_safe("with_zlib", True): args.append("ZLIB_EXTERNAL_LIB=1") args.append("ZLIB_INC=\"-I{}\"".format(include_paths("zlib"))) - if self.options.get_safe("with_libdeflate"): + if self.options.with_libdeflate: args.append("LIBDEFLATE_CFLAGS=\"-I{}\"".format(include_paths("libdeflate"))) if self.options.with_poppler: poppler_version = version("poppler") @@ -624,9 +568,9 @@ def _nmake_args(self): args.append("PODOFO_ENABLED=YES") if self.options.get_safe("with_zstd"): args.append("ZSTD_CFLAGS=\"-I{}\"".format(include_paths("zstd"))) - if self.options.get_safe("with_blosc"): + if self.options.with_blosc: args.append("BLOSC_CFLAGS=\"-I{}\"".format(include_paths("c-blosc"))) - if self.options.get_safe("with_lz4"): + if self.options.with_lz4: args.append("LZ4_CFLAGS=\"-I{}\"".format(include_paths("lz4"))) if self.options.with_webp: args.append("WEBP_ENABLED=YES") @@ -648,7 +592,7 @@ def _nmake_args(self): args.append("OPENSSL_INC=\"-I{}\"".format(include_paths("openssl"))) if self.options.without_lerc: args.append("HAVE_LERC=0") - if self.options.get_safe("with_brunsli"): + if self.options.with_brunsli: args.extend([ "BRUNSLI_DIR=\"{}\"".format(rootpath("brunsli")), "BRUNSLI_INC=\"{}\"".format(include_paths("brunsli")), @@ -661,9 +605,9 @@ def _nmake_args(self): args.append("CHARLS_FLAGS=-DCHARLS_2") if self.options.with_dds: args.append("CRUNCH_INC=\"-I{}\"".format(include_paths("crunch"))) - if self.options.get_safe("with_exr"): + if self.options.with_exr: args.append("EXR_INC=\"-I{}\"".format(include_paths("openexr"))) - if self.options.get_safe("with_heif"): + if self.options.with_heif: args.append("HEIF_INC=\"-I{}\"".format(include_paths("libheif"))) return args @@ -729,22 +673,16 @@ def generate(self): # Depencencies: tc.configure_args.append("--with-proj=yes") # always required ! tc.configure_args.append("--with-libz={}".format(yes_no(self.options.with_zlib))) - if self._has_with_libdeflate_option: - tc.configure_args.append("--with-libdeflate={}".format(yes_no(self.options.with_libdeflate))) + tc.configure_args.append("--with-libdeflate={}".format(yes_no(self.options.with_libdeflate))) tc.configure_args.append("--with-libiconv-prefix={}".format(rootpath_no(self.options.with_libiconv, "libiconv"))) tc.configure_args.append("--with-liblzma=no") # always disabled: liblzma is an optional transitive dependency of gdal (through libtiff). tc.configure_args.append("--with-zstd={}".format(yes_no(self.options.get_safe("with_zstd")))) # Optional direct dependency of gdal only if lerc lib enabled - if self._has_with_blosc_option: - tc.configure_args.append("--with-blosc={}".format(yes_no(self.options.with_blosc))) - if self._has_with_lz4_option: - tc.configure_args.append("--with-lz4={}".format(yes_no(self.options.with_lz4))) + tc.configure_args.append("--with-blosc={}".format(yes_no(self.options.with_blosc))) + tc.configure_args.append("--with-lz4={}".format(yes_no(self.options.with_lz4))) # Drivers: if not (self.options.with_zlib and self.options.with_png and bool(self.options.with_jpeg)): # MRF raster driver always depends on zlib, libpng and libjpeg: https://github.com/OSGeo/gdal/issues/2581 - if Version(self.version) < "3.0.0": - tc.configure_args.append("--without-mrf") - else: - tc.configure_args.append("--disable-driver-mrf") + tc.configure_args.append("--disable-driver-mrf") tc.configure_args.append("--with-pg={}".format(yes_no(self.options.with_pg))) tc.configure_args.extend(["--without-grass", "--without-libgrass"]) # TODO: to implement when libgrass lib available tc.configure_args.append("--with-cfitsio={}".format(rootpath_no(self.options.with_cfitsio, "cfitsio"))) @@ -800,15 +738,10 @@ def generate(self): tc.configure_args.append("--without-spatialite") # TODO: to implement when libspatialite lib available tc.configure_args.append("--with-sqlite3={}".format(yes_no(self.options.get_safe("with_sqlite3")))) tc.configure_args.append("--without-rasterlite2") # TODO: to implement when rasterlite2 lib available - if self._has_with_pcre2_option: - tc.configure_args.append("--with-pcre2={}".format(yes_no(self.options.get_safe("with_pcre2")))) + tc.configure_args.append("--with-pcre2={}".format(yes_no(self.options.get_safe("with_pcre2")))) tc.configure_args.append("--with-pcre={}".format(yes_no(self.options.get_safe("with_pcre")))) tc.configure_args.append("--without-teigha") # commercial library tc.configure_args.append("--without-idb") # commercial library - if Version(self.version) < "3.2.0": - tc.configure_args.append("--without-sde") # commercial library - if Version(self.version) < "3.3.0": - tc.configure_args.append("--without-epsilon") tc.configure_args.append("--with-webp={}".format(rootpath_no(self.options.with_webp, "libwebp"))) tc.configure_args.append("--with-geos={}".format(yes_no(self.options.with_geos))) tc.configure_args.append("--without-sfcgal") # TODO: to implement when sfcgal lib available @@ -834,27 +767,19 @@ def generate(self): tc.configure_args.append("--without-python") tc.configure_args.append("--without-java") tc.configure_args.append("--without-hdfs") - if Version(self.version) >= "3.0.0": - tc.configure_args.append("--without-tiledb") # TODO: to implement when tiledb lib available + tc.configure_args.append("--without-tiledb") # TODO: to implement when tiledb lib available tc.configure_args.append("--without-mdb") tc.configure_args.append("--without-rasdaman") # TODO: to implement when rasdaman lib available - if self._has_with_brunsli_option: - tc.configure_args.append("--with-brunsli={}".format(yes_no(self.options.with_brunsli))) - if Version(self.version) >= "3.1.0": - tc.configure_args.append("--without-rdb") # commercial library + tc.configure_args.append("--with-brunsli={}".format(yes_no(self.options.with_brunsli))) + tc.configure_args.append("--without-rdb") # commercial library tc.configure_args.append("--without-armadillo") # TODO: to implement when armadillo lib available tc.configure_args.append("--with-cryptopp={}".format(rootpath_no(self.options.with_cryptopp, "cryptopp"))) tc.configure_args.append("--with-crypto={}".format(yes_no(self.options.with_crypto))) - if Version(self.version) >= "3.3.0": - tc.configure_args.append("--with-lerc={}".format(internal_no(not self.options.without_lerc))) - else: - tc.configure_args.append("--with-lerc={}".format(yes_no(not self.options.without_lerc))) + tc.configure_args.append("--with-lerc={}".format(internal_no(not self.options.without_lerc))) if self.options.with_null: tc.configure_args.append("--with-null") - if self._has_with_exr_option: - tc.configure_args.append("--with-exr={}".format(yes_no(self.options.with_exr))) - if self._has_with_heif_option: - tc.configure_args.append("--with-heif={}".format(yes_no(self.options.with_heif))) + tc.configure_args.append("--with-exr={}".format(yes_no(self.options.with_exr))) + tc.configure_args.append("--with-heif={}".format(yes_no(self.options.with_heif))) tc.generate() AutotoolsDeps(self).generate() @@ -910,7 +835,7 @@ def package_info(self): self.cpp_info.system_libs.append("pthread") elif self.settings.os == "Windows": self.cpp_info.system_libs.extend(["psapi", "ws2_32"]) - if Version(self.version) >= "3.2.0" and is_msvc(self): + if is_msvc(self): self.cpp_info.system_libs.append("wbemuuid") if self.options.with_odbc and not self.options.shared: self.cpp_info.system_libs.extend(["odbc32", "odbccp32"]) diff --git a/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-autotools-3.3.3.patch b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-autotools-3.3.3.patch deleted file mode 100644 index a5746b4d1e05f..0000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-autotools-3.3.3.patch +++ /dev/null @@ -1,302 +0,0 @@ ---- a/GDALmake.opt.in -+++ b/GDALmake.opt.in -@@ -600,7 +600,7 @@ endif - - ifeq ($(HAVE_LIBTOOL), yes) - --CONFIG_LIBS = $(GDAL_ROOT)/$(LIBGDAL) -+CONFIG_LIBS = $(GDAL_ROOT)/$(LIBGDAL) $(LIBS) - ifeq ($(MACOSX_FRAMEWORK),yes) - CONFIG_LIBS_INS = -L$(INST_LIB)/unix/lib -lgdal - else ---- a/configure.ac -+++ b/configure.ac -@@ -1175,6 +1175,10 @@ AC_ARG_WITH(libdeflate, - [enable libdeflate usage (optional for faster Deflate support (still requires zlib) (ARG=yes/no/prefix), enabled by default)]),,) - - if test "$with_libdeflate" != "no" ; then -+# AC_CHECK_LIB tests not robust enough (don't handle static libdeflate on windows) -+if test "$with_libdeflate" = "yes" ; then -+ LIBDEFLATE_SETTING=yes -+else - - if test "$with_libdeflate" != "" -a "$with_libdeflate" != "yes"; then - AC_CHECK_LIB(deflate, libdeflate_zlib_decompress, [libdeflate_lib=yes], [libdeflate_lib=no],-L$with_libdeflate/lib) -@@ -1204,13 +1208,13 @@ if test "$with_libdeflate" != "no" ; then - fi - - fi -+fi - - if test "$LIBDEFLATE_SETTING" = "yes" ; then - if test "$with_libdeflate" != "" -a "$with_libdeflate" != "yes"; then - EXTRA_INCLUDES="-I$with_libdeflate/include $EXTRA_INCLUDES" - LIBS="-L$with_libdeflate/lib -ldeflate $LIBS" -- else -- LIBS="-ldeflate $LIBS" -+ # Too fragile: libdeflate static lib name on windows is libdeflatestatic - fi - fi - -@@ -1378,7 +1382,7 @@ else - AC_MSG_RESULT([using libtiff from ${with_libtiff}.]) - - dnl Check for the BigTIFF enabled library (libtiff >= 4.0) -- AC_CHECK_LIB(tiff,TIFFScanlineSize64,HAVE_BIGTIFF=yes,HAVE_BIGTIFF=no,) -+ AC_CHECK_LIB(tiff,TIFFScanlineSize64,HAVE_BIGTIFF=yes,HAVE_BIGTIFF=no,$LIBS) - - fi - -@@ -1402,23 +1406,11 @@ AC_ARG_WITH(curl, - dnl Clear some cache variables - unset ac_cv_path_LIBCURL - --if test "`basename xx/$with_curl`" = "curl-config" ; then -- LIBCURL_CONFIG="$with_curl" --elif test "$with_curl" = "no" ; then -- LIBCURL_CONFIG=no -+PKG_PROG_PKG_CONFIG([0.21]) -+if test "$with_curl" = "yes" ; then -+ PKG_CHECK_MODULES([CURL], [libcurl], [CURL_SETTING=yes], [AC_MSG_ERROR([libcurl not found...])]) - else -- AC_PATH_PROG(LIBCURL_CONFIG, curl-config, no) --fi -- --if test "$LIBCURL_CONFIG" != "no" ; then -- -- CURL_VERNUM=`$LIBCURL_CONFIG --vernum` -- CURL_VER=`$LIBCURL_CONFIG --version | awk '{print $2}'` -- -- AC_MSG_RESULT([ found libcurl version $CURL_VER]) -- -- AC_CHECK_LIB(curl,curl_global_init,CURL_SETTING=yes,CURL_SETTING=no,`$LIBCURL_CONFIG --libs`) -- -+ CURL_SETTING=no - fi - - AC_SUBST(CURL_SETTING,$CURL_SETTING) -@@ -1430,8 +1422,11 @@ dnl Check for SQLite - dnl Proj depends on it so it must appear before. - dnl --------------------------------------------------------------------------- - --SQLITE3_REQ_VERSION="3.0.0" --AX_LIB_SQLITE3($SQLITE3_REQ_VERSION) -+HAVE_SQLITE3=no -+AC_ARG_WITH(sqlite3, AS_HELP_STRING([--with-sqlite3[=ARG]], [use SQLite 3 library (ARG=yes or no)]),,) -+if test x"$with_sqlite3" = x"yes" ; then -+ PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.0.0], [HAVE_SQLITE3=yes], [AC_MSG_ERROR([sqlite3 not found...])]) -+fi - - if test "$HAVE_SQLITE3" = "yes"; then - LIBS="$SQLITE3_LDFLAGS $LIBS" -@@ -1462,11 +1457,7 @@ if test "x$with_proj" = "xno" ; then - else - - if test "x$with_proj" = "xyes" -o "x$with_proj" = "x"; then -- ORIG_LIBS="$LIBS" -- LIBS="-lproj $with_proj_extra_lib_for_test $ORIG_LIBS" -- AC_LANG_PUSH([C++]) -- AC_CHECK_LIB(proj,proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,) -- AC_LANG_POP([C++]) -+ PROJ_FOUND=yes - if test "$PROJ_FOUND" = "no"; then - AC_LANG_PUSH([C++]) - AC_CHECK_LIB(proj,internal_proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,) -@@ -1889,8 +1880,8 @@ fi - - if test "$CURL_SETTING" = "yes" ; then - -- CURL_INC=`$LIBCURL_CONFIG --cflags` -- CURL_LIB=`$LIBCURL_CONFIG --libs` -+ CURL_INC="$CURL_CFLAGS" -+ CURL_LIB="$CURL_LIBS" - m4_foreach_w([frmt],CURL_FORMATS,[ - driver_enabled=m4_join([_],[$INTERNAL_FORMAT],frmt,[ENABLED]) - if test "x$driver_enabled" = "xyes"; then -@@ -2222,7 +2213,6 @@ else - - DDS_SETTING=yes - CRUNCHDIR="$with_dds" -- LIBS="-L$with_dds/lib/ -lcrunch $LIBS" - echo "using libcrunch from $with_dds." - - fi -@@ -2373,7 +2363,6 @@ else - - dnl We now require libgeotiff 1.5.0 - dnl first check if $with_geotiff/lib has the library: -- AC_CHECK_LIB(geotiff,GTIFAttachPROJContext,GEOTIFF_SETTING=external,GEOTIFF_SETTING=not_found,-L$with_geotiff/lib) - - if test $GEOTIFF_SETTING = "external" ; then - LIBS="-L$with_geotiff/lib -lgeotiff $LIBS" -@@ -2875,6 +2864,10 @@ if test x"$with_hdf4" = x"no" ; then - - echo "hdf4 support disabled." - -+elif test x"$with_hdf4" = x"yes" ; then -+ PKG_CHECK_MODULES([HDF4], [hdf], [HAVE_HDF4=yes], [AC_MSG_ERROR([hdf4 not found...])]) -+ PKG_CHECK_MODULES([HDF4], [hdf >= 4.2.5], [HDF4_HAS_MAXOPENFILES=yes], [HDF4_HAS_MAXOPENFILES=no]) -+ HDF4_INCLUDE="$HDF4_CFLAGS" - else - - if test x"$with_hdf4" = x"yes" -o x"$with_hdf4" = x"" ; then -@@ -3005,7 +2998,6 @@ elif test "$with_hdf5" = "yes" -o "$with_hdf5" = "" ; then - # Test that the package found is for the right architecture - saved_LIBS="$LIBS" - LIBS="$HDF5_LIBS" -- AC_CHECK_LIB(hdf5,H5Fopen, [HAVE_HDF5=yes], [HAVE_HDF5=no]) - LIBS="$saved_LIBS" - - if test "$HAVE_HDF5" = "yes"; then -@@ -3074,21 +3066,21 @@ KEA_CONFIG=no - - AC_ARG_WITH(kea,[ --with-kea[=ARG] Include kealib (ARG=path to kea-config) [[default=yes]]],,) - -+AC_MSG_CHECKING([for kea]) - if test "$with_kea" = "yes" -o "x$with_kea" = "x" ; then -- AC_PATH_PROG(KEA_CONFIG, kea-config, no) -+ HAVE_KEA=yes -+ AC_MSG_RESULT([yes]) - else -- KEA_CONFIG=$with_kea -+ HAVE_KEA=no -+ AC_MSG_RESULT([no]) - fi - --AC_MSG_CHECKING([for kea]) - - if test "$KEA_CONFIG" = "no" ; then - -- HAVE_KEA=no - KEA_LIB= - KEA_INC= - -- AC_MSG_RESULT([no]) - - else - if test -d $KEA_CONFIG ; then -@@ -3940,18 +3932,15 @@ MYSQL_CONFIG=no - AC_ARG_WITH(mysql,[ --with-mysql[=ARG] Include MySQL (ARG=path to mysql_config) [[default=no]]],,) - - if test "$with_mysql" = "yes" ; then -- AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no) -+ HAVE_MYSQL=yes - else -- if test "x$with_mysql" != "x" ; then -- MYSQL_CONFIG=$with_mysql -- fi -+ HAVE_MYSQL=no - fi - - AC_MSG_CHECKING([for MySQL]) - - if test "$MYSQL_CONFIG" = "no" ; then - -- HAVE_MYSQL=no - MYSQL_LIB= - MYSQL_INC= - -@@ -4045,8 +4034,11 @@ dnl Check for Expat configuration. - dnl --------------------------------------------------------------------------- - - dnl Expat 1.95.0 released in 2000-09-28 --EXPAT_REQ_VERSION="1.95.0" --AX_LIB_EXPAT($EXPAT_REQ_VERSION) -+# AX_LIB_EXPAT is too fragile, it doesn't properly handle debug expat on Windows -+HAVE_EXPAT=no -+AC_ARG_WITH([expat], AS_HELP_STRING([--with-expat[=ARG]], [use Expat library (ARG=yes or no)]),,) -+if test x"$with_expat" = x"yes" ; then -+PKG_CHECK_MODULES([EXPAT], [expat >= 1.95.0], [HAVE_EXPAT=yes], [AC_MSG_ERROR([expat not found...])]) - - if test "$HAVE_EXPAT" = "yes"; then - LIBS="$EXPAT_LDFLAGS $LIBS" -@@ -4059,6 +4051,7 @@ m4_foreach_w([frmt],EXPAT_DRIVERS,[ - fi - ]) - -+fi - fi - - AC_SUBST([HAVE_EXPAT], $HAVE_EXPAT) -@@ -4305,7 +4298,6 @@ if test "x$with_xml2" = "xyes" -o "x$with_xml2" = "x" ; then - if test "${HAVE_LIBXML2}" = "yes"; then - SAVED_LIBS="${LIBS}" - LIBS="${LIBXML2_LIBS}" -- AC_CHECK_LIB(xml2,xmlParseDoc,HAVE_LIBXML2=yes,HAVE_LIBXML2=no) - LIBS="${SAVED_LIBS}" - fi - -@@ -4550,13 +4542,18 @@ dnl --------------------------------------------------------------------------- - dnl Check if geos library is available. - dnl --------------------------------------------------------------------------- - --GEOS_INIT(3.1.0) -+AC_ARG_WITH(geos, AS_HELP_STRING([--with-geos[=ARG]], [Include GEOS support (ARG=yes or no)]),,) -+HAVE_GEOS=no -+if test x"$with_geos" = x"no" ; then -+ AC_MSG_RESULT([GEOS support disabled]) -+else -+ PKG_CHECK_MODULES([GEOS], [geos >= 3.1.0], [HAVE_GEOS=yes], [AC_MSG_ERROR([geos not found...])]) - if test "${HAVE_GEOS}" = "yes" ; then - AC_MSG_NOTICE([Using C API from GEOS $GEOS_VERSION]) -- STRIP_SYSTEM_LIBRARY_PATHS("${GEOS_LIBS}") -- GEOS_LIBS="$STRIPPED_LIBRARY_NAME" - LIBS="${GEOS_LIBS} ${LIBS}" - fi -+fi -+AC_SUBST(HAVE_GEOS, $HAVE_GEOS) - - dnl --------------------------------------------------------------------------- - dnl Check if SFCGAL library is available. -@@ -4588,20 +4585,18 @@ elif test "$with_qhull" = "yes" -o "$with_qhull" = "" ; then - # qhull/qhull.h - AC_CHECK_HEADERS([qhull/libqhull.h]) - if test "$ac_cv_header_qhull_libqhull_h" = "yes"; then -- AC_CHECK_LIB(qhull,qh_new_qhull,QHULL_SETTING=yes,QHULL_SETTING=no,) -+ QHULL_SETTING=yes - if test "$QHULL_SETTING" = "yes"; then - QHULL_SETTING=external - QHULL_INCLUDE_SUBDIR_IS_LIBQHULL=0 -- LIBS="-lqhull $LIBS" - fi - fi - AC_CHECK_HEADERS([libqhull/libqhull.h]) - if test "$ac_cv_header_libqhull_libqhull_h" = "yes"; then -- AC_CHECK_LIB(qhull,qh_new_qhull,QHULL_SETTING=yes,QHULL_SETTING=no,) -+ QHULL_SETTING=yes - if test "$QHULL_SETTING" = "yes"; then - QHULL_SETTING=external - QHULL_INCLUDE_SUBDIR_IS_LIBQHULL=1 -- LIBS="-lqhull $LIBS" - fi - fi - -@@ -4688,7 +4683,9 @@ AC_MSG_CHECKING([for FreeXL support]) - HAVE_FREEXL=no - FREEXL_INCLUDE= - --if test "$with_freexl" = "" -o "$with_freexl" = "yes" ; then -+if test "$with_freexl" = "yes"; then -+ PKG_CHECK_MODULES([FREEXL], [freexl >= 1.0.0], [HAVE_FREEXL=yes], [AC_MSG_ERROR([freexl not found...])]) -+elif test "$with_freexl" = ""; then - AC_CHECK_HEADERS(freexl.h) - AC_CHECK_LIB(freexl,freexl_open,FREEXL_LIBS="-lfreexl",FREEXL_LIBS=missing) - -@@ -4794,8 +4791,7 @@ if test "$with_libjson_c" = "external" -o "$with_libjson_c" = "" -o "$with_libjs - elif test "$with_libjson_c" = "internal" ; then - LIBJSONC_SETTING=internal - elif test "$with_libjson_c" != "no"; then -- LIBS="-L$with_libjson_c/lib $LIBS" -- AC_CHECK_LIB(json-c,json_object_set_serializer,LIBJSONC_SETTING=external,LIBJSONC_SETTING=internal,-L$with_libjson_c/lib) -+ LIBJSONC_SETTING=external - else - AC_MSG_ERROR([libjson-c (internal or external) is required]) - fi -@@ -5953,7 +5949,6 @@ else - # Test that the package found is for the right architecture - saved_LIBS="$LIBS" - LIBS="$EXR_LIBS" -- AC_CHECK_LIB(IlmImf,ImfTiledInputReadTile, [HAVE_EXR=yes], [HAVE_EXR=no]) - LIBS="$saved_LIBS" - - if test "$HAVE_EXR" = "yes"; then diff --git a/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-jsonc.patch b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-jsonc.patch deleted file mode 100644 index e88043df4189f..0000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-jsonc.patch +++ /dev/null @@ -1,104 +0,0 @@ ---- a/gcore/gdal_rat.cpp -+++ b/gcore/gdal_rat.cpp -@@ -50,7 +50,7 @@ - #pragma clang diagnostic ignored "-Wunknown-pragmas" - #pragma clang diagnostic ignored "-Wdocumentation" - #endif --#include "json.h" -+#include - #ifdef __clang__ - #pragma clang diagnostic pop - #endif ---- a/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp -@@ -37,7 +37,7 @@ - - #include "cpl_conv.h" - #include "cpl_error.h" --#include "json.h" -+#include - // #include "json_object.h" - // #include "json_tokener.h" - #include "ogr_api.h" ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsondatasource.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsondatasource.cpp -@@ -41,7 +41,7 @@ - #include "cpl_string.h" - #include "cpl_vsi.h" - #include "cpl_vsi_error.h" --#include "json.h" -+#include - // #include "json_object.h" - #include "gdal_utils.h" - #include "gdal.h" ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsonlayer.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonlayer.cpp -@@ -37,7 +37,7 @@ - # endif - #endif // !DEBUG_VERBOSE - --#include -+#include - - #if !DEBUG_JSON - # ifdef __clang ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp -@@ -32,7 +32,7 @@ - #include "ogrgeojsonreader.h" - #include "ogrgeojsonutils.h" - #include "ogr_geojson.h" --#include // JSON-C -+#include - - #if (!defined(JSON_C_VERSION_NUM)) || (JSON_C_VERSION_NUM < JSON_C_VER_013) - #include // just for sizeof(struct json_object) ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsonutils.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonutils.cpp -@@ -32,7 +32,7 @@ - #include - #include - #include --#include // JSON-C -+#include - - #include - #include ---- a/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp -@@ -33,13 +33,13 @@ - #include "ogrgeojsonutils.h" - #include "ogr_geojson.h" - #include "ogrgeojsonreader.h" --#include // JSON-C -+#include - - #if (!defined(JSON_C_VERSION_NUM)) || (JSON_C_VERSION_NUM < JSON_C_VER_013) - #include - #endif - --#include -+#include - #include - #include - ---- a/ogr/ogrsf_frmts/geojson/ogrtopojsonreader.cpp -+++ b/ogr/ogrsf_frmts/geojson/ogrtopojsonreader.cpp -@@ -30,5 +30,5 @@ - #include "ogrgeojsonutils.h" - #include "ogr_geojson.h" --#include // JSON-C -+#include - #include - ---- a/port/cpl_json_header.h -+++ b/port/cpl_json_header.h -@@ -33,7 +33,7 @@ - #pragma GCC system_header - #endif - --#include -+#include - - #undef json_object_object_foreachC - #define json_object_object_foreachC(obj,iter) \ diff --git a/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-podofo.patch b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-podofo.patch deleted file mode 100644 index aa86489f0296b..0000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-podofo.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/frmts/pdf/pdfsdk_headers.h -+++ b/frmts/pdf/pdfsdk_headers.h -@@ -103,7 +103,7 @@ typedef unsigned char Guchar; - #undef GetObject - #endif - --#include "podofo.h" -+#include - #endif // HAVE_PODOFO - - #ifdef HAVE_PDFIUM diff --git a/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-xerces.patch b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-xerces.patch deleted file mode 100644 index 8b08760381794..0000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-xerces.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- a/ogr/ogr_xerces_headers.h -+++ b/ogr/ogr_xerces_headers.h -@@ -33,9 +33,9 @@ - #pragma GCC system_header - #endif - --#include --#include --#include -+#include -+#include -+#include - - #ifdef XERCES_CPP_NAMESPACE_USE - XERCES_CPP_NAMESPACE_USE ---- a/ogr/ogrsf_frmts/gml/xercesc_headers.h -+++ b/ogr/ogrsf_frmts/gml/xercesc_headers.h -@@ -33,13 +33,13 @@ - #pragma GCC system_header - #endif - --#include --#include --#include --#include --#include --#include --#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - - #ifdef XERCES_CPP_NAMESPACE_USE - XERCES_CPP_NAMESPACE_USE ---- a/ogr/ogrsf_frmts/ili/xercesc_headers.h -+++ b/ogr/ogrsf_frmts/ili/xercesc_headers.h -@@ -33,14 +33,14 @@ - #pragma GCC system_header - #endif - --#include --#include --#include --#include --#include --#include --#include --#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - - #ifdef XERCES_CPP_NAMESPACE_USE - XERCES_CPP_NAMESPACE_USE diff --git a/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-nmake.patch b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-nmake.patch deleted file mode 100644 index 4c0ef454c2aac..0000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-nmake.patch +++ /dev/null @@ -1,179 +0,0 @@ ---- a/alg/makefile.vc -+++ b/alg/makefile.vc -@@ -14,7 +14,7 @@ EXTRAFLAGS = -I../frmts/vrt -I../ogr/ogrsf_frmts $(GEOS_CFLAGS) $(PROJ_FLAGS) $( - EXTRAFLAGS = $(EXTRAFLAGS) -DINTERNAL_QHULL - !ELSE - !IF "$(QHULL_SETTING)" == "EXTERNAL" --EXTRAFLAGS = $(EXTRAFLAGS) -DEXTERNAL_QHULL $(QHULL_INC) -+EXTRAFLAGS = $(EXTRAFLAGS) -DEXTERNAL_QHULL -DQHULL_INCLUDE_SUBDIR_IS_LIBQHULL=1 $(QHULL_INC) - !ENDIF - !ENDIF - !ENDIF ---- a/apps/makefile.vc -+++ b/apps/makefile.vc -@@ -8,6 +8,9 @@ EXTRAFLAGS = -I..\frmts\vrt -I..\ogr\ogrsf_frmts\geojson\libjson -I..\ogr\ogrsf_ - !INCLUDE ..\nmake.opt - - LIBS = $(GDALLIB) -+!IF "$(DLLBUILD)" != "1" -+LIBS = $(LIBS) $(EXTERNAL_LIBS) -+!ENDIF - - !IFDEF INCLUDE_OGR_FRMTS - OGR_PROGRAMS = gdal_contour.exe gdaltindex.exe gdal_rasterize.exe \ ---- a/frmts/gif/makefile.vc -+++ b/frmts/gif/makefile.vc -@@ -10,14 +10,8 @@ EXTRAFLAGS = -Igiflib - - default: $(OBJ) - xcopy /D /Y *.obj ..\o -- cd giflib -- $(MAKE) /f makefile.vc -- cd .. - - clean: - -del *.obj -- cd giflib -- $(MAKE) /f makefile.vc clean -- cd .. - - ---- a/frmts/jpeg/makefile.vc -+++ b/frmts/jpeg/makefile.vc -@@ -29,12 +29,16 @@ default: $(EXTRA_DEP) $(OBJ) - - clean: - -del *.obj -+!IFNDEF JPEG_EXTERNAL_LIB - cd libjpeg - $(MAKE) /f makefile.vc clean - cd .. -+!ENDIF -+!IFDEF JPEG12_SUPPORTED - cd libjpeg12 - $(MAKE) /f makefile.vc clean - cd .. -+!ENDIF - - libjpeg12src: - cd libjpeg12 ---- a/frmts/kea/makefile.vc -+++ b/frmts/kea/makefile.vc -@@ -1,7 +1,7 @@ - - OBJ = keaband.obj keacopy.obj keadataset.obj keadriver.obj keamaskband.obj keaoverview.obj kearat.obj - --EXTRAFLAGS = $(KEA_CFLAGS) -DH5_BUILT_AS_DYNAMIC_LIB -+EXTRAFLAGS = $(KEA_CFLAGS) - - GDAL_ROOT = ..\.. - ---- a/frmts/makefile.vc -+++ b/frmts/makefile.vc -@@ -3,11 +3,11 @@ GDAL_ROOT = .. - - EXTRAFLAGS = -DFRMT_ceos -DFRMT_aigrid -DFRMT_elas -DFRMT_hfa -DFRMT_gtiff\ - -DFRMT_sdts -DFRMT_raw -DFRMT_gxf -DFRMT_ceos2 -DFRMT_png \ -- -DFRMT_dted -DFRMT_mem -DFRMT_jdem -DFRMT_gif -DFRMT_esric \ -+ -DFRMT_dted -DFRMT_mem -DFRMT_jdem -DFRMT_esric \ - -DFRMT_envisat -DFRMT_aaigrid -DFRMT_usgsdem -DFRMT_l1b \ - -DFRMT_fit -DFRMT_vrt -DFRMT_xpm -DFRMT_bmp -DFRMT_rmf \ -- -DFRMT_nitf -DFRMT_pcidsk -DFRMT_airsar -DFRMT_rs2 \ -- -DFRMT_ilwis -DFRMT_msgn -DFRMT_rik -DFRMT_pcraster \ -+ -DFRMT_nitf -DFRMT_airsar -DFRMT_rs2 \ -+ -DFRMT_ilwis -DFRMT_msgn -DFRMT_rik \ - -DFRMT_leveller -DFRMT_sgi -DFRMT_srtmhgt -DFRMT_idrisi \ - -DFRMT_jaxapalsar -DFRMT_ers -DFRMT_ingr -DFRMT_dimap \ - -DFRMT_gff -DFRMT_terragen -DFRMT_gsg -DFRMT_cosar -DFRMT_pds \ -@@ -32,6 +32,22 @@ PLUGINDIRLIST = $(PLUGINFLAGS:-DFRMT_=) - EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_postgisraster - !ENDIF - -+!IFDEF GIF_SETTING -+EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_gif -+!ENDIF -+ -+!IFDEF PCIDSK_SETTING -+EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_pcidsk -+!ENDIF -+ -+!IFDEF PCRASTER_SETTING -+EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_pcraster -+!ENDIF -+ -+!IFDEF EXR_INC -+EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_exr -+!ENDIF -+ - !IFDEF JPEG_SUPPORTED - EXTRAFLAGS = -DFRMT_jpeg $(EXTRAFLAGS) - !ENDIF ---- a/frmts/pcidsk/makefile.vc -+++ b/frmts/pcidsk/makefile.vc -@@ -14,7 +14,11 @@ OBJ = pcidskdataset2.obj ogrpcidsklayer.obj vsi_pcidsk_io.obj gdal_edb.obj - !ENDIF - - !IF "$(PCIDSK_SETTING)" == "INTERNAL" -+!IFDEF JPEG_SUPPORTED - PCIDSKFLAGS = -Isdk -DPCIDSK_INTERNAL -DHAVE_LIBJPEG -+!ELSE -+PCIDSKFLAGS = -Isdk -DPCIDSK_INTERNAL -+!ENDIF - - OBJ = pcidskdataset2.obj ogrpcidsklayer.obj vsi_pcidsk_io.obj gdal_edb.obj \ - sdk\blockdir\asciitiledir.obj \ -@@ -70,11 +74,13 @@ OBJ = pcidskdataset2.obj ogrpcidsklayer.obj vsi_pcidsk_io.obj gdal_edb.obj \ - - !ENDIF - -+!IFDEF JPEG_SUPPORTED - !IFDEF JPEG_EXTERNAL_LIB - JPEGFLAGS = -I$(JPEGDIR) - !ELSE - JPEGFLAGS = -I..\jpeg\libjpeg - !ENDIF -+!ENDIF - - .cpp.obj: - $(CC) $(CFLAGS) $(PCIDSKFLAGS) $(JPEGFLAGS) /c $*.cpp /Fo$*.obj ---- a/makefile.vc -+++ b/makefile.vc -@@ -84,7 +84,7 @@ staticlib: $(LIB_DEPENDS) - call <=2.6.2 <3]") + self.requires("openjpeg/2.5.2") if self.options.with_zlibng: self.requires("zlib-ng/2.1.6") else: self.requires("zlib/[>=1.2.11 <2]") if self.settings.os != "Windows": - self.requires("util-linux-libuuid/2.39") + self.requires("util-linux-libuuid/2.39.2") if Version(self.version) >= Version("3.0.20"): self.requires("libiconv/1.17") if self.options.with_json: diff --git a/recipes/gdcm/all/patches/0006-3.0.24-json.patch b/recipes/gdcm/all/patches/0006-3.0.24-json.patch new file mode 100644 index 0000000000000..6aa3414ba7c29 --- /dev/null +++ b/recipes/gdcm/all/patches/0006-3.0.24-json.patch @@ -0,0 +1,13 @@ +--- a/Source/Common/CMakeLists.txt ++++ b/Source/Common/CMakeLists.txt +@@ -52,9 +52,7 @@ unset(CMAKE_REQUIRED_LIBRARIES) + CHECK_SYMBOL_EXISTS(gettimeofday "sys/time.h" GDCM_HAVE_GETTIMEOFDAY) + # json-c API changed: + if(GDCM_USE_SYSTEM_JSON) +- set(CMAKE_REQUIRED_INCLUDES ${JSON_INCLUDE_DIRS}) +- set(CMAKE_REQUIRED_LIBRARIES ${JSON_LIBRARIES}) +- CHECK_SYMBOL_EXISTS(json_object_object_get_ex "json.h" GDCM_HAVE_JSON_OBJECT_OBJECT_GET_EX) ++ set(GDCM_HAVE_JSON_OBJECT_OBJECT_GET_EX ON CACHE INTERNAL "") + endif() + + include(CheckCXXSourceCompiles) diff --git a/recipes/gdcm/all/test_package/DCMTK_JPEGExt_12Bits.dcm b/recipes/gdcm/all/test_package/DCMTK_JPEGExt_12Bits.dcm deleted file mode 100644 index a38d4be8214fc..0000000000000 Binary files a/recipes/gdcm/all/test_package/DCMTK_JPEGExt_12Bits.dcm and /dev/null differ diff --git a/recipes/gdcm/all/test_package/conanfile.py b/recipes/gdcm/all/test_package/conanfile.py index 68791e0d3201c..09886ae651d09 100644 --- a/recipes/gdcm/all/test_package/conanfile.py +++ b/recipes/gdcm/all/test_package/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.files import mkdir import os + class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" @@ -23,8 +24,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindir, "test_package") - input_file = os.path.join(self.source_folder, "DCMTK_JPEGExt_12Bits.dcm") - test_dir = "test_dir" - mkdir(self, test_dir) - output_file = os.path.join(test_dir, "output.dcm") - self.run(f"\"{bin_path}\" \"{input_file}\" \"{output_file}\"", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/gdcm/all/test_package/test_package.cpp b/recipes/gdcm/all/test_package/test_package.cpp index 38a0b1316570a..3e8750a344529 100644 --- a/recipes/gdcm/all/test_package/test_package.cpp +++ b/recipes/gdcm/all/test_package/test_package.cpp @@ -1,104 +1,8 @@ -/*========================================================================= - - Program: GDCM (Grassroots DICOM). A DICOM library - - Copyright (c) 2006-2011 Mathieu Malaterre - All rights reserved. - See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ -/* - * This example is ... guess what this is for :) - */ - #include "gdcmReader.h" -#include "gdcmUIDGenerator.h" -#include "gdcmWriter.h" -#include "gdcmAttribute.h" - -#include - -#ifdef GDCM_USE_SYSTEM_OPENSSL -#include "gdcmCryptoFactory.h" -void test_openssl_link() -{ - (void)gdcm::CryptoFactory::GetFactoryInstance(gdcm::CryptoFactory::OPENSSL); -} -#endif - -#ifdef GDCM_USE_SYSTEM_JSON -#include "gdcmJSON.h" -void test_json_link() -{ - gdcm::JSON json; - json.PrettyPrintOn(); -} -#endif -bool test_uid() +int main() { - gdcm::UIDGenerator uid; - uid.SetRoot( "1.2.3.4.0.0.1" ); - const char *s = uid.Generate(); - return gdcm::UIDGenerator::IsValid(s); -} - -int main(int argc, char* argv[]) -{ - if (argc < 3) - { - std::cerr << argv[0] << " input.dcm output.dcm" << std::endl; - return 1; - } - const char* filename = argv[1]; - const char* outfilename = argv[2]; - - // Instanciate the reader: gdcm::Reader reader; - reader.SetFileName(filename); - if (!reader.Read()) - { - std::cerr << "Could not read: " << filename << std::endl; - return 1; - } - - // If we reach here, we know for sure only 1 thing: - // It is a valid DICOM file (potentially an old ACR-NEMA 1.0/2.0 file) - // (Maybe, it's NOT a Dicom image -could be a DICOMDIR, a RTSTRUCT, etc-) - - // The output of gdcm::Reader is a gdcm::File - gdcm::File& file = reader.GetFile(); - - // the dataset is the the set of element we are interested in: - gdcm::DataSet& ds = file.GetDataSet(); - - // Contruct a static(*) type for Image Comments : - gdcm::Attribute<0x0020, 0x4000> imagecomments; - imagecomments.SetValue("Hello, World !"); - - // Now replace the Image Comments from the dataset with our: - ds.Replace(imagecomments.GetAsDataElement()); - - // Write the modified DataSet back to disk - gdcm::Writer writer; - writer.CheckFileMetaInformationOff(); // Do not attempt to reconstruct the file meta to preserve the file - // as close to the original as possible. - writer.SetFileName(outfilename); - writer.SetFile(file); - if (!writer.Write()) - { - std::cerr << "Could not write: " << outfilename << std::endl; - return 1; - } - std::cout << "GDCM test: success\n"; + reader.SetFileName("myFileName"); return 0; } - -/* - * (*) static type, means that extra DICOM information VR & VM are computed at compilation time. - * The compiler is deducing those values from the template arguments of the class. - */ diff --git a/recipes/gdcm/all/test_v1_package/conanfile.py b/recipes/gdcm/all/test_v1_package/conanfile.py index a38d3dbb55dca..097d728c9571f 100644 --- a/recipes/gdcm/all/test_v1_package/conanfile.py +++ b/recipes/gdcm/all/test_v1_package/conanfile.py @@ -16,8 +16,4 @@ def build(self): def test(self): if not cross_building(self): bin_path = os.path.join("bin", "test_package") - input_file = os.path.join(self.source_folder, os.pardir, "test_package", "DCMTK_JPEGExt_12Bits.dcm") - test_dir = "test_dir" - mkdir(self, test_dir) - output_file = os.path.join(test_dir, "output.dcm") - self.run([bin_path, input_file, output_file], run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/gdcm/config.yml b/recipes/gdcm/config.yml index 2cf37e22fa2ab..3820bf3dda38c 100644 --- a/recipes/gdcm/config.yml +++ b/recipes/gdcm/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.24": + folder: "all" "3.0.23": folder: "all" "3.0.22": diff --git a/recipes/gegles-spdlog_setup/all/conanfile.py b/recipes/gegles-spdlog_setup/all/conanfile.py index 0d3d8a4382c9e..5724281400475 100644 --- a/recipes/gegles-spdlog_setup/all/conanfile.py +++ b/recipes/gegles-spdlog_setup/all/conanfile.py @@ -39,7 +39,7 @@ def layout(self): def requirements(self): self.requires("cpptoml/0.1.1") - self.requires("spdlog/1.13.0") + self.requires("spdlog/1.14.1") self.requires("fmt/10.2.1") def package_id(self): diff --git a/recipes/geographiclib/all/conanfile.py b/recipes/geographiclib/all/conanfile.py index 0fb1787e60859..9f1c405b1f7f1 100644 --- a/recipes/geographiclib/all/conanfile.py +++ b/recipes/geographiclib/all/conanfile.py @@ -3,10 +3,11 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import ( - apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, - replace_in_file, rm, rmdir + apply_conandata_patches, copy, export_conandata_patches, get, + replace_in_file, rm, rmdir, collect_libs ) from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc import os required_conan_version = ">=1.53.0" @@ -105,11 +106,6 @@ def _patch_sources(self): replace_in_file(self, cmakelists, "add_subdirectory (js)", "") # Don't install system libs replace_in_file(self, cmakelists, "include (InstallRequiredSystemLibraries)", "") - # Don't build tools if asked - if not self.options.tools: - replace_in_file(self, cmakelists, "add_subdirectory (tools)", "") - replace_in_file(self, os.path.join(self.source_folder, "cmake", "CMakeLists.txt"), - "${TOOLS}", "") # Disable -Werror replace_in_file(self, cmakelists, "-Werror", "") replace_in_file(self, cmakelists, "/WX", "") @@ -132,13 +128,24 @@ def package(self): ]: rmdir(self, os.path.join(os.path.join(self.package_folder, folder))) rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if not self.options.tools: + rmdir(self, os.path.join(self.package_folder, "sbin")) + bin_files = [it for it in os.listdir(os.path.join(self.package_folder, "bin")) if not it.endswith(".dll")] + for it in bin_files: + rm(self, it, os.path.join(self.package_folder, "bin")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "geographiclib") self.cpp_info.set_property("cmake_target_name", "GeographicLib::GeographicLib") self.cpp_info.set_property("pkg_config_name", "geographiclib") + # Geographic library name is GeographicLib since version 2.x (was Geographic before) + # It uses a debug postfix _d on Windows or when using multi-configuration generators (like Ninja Multi-Config) + # It's hard to track when using multi-configuration generators, so collect_libs is used + # Plus, it adds -i postfix on Windows when using shared libraries self.cpp_info.libs = collect_libs(self) self.cpp_info.defines.append("GEOGRAPHICLIB_SHARED_LIB={}".format("1" if self.options.shared else "0")) + if 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.filenames["cmake_find_package"] = "geographiclib" diff --git a/recipes/gettext/all/conandata.yml b/recipes/gettext/all/conandata.yml index 71a50d966129d..cc749fa1165fe 100644 --- a/recipes/gettext/all/conandata.yml +++ b/recipes/gettext/all/conandata.yml @@ -24,6 +24,9 @@ patches: patch_description: "apply the __atribute_noreturn__ to print_and_abort" patch_source: "https://github.com/coreutils/gnulib/commit/0cc39712803ade7b2d4b89c36b143dad72404063" patch_type: "conan" + - patch_file: "patches/0.21-include-stdlib_h.patch" + patch_description: "include stdlib.h for newer gcc" + patch_type: "portability" "0.20.1": - patch_file: "patches/0.20.1-0001-fix-build-errors-with-MSVC.patch" - patch_file: "patches/0.20.1-0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch" diff --git a/recipes/gettext/all/conanfile.py b/recipes/gettext/all/conanfile.py index 90ff82b6775b1..03a7b60fc24c2 100644 --- a/recipes/gettext/all/conanfile.py +++ b/recipes/gettext/all/conanfile.py @@ -91,6 +91,13 @@ def generate(self): 'ac_cv_func_memset=yes' ]) + # Skip checking for the 'n' printf format directly + # in msvc, as it is known to not be available due to security concerns. + # Skipping it avoids a GUI prompt during ./configure for a debug build + # See https://github.com/conan-io/conan-center-index/issues/23698] + if self.settings.build_type == "Debug": + tc.configure_args.extend(['gl_cv_func_printf_directive_n=no']) + # The flag above `--with-libiconv-prefix` fails to correctly detect libiconv on windows+msvc # so it needs an extra nudge. We could use `AutotoolsDeps` but it's currently affected by the # following outstanding issue: https://github.com/conan-io/conan/issues/12784 diff --git a/recipes/gettext/all/patches/0.21-include-stdlib_h.patch b/recipes/gettext/all/patches/0.21-include-stdlib_h.patch new file mode 100644 index 0000000000000..721436bc3f295 --- /dev/null +++ b/recipes/gettext/all/patches/0.21-include-stdlib_h.patch @@ -0,0 +1,12 @@ +diff --git a/gettext-tools/src/locating-rule.c b/gettext-tools/src/locating-rule.c +index 15faee1..66ec48a 100644 +--- a/gettext-tools/src/locating-rule.c ++++ b/gettext-tools/src/locating-rule.c +@@ -47,6 +47,7 @@ + #include + #include + #include "xalloc.h" ++#include + + #define _(str) gettext (str) + diff --git a/recipes/giflib/5.1.x/conanfile.py b/recipes/giflib/5.1.x/conanfile.py index 9853dbf433ace..ea0071d4e3468 100644 --- a/recipes/giflib/5.1.x/conanfile.py +++ b/recipes/giflib/5.1.x/conanfile.py @@ -1,19 +1,27 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os import shutil -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import chdir, copy, get, rename, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path + +required_conan_version = ">=1.53.0" class GiflibConan(ConanFile): name = "giflib" description = "A library and utilities for reading and writing GIF images." - url = "https://github.com/conan-io/conan-center-index" license = "MIT" + url = "https://github.com/conan-io/conan-center-index" homepage = "http://giflib.sourceforge.net" - topics = ("giflib", "image", "multimedia", "format", "graphics") + topics = ("image", "multimedia", "format", "graphics") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,25 +32,16 @@ class GiflibConan(ConanFile): "fPIC": True, } - # The exported files I took them from https://github.com/bjornblissing/osg-3rdparty-cmake/tree/master/giflib - # refactored a little - exports_sources = ["unistd.h", "gif_lib.h"] - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) - @property - def _user_info_build(self): - return getattr(self, "user_info_build", self.deps_user_info) + def export_sources(self): + # The exported files I took them from + # https://github.com/bjornblissing/osg-3rdparty-cmake/tree/master/giflib + # refactored a little + copy(self, "unistd.h", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "gif_lib.h", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -50,110 +49,100 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") def build_requirements(self): - if not self._is_msvc: - self.build_requires("gnu-config/cci.20201022") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + if not is_msvc(self): + self.tool_requires("gnu-config/cci.20210814") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + if is_msvc(self): + tc.extra_defines.append("USE_GIF_DLL" if self.options.shared else "USE_GIF_LIB") + tc.extra_cflags.append("-FS") + tc.generate() + + if is_msvc(self): + env = Environment() + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + # ar-lib wrapper is added by ./configure automatically + # env.define("AR", f'{ar_wrapper} "lib -nologo"') + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_msvc") + + def _patch_sources(self): + # disable util build - tools and internal libs + replace_in_file(self, os.path.join(self.source_folder, "Makefile.in"), + "SUBDIRS = lib util pic $(am__append_1)", + "SUBDIRS = lib pic $(am__append_1)") + + if is_msvc(self): + # add unistd.h for VS + shutil.copy(os.path.join(self.export_sources_folder, "unistd.h"), + os.path.join(self.source_folder, "lib")) + # fully replace gif_lib.h for VS, with patched version + ver_components = self.version.split(".") + header_path = os.path.join(self.source_folder, "lib", "gif_lib.h") + shutil.copy(os.path.join(self.export_sources_folder, "gif_lib.h"), header_path) + replace_in_file(self, header_path, "@GIFLIB_MAJOR@", ver_components[0]) + replace_in_file(self, header_path, "@GIFLIB_MINOR@", ver_components[1]) + replace_in_file(self, header_path, "@GIFLIB_RELEASE@", ver_components[2]) + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str) + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + if is_apple_os(self): + # relocatable shared lib on macOS + replace_in_file(self, os.path.join(self.source_folder, "configure"), + "-install_name \\$rpath/\\$soname", + "-install_name \\@rpath/\\$soname") def build(self): - # disable util build - tools and internal libs - tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.in"), - "SUBDIRS = lib util pic $(am__append_1)", - "SUBDIRS = lib pic $(am__append_1)") - - if self._is_msvc: - self.build_visual() - else: - self.build_configure() - - def build_visual(self): - # fully replace gif_lib.h for VS, with patched version - ver_components = self.version.split(".") - tools.replace_in_file("gif_lib.h", "@GIFLIB_MAJOR@", ver_components[0]) - tools.replace_in_file("gif_lib.h", "@GIFLIB_MINOR@", ver_components[1]) - tools.replace_in_file("gif_lib.h", "@GIFLIB_RELEASE@", ver_components[2]) - shutil.copy("gif_lib.h", os.path.join(self._source_subfolder, "lib")) - # add unistd.h for VS - shutil.copy("unistd.h", os.path.join(self._source_subfolder, "lib")) - - with tools.chdir(self._source_subfolder): - if self.settings.arch == "x86": - host = "i686-w64-mingw32" - elif self.settings.arch == "x86_64": - host = "x86_64-w64-mingw32" - else: - raise ConanInvalidConfiguration("unsupported architecture %s" % self.settings.arch) - if self.options.shared: - options = "--disable-static --enable-shared" - else: - options = "--enable-static --disable-shared" - - cflags = "" - if not self.options.shared: - cflags = "-DUSE_GIF_LIB" - - prefix = tools.unix_path(os.path.abspath(self.package_folder)) - with tools.vcvars(self.settings): - command = "./configure " \ - "{options} " \ - "--host={host} " \ - "--prefix={prefix} " \ - 'CC="$PWD/compile cl -nologo" ' \ - 'CFLAGS="-{runtime} {cflags}" ' \ - 'CXX="$PWD/compile cl -nologo" ' \ - 'CXXFLAGS="-{runtime} {cflags}" ' \ - 'CPPFLAGS="-I{prefix}/include" ' \ - 'LDFLAGS="-L{prefix}/lib" ' \ - 'LD="link" ' \ - 'NM="dumpbin -symbols" ' \ - 'STRIP=":" ' \ - 'AR="$PWD/ar-lib lib" ' \ - 'RANLIB=":" '.format(host=host, prefix=prefix, options=options, - runtime=self.settings.compiler.runtime, cflags=cflags) - self.run(command, win_bash=True) - self.run("make", win_bash=True) - self.run("make install", win_bash=True) - - def build_configure(self): - shutil.copy(self._user_info_build["gnu-config"].CONFIG_SUB, - os.path.join(self._source_subfolder, "config.sub")) - shutil.copy(self._user_info_build["gnu-config"].CONFIG_GUESS, - os.path.join(self._source_subfolder, "config.guess")) - env_build = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - yes_no = lambda v: "yes" if v else "no" - args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - ] - with tools.chdir(self._source_subfolder): - if tools.is_apple_os(self.settings.os): - # relocatable shared lib on macOS - tools.replace_in_file( - "configure", - "-install_name \\$rpath/\\$soname", - "-install_name \\@rpath/\\$soname" - ) - - self.run("chmod +x configure") - env_build.configure(args=args) - env_build.make() - env_build.make(args=["install"]) + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy(pattern="COPYING*", dst="licenses", src=self._source_subfolder, ignore_case=True, keep_path=False) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "share")) - if self._is_msvc and self.options.shared: - tools.rename(os.path.join(self.package_folder, "lib", "gif.dll.lib"), + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + copy(self, "COPYING*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, keep_path=False) + rm(self, "*.la", self.package_folder, recursive=True) + rmdir(self, os.path.join(self.package_folder, "share")) + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "gif.dll.lib"), os.path.join(self.package_folder, "lib", "gif.lib")) def package_info(self): @@ -161,9 +150,10 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "GIF") self.cpp_info.set_property("cmake_target_name", "GIF::GIF") - self.cpp_info.names["cmake_find_package"] = "GIF" - self.cpp_info.names["cmake_find_package_multi"] = "GIF" - self.cpp_info.libs = ["gif"] - if self._is_msvc: + if is_msvc(self): self.cpp_info.defines.append("USE_GIF_DLL" if self.options.shared else "USE_GIF_LIB") + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "GIF" + self.cpp_info.names["cmake_find_package_multi"] = "GIF" diff --git a/recipes/giflib/5.1.x/test_package/CMakeLists.txt b/recipes/giflib/5.1.x/test_package/CMakeLists.txt index 95fca5bec20b2..b39dc8b19722d 100644 --- a/recipes/giflib/5.1.x/test_package/CMakeLists.txt +++ b/recipes/giflib/5.1.x/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(GIF REQUIRED) +find_package(GIF REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} GIF::GIF) diff --git a/recipes/giflib/5.1.x/test_package/conanfile.py b/recipes/giflib/5.1.x/test_package/conanfile.py index 9c22b9663e80c..77c3c08f8b8ed 100644 --- a/recipes/giflib/5.1.x/test_package/conanfile.py +++ b/recipes/giflib/5.1.x/test_package/conanfile.py @@ -1,19 +1,29 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) def build_requirements(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": + if is_apple_os(self) and self.settings.arch == "armv8": # Workaround for CMake bug with error message: # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being # set. This could be because you are using a Mac OS X version less than 10.5 # or because CMake's platform configuration is corrupt. # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. - self.build_requires("cmake/3.22.0") + self.tool_requires("cmake/[>=3.22]") + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -21,8 +31,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): img_name = os.path.join(self.source_folder, "testimg.gif") - bin_path = os.path.join("bin", "test_package") - command = "{} {}".format(bin_path, img_name) - self.run(command, run_environment=True) + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(f"{bin_path} {img_name}", env="conanrun") diff --git a/recipes/giflib/5.1.x/test_v1_package/CMakeLists.txt b/recipes/giflib/5.1.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/giflib/5.1.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/giflib/5.1.x/test_v1_package/conanfile.py b/recipes/giflib/5.1.x/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2b12681e5d894 --- /dev/null +++ b/recipes/giflib/5.1.x/test_v1_package/conanfile.py @@ -0,0 +1,29 @@ +from conan.tools.apple import is_apple_os +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build_requirements(self): + if is_apple_os(self) and self.settings.arch == "armv8": + # Workaround for CMake bug with error message: + # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being + # set. This could be because you are using a Mac OS X version less than 10.5 + # or because CMake's platform configuration is corrupt. + # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. + self.build_requires("cmake/3.22.0") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + img_name = os.path.join(self.source_folder, "testimg.gif") + bin_path = os.path.join("bin", "test_package") + command = "{} {}".format(bin_path, img_name) + self.run(command, run_environment=True) diff --git a/recipes/giflib/5.2.x/conandata.yml b/recipes/giflib/5.2.x/conandata.yml index e36e2cd9d7be2..ea8a0bcf52687 100644 --- a/recipes/giflib/5.2.x/conandata.yml +++ b/recipes/giflib/5.2.x/conandata.yml @@ -1,7 +1,21 @@ sources: + "5.2.2": + url: "https://downloads.sourceforge.net/project/giflib/giflib-5.2.2.tar.gz" + sha256: "be7ffbd057cadebe2aa144542fd90c6838c6a083b5e8a9048b8ee3b66b29d5fb" "5.2.1": url: "https://downloads.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz" sha256: "31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd" patches: + "5.2.2": + - patch_file: "patches/0000-msvc-strtok_r.patch" + patch_description: "Use strtok_s instead of strtok_r with MSVC" + patch_type: "portability" + - patch_file: "patches/5.2.2-0001-msvc-export.patch" + patch_description: "export symbols with MSVC" + patch_type: "portability" "5.2.1": + - patch_file: "patches/0000-msvc-strtok_r.patch" + patch_description: "Use strtok_s instead of strtok_r with MSVC" + patch_type: "portability" - patch_file: "patches/0001-msvc-unistd.patch" + - patch_file: "patches/5.2.1-0002-msvc-export.patch" diff --git a/recipes/giflib/5.2.x/patches/0000-msvc-strtok_r.patch b/recipes/giflib/5.2.x/patches/0000-msvc-strtok_r.patch new file mode 100644 index 0000000000000..e9b7a0f9661b8 --- /dev/null +++ b/recipes/giflib/5.2.x/patches/0000-msvc-strtok_r.patch @@ -0,0 +1,15 @@ +diff --git a/gif_font.c b/gif_font.c +index d90783c..0fd20ed 100644 +--- a/gif_font.c ++++ b/gif_font.c +@@ -11,6 +11,10 @@ SPDX-License-Identifier: MIT + + #include "gif_lib.h" + ++#ifdef _MSC_VER ++# define strtok_r strtok_s ++#endif ++ + /***************************************************************************** + Ascii 8 by 8 regular font - only first 128 characters are supported. + *****************************************************************************/ diff --git a/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch b/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch index 05112f7bfb6f7..1a777f5c69b47 100644 --- a/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch +++ b/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch @@ -1,18 +1,3 @@ -diff --git a/gif_font.c b/gif_font.c -index d90783c..0fd20ed 100644 ---- a/gif_font.c -+++ b/gif_font.c -@@ -11,6 +11,10 @@ SPDX-License-Identifier: MIT - - #include "gif_lib.h" - -+#ifdef _MSC_VER -+# define strtok_r strtok_s -+#endif -+ - /***************************************************************************** - Ascii 8 by 8 regular font - only first 128 characters are supported. - *****************************************************************************/ diff --git a/gif_hash.h b/gif_hash.h index 6a1b585..6311cd1 100644 --- a/gif_hash.h @@ -29,233 +14,3 @@ index 6a1b585..6311cd1 100644 #include #define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */ -diff --git a/gif_lib.h b/gif_lib.h -index ebdbd3c..bf0d373 100644 ---- a/gif_lib.h -+++ b/gif_lib.h -@@ -13,6 +13,20 @@ SPDX-License-Identifier: MIT - extern "C" { - #endif /* __cplusplus */ - -+#ifdef _MSC_VER -+ #ifdef USE_GIF_LIB -+ #define GIF_EXPORT -+ #else /* USE_GIF_LIB */ -+ #ifdef USE_GIF_DLL -+ #define GIF_EXPORT __declspec(dllimport) -+ #else /* USE_GIF_DLL */ -+ #define GIF_EXPORT __declspec(dllexport) -+ #endif /* USE_GIF_DLL */ -+ #endif /* USE_GIF_LIB */ -+#else -+ #define GIF_EXPORT -+#endif /* _MSC_VER */ -+ - #define GIFLIB_MAJOR 5 - #define GIFLIB_MINOR 2 - #define GIFLIB_RELEASE 1 -@@ -125,13 +139,13 @@ typedef struct GraphicsControlBlock { - ******************************************************************************/ - - /* Main entry points */ --GifFileType *EGifOpenFileName(const char *GifFileName, -+GIF_EXPORT GifFileType *EGifOpenFileName(const char *GifFileName, - const bool GifTestExistence, int *Error); --GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); --GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); --int EGifSpew(GifFileType * GifFile); --const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ --int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); -+GIF_EXPORT GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); -+GIF_EXPORT GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); -+GIF_EXPORT int EGifSpew(GifFileType * GifFile); -+GIF_EXPORT const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ -+GIF_EXPORT int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); - - #define E_GIF_SUCCEEDED 0 - #define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ -@@ -146,31 +160,31 @@ int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); - #define E_GIF_ERR_NOT_WRITEABLE 10 - - /* These are legacy. You probably do not want to call them directly */ --int EGifPutScreenDesc(GifFileType *GifFile, -+GIF_EXPORT int EGifPutScreenDesc(GifFileType *GifFile, - const int GifWidth, const int GifHeight, - const int GifColorRes, - const int GifBackGround, - const ColorMapObject *GifColorMap); --int EGifPutImageDesc(GifFileType *GifFile, -+GIF_EXPORT int EGifPutImageDesc(GifFileType *GifFile, - const int GifLeft, const int GifTop, - const int GifWidth, const int GifHeight, - const bool GifInterlace, - const ColorMapObject *GifColorMap); --void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); --int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, -+GIF_EXPORT void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); -+GIF_EXPORT int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, - int GifLineLen); --int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); --int EGifPutComment(GifFileType *GifFile, const char *GifComment); --int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); --int EGifPutExtensionBlock(GifFileType *GifFile, -+GIF_EXPORT int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); -+GIF_EXPORT int EGifPutComment(GifFileType *GifFile, const char *GifComment); -+GIF_EXPORT int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); -+GIF_EXPORT int EGifPutExtensionBlock(GifFileType *GifFile, - const int GifExtLen, const void *GifExtension); --int EGifPutExtensionTrailer(GifFileType *GifFile); --int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, -+GIF_EXPORT int EGifPutExtensionTrailer(GifFileType *GifFile); -+GIF_EXPORT int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, - const int GifExtLen, - const void *GifExtension); --int EGifPutCode(GifFileType *GifFile, int GifCodeSize, -+GIF_EXPORT int EGifPutCode(GifFileType *GifFile, int GifCodeSize, - const GifByteType *GifCodeBlock); --int EGifPutCodeNext(GifFileType *GifFile, -+GIF_EXPORT int EGifPutCodeNext(GifFileType *GifFile, - const GifByteType *GifCodeBlock); - - /****************************************************************************** -@@ -178,11 +192,11 @@ int EGifPutCodeNext(GifFileType *GifFile, - ******************************************************************************/ - - /* Main entry points */ --GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); --GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); --int DGifSlurp(GifFileType * GifFile); --GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ -- int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); -+GIF_EXPORT GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); -+GIF_EXPORT GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); -+GIF_EXPORT int DGifSlurp(GifFileType * GifFile); -+GIF_EXPORT GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ -+GIF_EXPORT int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); - - #define D_GIF_SUCCEEDED 0 - #define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ -@@ -200,26 +214,26 @@ GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new - #define D_GIF_ERR_EOF_TOO_SOON 113 - - /* These are legacy. You probably do not want to call them directly */ --int DGifGetScreenDesc(GifFileType *GifFile); --int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); --int DGifGetImageHeader(GifFileType *GifFile); --int DGifGetImageDesc(GifFileType *GifFile); --int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); --int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); --int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, -+GIF_EXPORT int DGifGetScreenDesc(GifFileType *GifFile); -+GIF_EXPORT int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); -+GIF_EXPORT int DGifGetImageHeader(GifFileType *GifFile); -+GIF_EXPORT int DGifGetImageDesc(GifFileType *GifFile); -+GIF_EXPORT int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); -+GIF_EXPORT int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); -+GIF_EXPORT int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, - GifByteType **GifExtension); --int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); --int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, -+GIF_EXPORT int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); -+GIF_EXPORT int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, - GifByteType **GifCodeBlock); --int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); --int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); --const char *DGifGetGifVersion(GifFileType *GifFile); -+GIF_EXPORT int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); -+GIF_EXPORT int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); -+GIF_EXPORT const char *DGifGetGifVersion(GifFileType *GifFile); - - - /****************************************************************************** - Error handling and reporting. - ******************************************************************************/ --extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ -+GIF_EXPORT extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ - - /***************************************************************************** - Everything below this point is new after version 1.2, supporting `slurp -@@ -230,43 +244,43 @@ extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ - Color map handling from gif_alloc.c - ******************************************************************************/ - --extern ColorMapObject *GifMakeMapObject(int ColorCount, -+GIF_EXPORT extern ColorMapObject *GifMakeMapObject(int ColorCount, - const GifColorType *ColorMap); --extern void GifFreeMapObject(ColorMapObject *Object); --extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, -+GIF_EXPORT extern void GifFreeMapObject(ColorMapObject *Object); -+GIF_EXPORT extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, - const ColorMapObject *ColorIn2, - GifPixelType ColorTransIn2[]); --extern int GifBitSize(int n); -+GIF_EXPORT extern int GifBitSize(int n); - - /****************************************************************************** - Support for the in-core structures allocation (slurp mode). - ******************************************************************************/ - --extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); --extern int GifAddExtensionBlock(int *ExtensionBlock_Count, -+GIF_EXPORT extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); -+GIF_EXPORT extern int GifAddExtensionBlock(int *ExtensionBlock_Count, - ExtensionBlock **ExtensionBlocks, - int Function, - unsigned int Len, unsigned char ExtData[]); --extern void GifFreeExtensions(int *ExtensionBlock_Count, -+GIF_EXPORT extern void GifFreeExtensions(int *ExtensionBlock_Count, - ExtensionBlock **ExtensionBlocks); --extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, -+GIF_EXPORT extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, - const SavedImage *CopyFrom); --extern void GifFreeSavedImages(GifFileType *GifFile); -+GIF_EXPORT extern void GifFreeSavedImages(GifFileType *GifFile); - - /****************************************************************************** - 5.x functions for GIF89 graphics control blocks - ******************************************************************************/ - --int DGifExtensionToGCB(const size_t GifExtensionLength, -+GIF_EXPORT int DGifExtensionToGCB(const size_t GifExtensionLength, - const GifByteType *GifExtension, - GraphicsControlBlock *GCB); --size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, -+GIF_EXPORT size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, - GifByteType *GifExtension); - --int DGifSavedExtensionToGCB(GifFileType *GifFile, -+GIF_EXPORT int DGifSavedExtensionToGCB(GifFileType *GifFile, - int ImageIndex, - GraphicsControlBlock *GCB); --int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, -+GIF_EXPORT int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, - GifFileType *GifFile, - int ImageIndex); - -@@ -276,21 +290,21 @@ int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, - - #define GIF_FONT_WIDTH 8 - #define GIF_FONT_HEIGHT 8 --extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; -+GIF_EXPORT extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; - --extern void GifDrawText8x8(SavedImage *Image, -+GIF_EXPORT extern void GifDrawText8x8(SavedImage *Image, - const int x, const int y, - const char *legend, const int color); - --extern void GifDrawBox(SavedImage *Image, -+GIF_EXPORT extern void GifDrawBox(SavedImage *Image, - const int x, const int y, - const int w, const int d, const int color); - --extern void GifDrawRectangle(SavedImage *Image, -+GIF_EXPORT extern void GifDrawRectangle(SavedImage *Image, - const int x, const int y, - const int w, const int d, const int color); - --extern void GifDrawBoxedText8x8(SavedImage *Image, -+GIF_EXPORT extern void GifDrawBoxedText8x8(SavedImage *Image, - const int x, const int y, - const char *legend, - const int border, const int bg, const int fg); diff --git a/recipes/giflib/5.2.x/patches/5.2.1-0002-msvc-export.patch b/recipes/giflib/5.2.x/patches/5.2.1-0002-msvc-export.patch new file mode 100644 index 0000000000000..d9383c54a5729 --- /dev/null +++ b/recipes/giflib/5.2.x/patches/5.2.1-0002-msvc-export.patch @@ -0,0 +1,230 @@ +diff --git a/gif_lib.h b/gif_lib.h +index ebdbd3c..bf0d373 100644 +--- a/gif_lib.h ++++ b/gif_lib.h +@@ -13,6 +13,20 @@ SPDX-License-Identifier: MIT + extern "C" { + #endif /* __cplusplus */ + ++#ifdef _MSC_VER ++ #ifdef USE_GIF_LIB ++ #define GIF_EXPORT ++ #else /* USE_GIF_LIB */ ++ #ifdef USE_GIF_DLL ++ #define GIF_EXPORT __declspec(dllimport) ++ #else /* USE_GIF_DLL */ ++ #define GIF_EXPORT __declspec(dllexport) ++ #endif /* USE_GIF_DLL */ ++ #endif /* USE_GIF_LIB */ ++#else ++ #define GIF_EXPORT ++#endif /* _MSC_VER */ ++ + #define GIFLIB_MAJOR 5 + #define GIFLIB_MINOR 2 + #define GIFLIB_RELEASE 1 +@@ -125,13 +139,13 @@ typedef struct GraphicsControlBlock { + ******************************************************************************/ + + /* Main entry points */ +-GifFileType *EGifOpenFileName(const char *GifFileName, ++GIF_EXPORT GifFileType *EGifOpenFileName(const char *GifFileName, + const bool GifTestExistence, int *Error); +-GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); +-GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); +-int EGifSpew(GifFileType * GifFile); +-const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ +-int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); ++GIF_EXPORT GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); ++GIF_EXPORT GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); ++GIF_EXPORT int EGifSpew(GifFileType * GifFile); ++GIF_EXPORT const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ ++GIF_EXPORT int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); + + #define E_GIF_SUCCEEDED 0 + #define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ +@@ -146,31 +160,31 @@ int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); + #define E_GIF_ERR_NOT_WRITEABLE 10 + + /* These are legacy. You probably do not want to call them directly */ +-int EGifPutScreenDesc(GifFileType *GifFile, ++GIF_EXPORT int EGifPutScreenDesc(GifFileType *GifFile, + const int GifWidth, const int GifHeight, + const int GifColorRes, + const int GifBackGround, + const ColorMapObject *GifColorMap); +-int EGifPutImageDesc(GifFileType *GifFile, ++GIF_EXPORT int EGifPutImageDesc(GifFileType *GifFile, + const int GifLeft, const int GifTop, + const int GifWidth, const int GifHeight, + const bool GifInterlace, + const ColorMapObject *GifColorMap); +-void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); +-int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, ++GIF_EXPORT void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); ++GIF_EXPORT int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, + int GifLineLen); +-int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); +-int EGifPutComment(GifFileType *GifFile, const char *GifComment); +-int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); +-int EGifPutExtensionBlock(GifFileType *GifFile, ++GIF_EXPORT int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); ++GIF_EXPORT int EGifPutComment(GifFileType *GifFile, const char *GifComment); ++GIF_EXPORT int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); ++GIF_EXPORT int EGifPutExtensionBlock(GifFileType *GifFile, + const int GifExtLen, const void *GifExtension); +-int EGifPutExtensionTrailer(GifFileType *GifFile); +-int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, ++GIF_EXPORT int EGifPutExtensionTrailer(GifFileType *GifFile); ++GIF_EXPORT int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, + const int GifExtLen, + const void *GifExtension); +-int EGifPutCode(GifFileType *GifFile, int GifCodeSize, ++GIF_EXPORT int EGifPutCode(GifFileType *GifFile, int GifCodeSize, + const GifByteType *GifCodeBlock); +-int EGifPutCodeNext(GifFileType *GifFile, ++GIF_EXPORT int EGifPutCodeNext(GifFileType *GifFile, + const GifByteType *GifCodeBlock); + + /****************************************************************************** +@@ -178,11 +192,11 @@ int EGifPutCodeNext(GifFileType *GifFile, + ******************************************************************************/ + + /* Main entry points */ +-GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); +-GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); +-int DGifSlurp(GifFileType * GifFile); +-GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ +- int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); ++GIF_EXPORT GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); ++GIF_EXPORT GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); ++GIF_EXPORT int DGifSlurp(GifFileType * GifFile); ++GIF_EXPORT GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ ++GIF_EXPORT int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); + + #define D_GIF_SUCCEEDED 0 + #define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ +@@ -200,26 +214,26 @@ GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new + #define D_GIF_ERR_EOF_TOO_SOON 113 + + /* These are legacy. You probably do not want to call them directly */ +-int DGifGetScreenDesc(GifFileType *GifFile); +-int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); +-int DGifGetImageHeader(GifFileType *GifFile); +-int DGifGetImageDesc(GifFileType *GifFile); +-int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); +-int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); +-int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, ++GIF_EXPORT int DGifGetScreenDesc(GifFileType *GifFile); ++GIF_EXPORT int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); ++GIF_EXPORT int DGifGetImageHeader(GifFileType *GifFile); ++GIF_EXPORT int DGifGetImageDesc(GifFileType *GifFile); ++GIF_EXPORT int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); ++GIF_EXPORT int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); ++GIF_EXPORT int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, + GifByteType **GifExtension); +-int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); +-int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, ++GIF_EXPORT int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); ++GIF_EXPORT int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, + GifByteType **GifCodeBlock); +-int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); +-int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); +-const char *DGifGetGifVersion(GifFileType *GifFile); ++GIF_EXPORT int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); ++GIF_EXPORT int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); ++GIF_EXPORT const char *DGifGetGifVersion(GifFileType *GifFile); + + + /****************************************************************************** + Error handling and reporting. + ******************************************************************************/ +-extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ ++GIF_EXPORT extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ + + /***************************************************************************** + Everything below this point is new after version 1.2, supporting `slurp +@@ -230,43 +244,43 @@ extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ + Color map handling from gif_alloc.c + ******************************************************************************/ + +-extern ColorMapObject *GifMakeMapObject(int ColorCount, ++GIF_EXPORT extern ColorMapObject *GifMakeMapObject(int ColorCount, + const GifColorType *ColorMap); +-extern void GifFreeMapObject(ColorMapObject *Object); +-extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, ++GIF_EXPORT extern void GifFreeMapObject(ColorMapObject *Object); ++GIF_EXPORT extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, + const ColorMapObject *ColorIn2, + GifPixelType ColorTransIn2[]); +-extern int GifBitSize(int n); ++GIF_EXPORT extern int GifBitSize(int n); + + /****************************************************************************** + Support for the in-core structures allocation (slurp mode). + ******************************************************************************/ + +-extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); +-extern int GifAddExtensionBlock(int *ExtensionBlock_Count, ++GIF_EXPORT extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); ++GIF_EXPORT extern int GifAddExtensionBlock(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks, + int Function, + unsigned int Len, unsigned char ExtData[]); +-extern void GifFreeExtensions(int *ExtensionBlock_Count, ++GIF_EXPORT extern void GifFreeExtensions(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks); +-extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, ++GIF_EXPORT extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, + const SavedImage *CopyFrom); +-extern void GifFreeSavedImages(GifFileType *GifFile); ++GIF_EXPORT extern void GifFreeSavedImages(GifFileType *GifFile); + + /****************************************************************************** + 5.x functions for GIF89 graphics control blocks + ******************************************************************************/ + +-int DGifExtensionToGCB(const size_t GifExtensionLength, ++GIF_EXPORT int DGifExtensionToGCB(const size_t GifExtensionLength, + const GifByteType *GifExtension, + GraphicsControlBlock *GCB); +-size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, ++GIF_EXPORT size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, + GifByteType *GifExtension); + +-int DGifSavedExtensionToGCB(GifFileType *GifFile, ++GIF_EXPORT int DGifSavedExtensionToGCB(GifFileType *GifFile, + int ImageIndex, + GraphicsControlBlock *GCB); +-int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, ++GIF_EXPORT int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, + GifFileType *GifFile, + int ImageIndex); + +@@ -276,21 +290,21 @@ int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, + + #define GIF_FONT_WIDTH 8 + #define GIF_FONT_HEIGHT 8 +-extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; ++GIF_EXPORT extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; + +-extern void GifDrawText8x8(SavedImage *Image, ++GIF_EXPORT extern void GifDrawText8x8(SavedImage *Image, + const int x, const int y, + const char *legend, const int color); + +-extern void GifDrawBox(SavedImage *Image, ++GIF_EXPORT extern void GifDrawBox(SavedImage *Image, + const int x, const int y, + const int w, const int d, const int color); + +-extern void GifDrawRectangle(SavedImage *Image, ++GIF_EXPORT extern void GifDrawRectangle(SavedImage *Image, + const int x, const int y, + const int w, const int d, const int color); + +-extern void GifDrawBoxedText8x8(SavedImage *Image, ++GIF_EXPORT extern void GifDrawBoxedText8x8(SavedImage *Image, + const int x, const int y, + const char *legend, + const int border, const int bg, const int fg); diff --git a/recipes/giflib/5.2.x/patches/5.2.2-0001-msvc-export.patch b/recipes/giflib/5.2.x/patches/5.2.2-0001-msvc-export.patch new file mode 100644 index 0000000000000..bdeb9f0885c6a --- /dev/null +++ b/recipes/giflib/5.2.x/patches/5.2.2-0001-msvc-export.patch @@ -0,0 +1,220 @@ +diff --git a/gif_lib.h b/gif_lib.h +--- a/gif_lib.h ++++ b/gif_lib.h +@@ -13,6 +13,20 @@ + extern "C" { + #endif /* __cplusplus */ + ++#ifdef _MSC_VER ++ #ifdef USE_GIF_LIB ++ #define GIF_EXPORT ++ #else /* USE_GIF_LIB */ ++ #ifdef USE_GIF_DLL ++ #define GIF_EXPORT __declspec(dllimport) ++ #else /* USE_GIF_DLL */ ++ #define GIF_EXPORT __declspec(dllexport) ++ #endif /* USE_GIF_DLL */ ++ #endif /* USE_GIF_LIB */ ++#else ++ #define GIF_EXPORT ++#endif /* _MSC_VER */ ++ + #define GIFLIB_MAJOR 5 + #define GIFLIB_MINOR 2 + #define GIFLIB_RELEASE 2 +@@ -125,13 +139,13 @@ + ******************************************************************************/ + + /* Main entry points */ +-GifFileType *EGifOpenFileName(const char *GifFileName, ++GIF_EXPORT GifFileType *EGifOpenFileName(const char *GifFileName, + const bool GifTestExistence, int *Error); +-GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); +-GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); +-int EGifSpew(GifFileType *GifFile); +-const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ +-int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); ++GIF_EXPORT GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); ++GIF_EXPORT GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); ++GIF_EXPORT int EGifSpew(GifFileType *GifFile); ++GIF_EXPORT const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ ++GIF_EXPORT int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); + + #define E_GIF_SUCCEEDED 0 + #define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ +@@ -146,39 +160,39 @@ + #define E_GIF_ERR_NOT_WRITEABLE 10 + + /* These are legacy. You probably do not want to call them directly */ +-int EGifPutScreenDesc(GifFileType *GifFile, const int GifWidth, ++GIF_EXPORT int EGifPutScreenDesc(GifFileType *GifFile, const int GifWidth, + const int GifHeight, const int GifColorRes, + const int GifBackGround, + const ColorMapObject *GifColorMap); +-int EGifPutImageDesc(GifFileType *GifFile, const int GifLeft, const int GifTop, ++GIF_EXPORT int EGifPutImageDesc(GifFileType *GifFile, const int GifLeft, const int GifTop, + const int GifWidth, const int GifHeight, + const bool GifInterlace, + const ColorMapObject *GifColorMap); +-void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); +-int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); +-int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); +-int EGifPutComment(GifFileType *GifFile, const char *GifComment); +-int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); +-int EGifPutExtensionBlock(GifFileType *GifFile, const int GifExtLen, ++GIF_EXPORT void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); ++GIF_EXPORT int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); ++GIF_EXPORT int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); ++GIF_EXPORT int EGifPutComment(GifFileType *GifFile, const char *GifComment); ++GIF_EXPORT int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); ++GIF_EXPORT int EGifPutExtensionBlock(GifFileType *GifFile, const int GifExtLen, + const void *GifExtension); +-int EGifPutExtensionTrailer(GifFileType *GifFile); +-int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, ++GIF_EXPORT int EGifPutExtensionTrailer(GifFileType *GifFile); ++GIF_EXPORT int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, + const int GifExtLen, const void *GifExtension); +-int EGifPutCode(GifFileType *GifFile, int GifCodeSize, ++GIF_EXPORT int EGifPutCode(GifFileType *GifFile, int GifCodeSize, + const GifByteType *GifCodeBlock); +-int EGifPutCodeNext(GifFileType *GifFile, const GifByteType *GifCodeBlock); ++GIF_EXPORT int EGifPutCodeNext(GifFileType *GifFile, const GifByteType *GifCodeBlock); + + /****************************************************************************** + GIF decoding routines + ******************************************************************************/ + + /* Main entry points */ +-GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); +-GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); +-int DGifSlurp(GifFileType *GifFile); +-GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, ++GIF_EXPORT GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); ++GIF_EXPORT GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); ++GIF_EXPORT int DGifSlurp(GifFileType *GifFile); ++GIF_EXPORT GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, + int *Error); /* new one (TVT) */ +-int DGifCloseFile(GifFileType *GifFile, int *ErrorCode); ++GIF_EXPORT int DGifCloseFile(GifFileType *GifFile, int *ErrorCode); + + #define D_GIF_SUCCEEDED 0 + #define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ +@@ -196,25 +210,25 @@ + #define D_GIF_ERR_EOF_TOO_SOON 113 + + /* These are legacy. You probably do not want to call them directly */ +-int DGifGetScreenDesc(GifFileType *GifFile); +-int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); +-int DGifGetImageHeader(GifFileType *GifFile); +-int DGifGetImageDesc(GifFileType *GifFile); +-int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); +-int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); +-int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, ++GIF_EXPORT int DGifGetScreenDesc(GifFileType *GifFile); ++GIF_EXPORT int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); ++GIF_EXPORT int DGifGetImageHeader(GifFileType *GifFile); ++GIF_EXPORT int DGifGetImageDesc(GifFileType *GifFile); ++GIF_EXPORT int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); ++GIF_EXPORT int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); ++GIF_EXPORT int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, + GifByteType **GifExtension); +-int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); +-int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, ++GIF_EXPORT int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); ++GIF_EXPORT int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, + GifByteType **GifCodeBlock); +-int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); +-int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); +-const char *DGifGetGifVersion(GifFileType *GifFile); ++GIF_EXPORT int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); ++GIF_EXPORT int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); ++GIF_EXPORT const char *DGifGetGifVersion(GifFileType *GifFile); + + /****************************************************************************** + Error handling and reporting. + ******************************************************************************/ +-extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ ++GIF_EXPORT extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ + + /***************************************************************************** + Everything below this point is new after version 1.2, supporting `slurp +@@ -225,42 +239,42 @@ + Color map handling from gif_alloc.c + ******************************************************************************/ + +-extern ColorMapObject *GifMakeMapObject(int ColorCount, ++GIF_EXPORT extern ColorMapObject *GifMakeMapObject(int ColorCount, + const GifColorType *ColorMap); +-extern void GifFreeMapObject(ColorMapObject *Object); +-extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, ++GIF_EXPORT extern void GifFreeMapObject(ColorMapObject *Object); ++GIF_EXPORT extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, + const ColorMapObject *ColorIn2, + GifPixelType ColorTransIn2[]); +-extern int GifBitSize(int n); ++GIF_EXPORT extern int GifBitSize(int n); + + /****************************************************************************** + Support for the in-core structures allocation (slurp mode). + ******************************************************************************/ + +-extern void GifApplyTranslation(SavedImage *Image, ++GIF_EXPORT extern void GifApplyTranslation(SavedImage *Image, + const GifPixelType Translation[]); +-extern int GifAddExtensionBlock(int *ExtensionBlock_Count, ++GIF_EXPORT extern int GifAddExtensionBlock(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks, int Function, + unsigned int Len, unsigned char ExtData[]); +-extern void GifFreeExtensions(int *ExtensionBlock_Count, ++GIF_EXPORT extern void GifFreeExtensions(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks); +-extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, ++GIF_EXPORT extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, + const SavedImage *CopyFrom); +-extern void GifFreeSavedImages(GifFileType *GifFile); ++GIF_EXPORT extern void GifFreeSavedImages(GifFileType *GifFile); + + /****************************************************************************** + 5.x functions for GIF89 graphics control blocks + ******************************************************************************/ + +-int DGifExtensionToGCB(const size_t GifExtensionLength, ++GIF_EXPORT int DGifExtensionToGCB(const size_t GifExtensionLength, + const GifByteType *GifExtension, + GraphicsControlBlock *GCB); +-size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, ++GIF_EXPORT size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, + GifByteType *GifExtension); + +-int DGifSavedExtensionToGCB(GifFileType *GifFile, int ImageIndex, ++GIF_EXPORT int DGifSavedExtensionToGCB(GifFileType *GifFile, int ImageIndex, + GraphicsControlBlock *GCB); +-int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, ++GIF_EXPORT int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, + GifFileType *GifFile, int ImageIndex); + + /****************************************************************************** +@@ -269,18 +283,18 @@ + + #define GIF_FONT_WIDTH 8 + #define GIF_FONT_HEIGHT 8 +-extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; ++GIF_EXPORT extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; + +-extern void GifDrawText8x8(SavedImage *Image, const int x, const int y, ++GIF_EXPORT extern void GifDrawText8x8(SavedImage *Image, const int x, const int y, + const char *legend, const int color); + +-extern void GifDrawBox(SavedImage *Image, const int x, const int y, const int w, ++GIF_EXPORT extern void GifDrawBox(SavedImage *Image, const int x, const int y, const int w, + const int d, const int color); + +-extern void GifDrawRectangle(SavedImage *Image, const int x, const int y, ++GIF_EXPORT extern void GifDrawRectangle(SavedImage *Image, const int x, const int y, + const int w, const int d, const int color); + +-extern void GifDrawBoxedText8x8(SavedImage *Image, const int x, const int y, ++GIF_EXPORT extern void GifDrawBoxedText8x8(SavedImage *Image, const int x, const int y, + const char *legend, const int border, + const int bg, const int fg); + diff --git a/recipes/giflib/5.2.x/test_package/CMakeLists.txt b/recipes/giflib/5.2.x/test_package/CMakeLists.txt index 909c7abfcc3fc..d40a4c2c931fb 100644 --- a/recipes/giflib/5.2.x/test_package/CMakeLists.txt +++ b/recipes/giflib/5.2.x/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) -find_package(GIF REQUIRED) +find_package(GIF REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE GIF::GIF) diff --git a/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt b/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt index 0d20897301b68..b21cc49efde95 100644 --- a/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt +++ b/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/giflib/5.2.x/test_v1_package/conanfile.py b/recipes/giflib/5.2.x/test_v1_package/conanfile.py index 15e08a8cf4897..1b567782d0d2e 100644 --- a/recipes/giflib/5.2.x/test_v1_package/conanfile.py +++ b/recipes/giflib/5.2.x/test_v1_package/conanfile.py @@ -4,7 +4,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) diff --git a/recipes/giflib/config.yml b/recipes/giflib/config.yml index 1ccf672c09135..c70c4f2d279f1 100644 --- a/recipes/giflib/config.yml +++ b/recipes/giflib/config.yml @@ -1,4 +1,6 @@ versions: + "5.2.2": + folder: "5.2.x" "5.2.1": folder: "5.2.x" "5.1.4": diff --git a/recipes/glaze/all/conandata.yml b/recipes/glaze/all/conandata.yml index a15ae462af46d..cec95d7e33d7e 100644 --- a/recipes/glaze/all/conandata.yml +++ b/recipes/glaze/all/conandata.yml @@ -1,38 +1,27 @@ sources: - "2.3.0": - url: "https://github.com/stephenberry/glaze/archive/v2.3.0.tar.gz" - sha256: "9963761337941f4709458155a045ce4ab5dc5edf5e60dca8cc290200fce8330e" - "2.2.1": - url: "https://github.com/stephenberry/glaze/archive/v2.2.1.tar.gz" - sha256: "ef0eb30a038c623ca100696e773ba1c9888719ed02c46e9fabf6238ee07026bb" - "2.1.9": - url: "https://github.com/stephenberry/glaze/archive/v2.1.9.tar.gz" - sha256: "678126f068e3c21c2b3d2e1ae914c72296b68610a004cf542ea050946ab06416" - "2.1.7": - url: "https://github.com/stephenberry/glaze/archive/v2.1.7.tar.gz" - sha256: "e110bfc6494ca3a0616beaec214e61a53d4e0bd1489d8f1a45ca6f87594a3502" + "2.9.2": + url: "https://github.com/stephenberry/glaze/archive/v2.9.2.tar.gz" + sha256: "8dec57645517cd89631d965ad13888e49ccdb3c037a6bb099fcabadfb093d4fe" + "2.9.0": + url: "https://github.com/stephenberry/glaze/archive/v2.9.0.tar.gz" + sha256: "d07d9cab3d86ee80bf64246c14520d3495027f70444071124ee856dbdf37b6e0" + # keep 2.8.4 for breaking change: pure reflection support for C style arrays + "2.8.4": + url: "https://github.com/stephenberry/glaze/archive/v2.8.4.tar.gz" + sha256: "6ca8e63783f0a1dbe69f50c0bc289134301ecf930ada83489b9715cdd2a49252" + # keep 2.7.0 for breaking change: write error handling + "2.7.0": + url: "https://github.com/stephenberry/glaze/archive/v2.7.0.tar.gz" + sha256: "8e3ee2ba725137cd4f61bc9ceb74e2225dc22b970da1c5a43d2a6833115adbfc" + # keep 2.6.9 for breaking change: JSONC style comment + "2.6.9": + url: "https://github.com/stephenberry/glaze/archive/v2.6.9.tar.gz" + sha256: "e16c221c12b56f5a7f1cb2f33a884e752e219215826d8bc1edf96c78ee2458ec" + # keep 2.6.2 for gcc11 + "2.6.2": + url: "https://github.com/stephenberry/glaze/archive/v2.6.2.tar.gz" + sha256: "8498de2b5e80b4eeab07108ea8ed460d4bbfef56f533ff08ca9e119501185dc4" # Keep 2.1.6 for now as 2.1.7 had some breaking changes "2.1.6": url: "https://github.com/stephenberry/glaze/archive/v2.1.6.tar.gz" sha256: "5ae31b1a48a5b54b84e115a12195341bfbe39f03f92bb3bcad074f984380f72d" - "2.1.4": - url: "https://github.com/stephenberry/glaze/archive/v2.1.4.tar.gz" - sha256: "cbaba4dfbaaf342c8be8e6834cb79933b080ac89f3aa1470bc7a83197d9ebc1a" - "2.1.0": - url: "https://github.com/stephenberry/glaze/archive/v2.1.0.tar.gz" - sha256: "b3bb4d886f17d266f37a6eec2c42b2e57e287918b20511297c4eb6b9960f0f8f" - "2.0.9": - url: "https://github.com/stephenberry/glaze/archive/v2.0.9.tar.gz" - sha256: "c1ffede3db5c74d2c46a3abe576985dc729c95df1b48ab575079427b55488bbd" - "2.0.7": - url: "https://github.com/stephenberry/glaze/archive/v2.0.7.tar.gz" - sha256: "1bf981e72733fb5a02a91c9642d91fa39e4a1ebe42f81e8fc6a016c11ed762cb" - "2.0.6": - url: "https://github.com/stephenberry/glaze/archive/v2.0.6.tar.gz" - sha256: "aa5d4921382e9781998ebbf6d36964556daa3367a2aef5ca814122502b450abc" - "1.9.9": - url: "https://github.com/stephenberry/glaze/archive/v1.9.9.tar.gz" - sha256: "7e2605046742a89ec455887a5a0d6b3188ed5c14ea309c5eb9814848c26bedca" - "1.8.5": - url: "https://github.com/stephenberry/glaze/archive/v1.8.5.tar.gz" - sha256: "5d876eed5689f1947ea4eafd9f13a4e0b527611a6b1857c79a5d598a856287b4" diff --git a/recipes/glaze/all/conanfile.py b/recipes/glaze/all/conanfile.py index b7b6a8eb1447b..85bb474d8c75b 100644 --- a/recipes/glaze/all/conanfile.py +++ b/recipes/glaze/all/conanfile.py @@ -25,17 +25,13 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): - versions = { + return { "Visual Studio": "17", "msvc": "193", - "gcc": "10", - # glaze >= 2.1.6 uses std::bit_cast which is supported by clang >= 14 - "clang": "12" if Version(self.version) < "2.1.6" else "14", + "gcc": "11" if Version(self.version) < "2.6.3" else "12", + "clang": "14", "apple-clang": "13.1", } - if Version(self.version) >= "1.9.0": - versions["gcc"] = "11" - return versions def layout(self): basic_layout(self, src_folder="src") @@ -44,8 +40,8 @@ def package_id(self): self.info.clear() def validate(self): - if Version(self.version) >= "2.1.4" and \ - self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "11.3": + # remove this block when all versions of under 2.6.3 will be removed. + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "11.3": raise ConanInvalidConfiguration( f"{self.ref} doesn't support 11.0<=gcc<11.3 due to gcc bug. Please use gcc>=11.3 and set compiler.version.(ex. compiler.version=11.3)", ) diff --git a/recipes/glaze/config.yml b/recipes/glaze/config.yml index de35ec863def5..38ee5a2a97729 100644 --- a/recipes/glaze/config.yml +++ b/recipes/glaze/config.yml @@ -1,25 +1,15 @@ versions: - "2.3.0": + "2.9.2": folder: all - "2.2.1": + "2.9.0": folder: all - "2.1.9": + "2.8.4": folder: all - "2.1.7": + "2.7.0": folder: all - "2.1.6": - folder: all - "2.1.4": - folder: all - "2.1.0": - folder: all - "2.0.9": + "2.6.9": folder: all - "2.0.7": + "2.6.2": folder: all - "2.0.6": - folder: all - "1.9.9": - folder: all - "1.8.5": + "2.1.6": folder: all diff --git a/recipes/glfw/all/conanfile.py b/recipes/glfw/all/conanfile.py index 90b0cfaeecdac..b557f33a747f0 100644 --- a/recipes/glfw/all/conanfile.py +++ b/recipes/glfw/all/conanfile.py @@ -123,10 +123,8 @@ def generate(self): else: # Manually generate pkgconfig file of wayland-protocols since # PkgConfigDeps.build_context_activated can't work with legacy 1 profile - # We must use legacy conan v1 deps_cpp_info because self.dependencies doesn't - # contain build requirements when using 1 profile. - wp_prefix = self.deps_cpp_info["wayland-protocols"].rootpath - wp_version = self.deps_cpp_info["wayland-protocols"].version + wp_prefix = self.dependencies.build["wayland-protocols"].package_folder + wp_version = self.dependencies.build["wayland-protocols"].ref.version wp_pkg_content = textwrap.dedent(f"""\ prefix={wp_prefix} datarootdir=${{prefix}}/res diff --git a/recipes/gli/all/conanfile.py b/recipes/gli/all/conanfile.py index 0cb3644185589..95708d6bbe9df 100644 --- a/recipes/gli/all/conanfile.py +++ b/recipes/gli/all/conanfile.py @@ -38,7 +38,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glm/cci.20230113") + self.requires("glm/1.0.1") def package_id(self): self.info.clear() diff --git a/recipes/glib/all/conandata.yml b/recipes/glib/all/conandata.yml index 826e4f114106f..9723a1277a5c1 100644 --- a/recipes/glib/all/conandata.yml +++ b/recipes/glib/all/conandata.yml @@ -1,39 +1,33 @@ sources: + "2.81.0": + url: "https://download.gnome.org/sources/glib/2.81/glib-2.81.0.tar.xz" + sha256: "1665188ed9cc941c0a189dc6295e6859872523d1bfc84a5a84732a7ae87b02e4" "2.78.3": url: "https://download.gnome.org/sources/glib/2.78/glib-2.78.3.tar.xz" sha256: "609801dd373796e515972bf95fc0b2daa44545481ee2f465c4f204d224b2bc21" - "2.78.1": - url: "https://download.gnome.org/sources/glib/2.78/glib-2.78.1.tar.xz" - sha256: "915bc3d0f8507d650ead3832e2f8fb670fce59aac4d7754a7dab6f1e6fed78b2" - "2.78.0": - url: "https://download.gnome.org/sources/glib/2.78/glib-2.78.0.tar.xz" - sha256: "44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30" "2.77.3": url: "https://download.gnome.org/sources/glib/2.77/glib-2.77.3.tar.xz" sha256: "1753f963bb680b28a83d6e2095f63d0d4b94244675bcd2603850b2ebc1ac6a61" - "2.77.2": - url: "https://download.gnome.org/sources/glib/2.77/glib-2.77.2.tar.xz" - sha256: "16279739e4d30ec47be3e82909f5aeaaa41a8206bae3bead10a23fb2deff02a6" - "2.77.1": - url: "https://download.gnome.org/sources/glib/2.77/glib-2.77.1.tar.xz" - sha256: "dce8d0c9e916d8c81a64436bd4ee4d6515a52dd3d157c994e1cdb9b3d6300a03" - "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" - "2.75.3": - url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.3.tar.xz" - sha256: "7c517d0aff456c35a039bce8a8df7a08ce95a8285b09d1849f8865f633f7f871" patches: + "2.81.0": + - patch_file: "patches/dont-use-python-packaging-2.81.0.patch" + patch_type: bugfix + patch_description: replace package.version.Version by internal code + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3352 + "2.78.3": + - patch_file: "patches/remove-distutils-2.77.0.patch" + patch_type: bugfix + patch_description: remove distutils + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4133 "2.76.3": - patch_file: "patches/libintl-discovery.patch" patch_type: bugfix patch_description: fix libintl discovery patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3352 - "2.75.3": - - patch_file: "patches/libintl-discovery-2.75.3.patch" + - patch_file: "patches/remove-distutils.patch" patch_type: bugfix - patch_description: fix libintl discovery - patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3352 + patch_description: remove distutils + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4133 diff --git a/recipes/glib/all/conanfile.py b/recipes/glib/all/conanfile.py index 6ccdcc81fb42a..2ab322c38bc8d 100644 --- a/recipes/glib/all/conanfile.py +++ b/recipes/glib/all/conanfile.py @@ -81,7 +81,7 @@ def requirements(self): self.requires("libiconv/1.17") def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/[>=1.2.3 <2]") if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/2.0.3") diff --git a/recipes/glib/all/patches/dont-use-python-packaging-2.81.0.patch b/recipes/glib/all/patches/dont-use-python-packaging-2.81.0.patch new file mode 100644 index 0000000000000..a97c9a79ae133 --- /dev/null +++ b/recipes/glib/all/patches/dont-use-python-packaging-2.81.0.patch @@ -0,0 +1,148 @@ +diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in +index 9c409e6..1913b6d 100755 +--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in ++++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in +@@ -1,4 +1,4 @@ +-#!@PYTHON@ ++#!/usr/bin/env @PYTHON@ + + # GDBus - GLib D-Bus Library + # +diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build +index 67ea9f2..2ee1fc8 100644 +--- a/gio/gdbus-2.0/codegen/meson.build ++++ b/gio/gdbus-2.0/codegen/meson.build +@@ -31,7 +31,7 @@ gdbus_codegen_conf = configuration_data() + gdbus_codegen_conf.set('VERSION', glib_version) + gdbus_codegen_conf.set('MAJOR_VERSION', major_version) + gdbus_codegen_conf.set('MINOR_VERSION', minor_version) +-gdbus_codegen_conf.set('PYTHON', python.full_path()) ++gdbus_codegen_conf.set('PYTHON', python_name) + gdbus_codegen_conf.set('DATADIR', glib_datadir) + + # Install gdbus-codegen executable +diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py +index 6399945..86024d7 100644 +--- a/gio/gdbus-2.0/codegen/utils.py ++++ b/gio/gdbus-2.0/codegen/utils.py +@@ -21,10 +21,9 @@ + # + # Author: David Zeuthen + +-import packaging.version + import os + import sys +- ++import re + + # pylint: disable=too-few-public-methods + class Color: +@@ -161,11 +160,35 @@ def lookup_brief_docs(annotations): + def version_cmp_key(key): + # If the 'since' version is 'UNRELEASED', compare higher than anything else + # If it is empty put a 0 in its place as this will +- # allow LooseVersion to work and will always compare lower. ++ # allow _parse_version() to work and will always compare lower. + if key[0] == "UNRELEASED": + v = "9999" + elif key[0]: + v = str(key[0]) + else: + v = "0" +- return (packaging.version.Version(v), key[1]) ++ return (_parse_version(v), key[1]) ++ ++ ++def _parse_version(version): ++ """ ++ Parse a version string into a list of integers and strings. ++ ++ This function takes a version string and breaks it down into its component parts. ++ It separates numeric and non-numeric segments, converting numeric segments to integers. ++ ++ Args: ++ version (str): The version string to parse. ++ ++ Returns: ++ list: A list where each element is either an integer (for numeric parts) ++ or a string (for non-numeric parts). ++ ++ Example: ++ >>> parseversion("1.2.3a") ++ [1, 2, 3, 'a'] ++ >>> parseversion("2.0.0-rc1") ++ [2, 0, 0, 'rc1'] ++ """ ++ blocks = re.findall(r"(\d+|\w+)", version) ++ return [int(b) if b.isdigit() else b for b in blocks] +diff --git a/glib/gtester-report.in b/glib/gtester-report.in +index 0745d53..b8291d2 100644 +--- a/glib/gtester-report.in ++++ b/glib/gtester-report.in +@@ -1,4 +1,4 @@ +-#!@PYTHON@ ++#! /usr/bin/env @PYTHON@ + # GLib Testing Framework Utility -*- Mode: python; -*- + # Copyright (C) 2007 Imendio AB + # Authors: Tim Janik +diff --git a/glib/meson.build b/glib/meson.build +index b2dd569..5c29bb7 100644 +--- a/glib/meson.build ++++ b/glib/meson.build +@@ -502,7 +502,7 @@ endif + + report_conf = configuration_data() + report_conf.set('GLIB_VERSION', glib_version) +-report_conf.set('PYTHON', python.full_path()) ++report_conf.set('PYTHON', python_name) + configure_file( + input: 'gtester-report.in', + output: 'gtester-report', +diff --git a/gobject/glib-genmarshal.in b/gobject/glib-genmarshal.in +index 0578b74..aa5af43 100755 +--- a/gobject/glib-genmarshal.in ++++ b/gobject/glib-genmarshal.in +@@ -1,4 +1,4 @@ +-#!@PYTHON@ ++#!/usr/bin/env @PYTHON@ + + # pylint: disable=too-many-lines, missing-docstring, invalid-name + +diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in +index 7e794e9..e10b910 100755 +--- a/gobject/glib-mkenums.in ++++ b/gobject/glib-mkenums.in +@@ -1,4 +1,4 @@ +-#!@PYTHON@ ++#!/usr/bin/env @PYTHON@ + + # If the code below looks horrible and unpythonic, do not panic. + # +diff --git a/gobject/meson.build b/gobject/meson.build +index 78b732b..2129aaf 100644 +--- a/gobject/meson.build ++++ b/gobject/meson.build +@@ -87,7 +87,7 @@ python_tools = [ + + python_tools_conf = configuration_data() + python_tools_conf.set('VERSION', glib_version) +-python_tools_conf.set('PYTHON', python.full_path()) ++python_tools_conf.set('PYTHON', python_name) + + foreach tool: python_tools + tool_bin = configure_file( +diff --git a/meson.build b/meson.build +index bcc2887..6cca73d 100644 +--- a/meson.build ++++ b/meson.build +@@ -2457,7 +2457,9 @@ endif + + glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline) + +-python = import('python').find_installation(modules: ['packaging']) ++python = import('python').find_installation() ++# used for '#!/usr/bin/env ' ++python_name = 'python3' + + python_version = python.language_version() + python_version_req = '>=3.7' diff --git a/recipes/glib/all/patches/libintl-discovery-2.75.3.patch b/recipes/glib/all/patches/libintl-discovery-2.75.3.patch deleted file mode 100644 index 0df94096d0615..0000000000000 --- a/recipes/glib/all/patches/libintl-discovery-2.75.3.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 32249a22fc39319651e7c23442d37ec837f05764 Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan -Date: Thu, 8 Sep 2022 02:36:33 +0530 -Subject: [PATCH] meson: Fix detection of a system-provided proxy-libintl - -proxy-libintl defines ngettext() as a define in the header that points -to the actual symbol in the library which is g_libintl_ngettext(). -Same with bind_textdomain_codeset(). ---- - meson.build | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/meson.build b/meson.build -index 0cbc9689f5..de0bee5a39 100644 ---- a/meson.build -+++ b/meson.build -@@ -2088,6 +2088,7 @@ libz_dep = dependency('zlib') - # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible - # implementations. This could be extended if issues are found in some platforms. - libintl_deps = [] -+libintl_prefix = '#include ' - libintl = dependency('intl', required: false, allow_fallback: false) - if libintl.found() - # libintl supports different threading APIs, which may not -@@ -2099,11 +2100,11 @@ if libintl.found() - # - # Meson's builtin dependency lookup as of 0.60.0 doesn't check for - # pthread, so we do this manually here. -- if cc.has_function('ngettext', dependencies : libintl) -+ if cc.has_function('ngettext', dependencies : libintl, prefix: libintl_prefix) - libintl_deps += [libintl] - else - libintl_pthread = cc.find_library('pthread', required : false) -- if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread]) -+ if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread], prefix: libintl_prefix) - libintl_deps += [libintl, libintl_pthread] - else - libintl = disabler() -@@ -2112,7 +2113,7 @@ if libintl.found() - endif - - if libintl.found() -- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps) -+ have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps, prefix: libintl_prefix) - else - libintl = dependency('intl', allow_fallback: true) - assert(libintl.type_name() == 'internal') --- -GitLab diff --git a/recipes/glib/all/patches/remove-distutils-2.77.0.patch b/recipes/glib/all/patches/remove-distutils-2.77.0.patch new file mode 100644 index 0000000000000..ba054b959ca4f --- /dev/null +++ b/recipes/glib/all/patches/remove-distutils-2.77.0.patch @@ -0,0 +1,51 @@ +diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py +index 0204610..f8d758c 100644 +--- a/gio/gdbus-2.0/codegen/utils.py ++++ b/gio/gdbus-2.0/codegen/utils.py +@@ -19,7 +19,7 @@ + # + # Author: David Zeuthen + +-import distutils.version ++import re + import os + import sys + +@@ -159,11 +159,35 @@ def lookup_brief_docs(annotations): + def version_cmp_key(key): + # If the 'since' version is 'UNRELEASED', compare higher than anything else + # If it is empty put a 0 in its place as this will +- # allow LooseVersion to work and will always compare lower. ++ # allow _parse_version() to work and will always compare lower. + if key[0] == "UNRELEASED": + v = "9999" + elif key[0]: + v = str(key[0]) + else: + v = "0" +- return (distutils.version.LooseVersion(v), key[1]) ++ return (_parse_version(v), key[1]) ++ ++ ++def _parse_version(version): ++ """ ++ Parse a version string into a list of integers and strings. ++ ++ This function takes a version string and breaks it down into its component parts. ++ It separates numeric and non-numeric segments, converting numeric segments to integers. ++ ++ Args: ++ version (str): The version string to parse. ++ ++ Returns: ++ list: A list where each element is either an integer (for numeric parts) ++ or a string (for non-numeric parts). ++ ++ Example: ++ >>> parseversion("1.2.3a") ++ [1, 2, 3, 'a'] ++ >>> parseversion("2.0.0-rc1") ++ [2, 0, 0, 'rc1'] ++ """ ++ blocks = re.findall(r"(\d+|\w+)", version) ++ return [int(b) if b.isdigit() else b for b in blocks] diff --git a/recipes/glib/all/patches/remove-distutils.patch b/recipes/glib/all/patches/remove-distutils.patch new file mode 100644 index 0000000000000..3096261030b0d --- /dev/null +++ b/recipes/glib/all/patches/remove-distutils.patch @@ -0,0 +1,51 @@ +diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py +index 95559d3..2b7a176 100644 +--- a/gio/gdbus-2.0/codegen/utils.py ++++ b/gio/gdbus-2.0/codegen/utils.py +@@ -19,7 +19,7 @@ + # + # Author: David Zeuthen + +-import distutils.version ++import re + import os + import sys + +@@ -155,11 +155,35 @@ def lookup_brief_docs(annotations): + def version_cmp_key(key): + # If the 'since' version is 'UNRELEASED', compare higher than anything else + # If it is empty put a 0 in its place as this will +- # allow LooseVersion to work and will always compare lower. ++ # allow _parse_version() to work and will always compare lower. + if key[0] == "UNRELEASED": + v = "9999" + elif key[0]: + v = str(key[0]) + else: + v = "0" +- return (distutils.version.LooseVersion(v), key[1]) ++ return (_parse_version(v), key[1]) ++ ++ ++def _parse_version(version): ++ """ ++ Parse a version string into a list of integers and strings. ++ ++ This function takes a version string and breaks it down into its component parts. ++ It separates numeric and non-numeric segments, converting numeric segments to integers. ++ ++ Args: ++ version (str): The version string to parse. ++ ++ Returns: ++ list: A list where each element is either an integer (for numeric parts) ++ or a string (for non-numeric parts). ++ ++ Example: ++ >>> parseversion("1.2.3a") ++ [1, 2, 3, 'a'] ++ >>> parseversion("2.0.0-rc1") ++ [2, 0, 0, 'rc1'] ++ """ ++ blocks = re.findall(r"(\d+|\w+)", version) ++ return [int(b) if b.isdigit() else b for b in blocks] diff --git a/recipes/glib/all/test_package/CMakeLists.txt b/recipes/glib/all/test_package/CMakeLists.txt index 44f2423e0f831..c2e2b58b04658 100644 --- a/recipes/glib/all/test_package/CMakeLists.txt +++ b/recipes/glib/all/test_package/CMakeLists.txt @@ -1,17 +1,7 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) -add_executable(${PROJECT_NAME} test_package.c) +find_package(glib CONFIG REQUIRED) -if (CMAKE_SYSTEM_NAME STREQUAL "Windows") - find_package(glib CONFIG REQUIRED) - target_link_libraries(${PROJECT_NAME} PRIVATE glib::glib-2.0 glib::gio-2.0 glib::gmodule-2.0 glib::gobject-2.0 glib::gthread-2.0) -else() - find_package(PkgConfig REQUIRED) - pkg_check_modules(glib-2.0 REQUIRED IMPORTED_TARGET glib-2.0) - pkg_check_modules(gio-2.0 REQUIRED IMPORTED_TARGET gio-2.0) - pkg_check_modules(gmodule-2.0 REQUIRED IMPORTED_TARGET gmodule-2.0) - pkg_check_modules(gobject-2.0 REQUIRED IMPORTED_TARGET gobject-2.0) - pkg_check_modules(gthread-2.0 REQUIRED IMPORTED_TARGET gthread-2.0) - target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::glib-2.0 PkgConfig::gio-2.0 PkgConfig::gmodule-2.0 PkgConfig::gobject-2.0 PkgConfig::gthread-2.0) -endif() +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE glib::glib-2.0 glib::gio-2.0 glib::gmodule-2.0 glib::gobject-2.0 glib::gthread-2.0) diff --git a/recipes/glib/all/test_package/conanfile.py b/recipes/glib/all/test_package/conanfile.py index 168cdc2e86991..686967e0621b8 100644 --- a/recipes/glib/all/test_package/conanfile.py +++ b/recipes/glib/all/test_package/conanfile.py @@ -1,47 +1,19 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain -from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv -from conan.tools.gnu import PkgConfig, PkgConfigDeps +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv", "VirtualRunEnv" test_type = "explicit" def layout(self): cmake_layout(self) def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - if self.settings.os != "Windows" and not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") - - def generate(self): - tc = CMakeToolchain(self) - tc.generate() - virtual_run_env = VirtualRunEnv(self) - virtual_run_env.generate() - - if self.settings.os == "Macos": - env = Environment() - # Avoid conflicts with system libiconv - # see: https://github.com/conan-io/conan-center-index/pull/17610#issuecomment-1552921286 - env.define_path("DYLD_FALLBACK_LIBRARY_PATH", "$DYLD_LIBRARY_PATH") - env.define_path("DYLD_LIBRARY_PATH", "") - env.vars(self, scope="run").save_script("conanrun_macos_runtimepath") - - if self.settings.os == "Windows": - deps = CMakeDeps(self) - deps.generate() - else: - virtual_build_env = VirtualBuildEnv(self) - virtual_build_env.generate() - pkg_config_deps = PkgConfigDeps(self) - pkg_config_deps.generate() + self.requires(self.tested_reference_str, run=True) def build(self): cmake = CMake(self) @@ -52,8 +24,5 @@ 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.settings.os != "Windows": - pkg_config = PkgConfig(self, "gio-2.0", pkg_config_path=self.generators_folder) - gdbus_codegen = pkg_config.variables["gdbus_codegen"] - self.run(f"{gdbus_codegen} -h", env="conanrun") + self.run("gdbus-codegen -h", env="conanrun") diff --git a/recipes/glib/all/test_v1_package/CMakeLists.txt b/recipes/glib/all/test_v1_package/CMakeLists.txt index 0d20897301b68..b21cc49efde95 100644 --- a/recipes/glib/all/test_v1_package/CMakeLists.txt +++ b/recipes/glib/all/test_v1_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/glib/all/test_v1_package/conanfile.py b/recipes/glib/all/test_v1_package/conanfile.py index 3247118701674..18cf513b30696 100644 --- a/recipes/glib/all/test_v1_package/conanfile.py +++ b/recipes/glib/all/test_v1_package/conanfile.py @@ -4,24 +4,16 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi", "pkg_config" - - def build_requirements(self): - if self.settings.os != "Windows": - self.tool_requires("pkgconf/2.0.3") + generators = "cmake", "cmake_find_package_multi" def build(self): - if self.settings.os != "Windows": - with tools.environment_append({'PKG_CONFIG_PATH': "."}): - pkg_config = tools.PkgConfig("gio-2.0") - self.run(f"{pkg_config.variables['gdbus_codegen']} -h", run_environment=True) - - with tools.environment_append({'PKG_CONFIG_PATH': "."}): - cmake = CMake(self) - cmake.configure() - 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 self.settings.os != "Windows": + self.run("gdbus-codegen -h", env="conanrun") diff --git a/recipes/glib/config.yml b/recipes/glib/config.yml index f0bd1289c0ca6..178cce999a640 100644 --- a/recipes/glib/config.yml +++ b/recipes/glib/config.yml @@ -1,19 +1,9 @@ versions: - "2.78.3": - folder: all - "2.78.1": + "2.81.0": folder: all - "2.78.0": + "2.78.3": folder: all "2.77.3": folder: all - "2.77.2": - folder: all - "2.77.1": - folder: all - "2.77.0": - folder: all "2.76.3": folder: all - "2.75.3": - folder: all diff --git a/recipes/glibmm/all/conandata.yml b/recipes/glibmm/all/conandata.yml index 171a01a50da60..830679f3678f2 100644 --- a/recipes/glibmm/all/conandata.yml +++ b/recipes/glibmm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.78.1": + url: "https://download.gnome.org/sources/glibmm/2.78/glibmm-2.78.1.tar.xz" + sha256: "f473f2975d26c3409e112ed11ed36406fb3843fa975df575c22d4cb843085f61" "2.75.0": url: "https://download.gnome.org/sources/glibmm/2.75/glibmm-2.75.0.tar.xz" sha256: "60bb12e66488aa8ce41f0eb2f3612f89f5ddc887e3e4d45498524bf60b266b3d" @@ -8,26 +11,3 @@ sources: "2.66.4": url: "https://download.gnome.org/sources/glibmm/2.66/glibmm-2.66.4.tar.xz" sha256: "199ace5682d81b15a1d565480b4a950682f2db6402c8aa5dd7217d71edff81d5" - -patches: - "2.75.0": - - patch_file: "patches/enable_static_libs_2_75_0.patch" - patch_type: portability - patch_description: enable static library build for msvc - - patch_file: "patches/fix_initialization_order_fiasco_2_75_0.patch" - patch_type: bugfix - patch_description: fix initialization order for static library - "2.72.1": - - patch_file: "patches/enable_static_libs_2_72_1.patch" - patch_type: portability - patch_description: enable static library build for msvc - - patch_file: "patches/fix_initialization_order_fiasco_2_72_1.patch" - patch_type: bugfix - patch_description: fix initialization order for static library - "2.66.4": - - patch_file: "patches/enable_static_libs_2_66_4.patch" - patch_type: portability - patch_description: enable static library build for msvc - - patch_file: "patches/fix_initialization_order_fiasco_2_66_4.patch" - patch_type: bugfix - patch_description: fix initialization order for static library diff --git a/recipes/glibmm/all/conanfile.py b/recipes/glibmm/all/conanfile.py index a6d3f4c904bd4..d36d4666df42d 100644 --- a/recipes/glibmm/all/conanfile.py +++ b/recipes/glibmm/all/conanfile.py @@ -1,22 +1,13 @@ -import os import glob +import os import shutil -from conan import ConanFile, conan_version +from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import check_min_cppstd from conan.tools.env import VirtualBuildEnv -from conan.tools.files import ( - apply_conandata_patches, - copy, - export_conandata_patches, - get, - replace_in_file, - rename, - rm, - rmdir -) +from conan.tools.files import copy, get, replace_in_file, rm, rmdir from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain @@ -33,16 +24,8 @@ class GlibmmConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "glibmm is a C++ API for parts of glib that are useful for C++." topics = ("giomm",) - package_type = "library" + package_type = "shared-library" settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - } - default_options = { - "shared": False, - "fPIC": True, - } short_paths = True @property @@ -57,25 +40,14 @@ def _glibmm_lib(self): def _giomm_lib(self): return f"giomm-{self._abi_version}" - def export_sources(self): - export_conandata_patches(self) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - if self.options.shared: - wildcard = "" if Version(conan_version) < "2.0.0" else "/*" - self.options[f"glib{wildcard}"].shared = True + self.options["glib"].shared = True def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.78.0", transitive_headers=True) + self.requires("glib/2.78.3", transitive_headers=True) if self._abi_version == "2.68": self.requires("libsigcpp/3.0.7", transitive_headers=True) else: @@ -83,12 +55,12 @@ def requirements(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - if self._abi_version == "2.68": + if Version(self._abi_version) >= "2.68": check_min_cppstd(self, 17) else: check_min_cppstd(self, 11) - if self.options.shared and not self.dependencies["glib"].options.shared: + if not self.dependencies["glib"].options.shared: raise ConanInvalidConfiguration( "Linking a shared library against static glib can cause unexpected behaviour." ) @@ -97,9 +69,9 @@ def validate(self): raise ConanInvalidConfiguration("Linking shared glib with the MSVC static runtime is not supported") def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.3.2") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -120,22 +92,9 @@ def generate(self): tc.generate() def _patch_sources(self): - apply_conandata_patches(self) meson_build = os.path.join(self.source_folder, "meson.build") replace_in_file(self, meson_build, "subdir('tests')", "") if is_msvc(self): - # GLiBMM_GEN_EXTRA_DEFS_STATIC is not defined anywhere and is not - # used anywhere except here - # when building a static build !defined(GLiBMM_GEN_EXTRA_DEFS_STATIC) - # evaluates to 0 - if not self.options.shared: - replace_in_file(self, - os.path.join(self.source_folder, "tools", - "extra_defs_gen", "generate_extra_defs.h"), - "#if defined (_MSC_VER) && !defined (GLIBMM_GEN_EXTRA_DEFS_STATIC)", - "#if 0", - ) - # when using cpp_std=c++NM the /permissive- flag is added which # attempts enforcing standard conformant c++ code # the problem is that older versions of Windows SDK is not standard @@ -150,15 +109,6 @@ def build(self): meson.build() def package(self): - def rename_msvc_static_libs(): - lib_folder = os.path.join(self.package_folder, "lib") - rename(self, os.path.join(lib_folder, f"libglibmm-{self._abi_version}.a"), - os.path.join(lib_folder, f"{self._glibmm_lib}.lib")) - rename(self, os.path.join(lib_folder, f"libgiomm-{self._abi_version}.a"), - os.path.join(lib_folder, f"{self._giomm_lib}.lib")) - rename(self, os.path.join(lib_folder, f"libglibmm_generate_extra_defs-{self._abi_version}.a"), - os.path.join(lib_folder, f"glibmm_generate_extra_defs-{self._abi_version}.lib")) - meson = Meson(self) meson.install() @@ -166,8 +116,6 @@ def rename_msvc_static_libs(): if is_msvc(self): rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - if not self.options.shared: - rename_msvc_static_libs() for directory in [self._glibmm_lib, self._giomm_lib]: directory_path = os.path.join(self.package_folder, "lib", directory, "include", "*.h") diff --git a/recipes/glibmm/all/patches/enable_static_libs_2_66_4.patch b/recipes/glibmm/all/patches/enable_static_libs_2_66_4.patch deleted file mode 100644 index c94b5200949f7..0000000000000 --- a/recipes/glibmm/all/patches/enable_static_libs_2_66_4.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/glib/glibmmconfig.h.meson b/glib/glibmmconfig.h.meson -index e50dcccf..19e64a46 100644 ---- a/glib/glibmmconfig.h.meson -+++ b/glib/glibmmconfig.h.meson -@@ -47,7 +47,9 @@ - # if defined(_MSC_VER) - # define GLIBMM_MSC 1 - # define GLIBMM_WIN32 1 --# define GLIBMM_DLL 1 -+# ifndef GLIBMM_STATIC_LIB -+# define GLIBMM_DLL 1 -+# endif - # elif defined(__CYGWIN__) - # define GLIBMM_CONFIGURE 1 - # elif defined(__MINGW32__) -diff --git a/glib/meson.build b/glib/meson.build -index 4feee0fd..9382645a 100644 ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -36,12 +36,6 @@ pkg_conf_data.set('MSVC_TOOLSET_VER', msvc14x_toolset_ver) - - library_build_type = get_option('default_library') - --if cpp_compiler.get_argument_syntax() == 'msvc' -- if library_build_type == 'static' or library_build_type == 'both' -- error('Static builds are not supported by MSVC-style builds') -- endif --endif -- - if library_build_type == 'static' - pkg_conf_data.set('GLIBMM_STATIC_LIB', 1) - pkg_conf_data.set('GIOMM_STATIC_LIB', 1) diff --git a/recipes/glibmm/all/patches/enable_static_libs_2_72_1.patch b/recipes/glibmm/all/patches/enable_static_libs_2_72_1.patch deleted file mode 100644 index b9ec412d84d2e..0000000000000 --- a/recipes/glibmm/all/patches/enable_static_libs_2_72_1.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/glib/glibmmconfig.h.meson b/glib/glibmmconfig.h.meson -index ef4753d..58b343c 100644 ---- a/glib/glibmmconfig.h.meson -+++ b/glib/glibmmconfig.h.meson -@@ -27,7 +27,9 @@ - # if defined(_MSC_VER) - # define GLIBMM_MSC 1 - # define GLIBMM_WIN32 1 --# define GLIBMM_DLL 1 -+# ifndef GLIBMM_STATIC_LIB -+# define GLIBMM_DLL 1 -+# endif - # elif defined(__CYGWIN__) - # define GLIBMM_CONFIGURE 1 - # elif defined(__MINGW32__) -diff --git a/glib/meson.build b/glib/meson.build -index 0c20a91..6b8baa0 100644 ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -36,12 +36,6 @@ pkg_conf_data.set('MSVC_TOOLSET_VER', msvc14x_toolset_ver) - - library_build_type = get_option('default_library') - --if cpp_compiler.get_argument_syntax() == 'msvc' -- if library_build_type == 'static' or library_build_type == 'both' -- error('Static builds are not supported by MSVC-style builds') -- endif --endif -- - if library_build_type == 'static' - pkg_conf_data.set('GLIBMM_STATIC_LIB', 1) - pkg_conf_data.set('GIOMM_STATIC_LIB', 1) diff --git a/recipes/glibmm/all/patches/enable_static_libs_2_75_0.patch b/recipes/glibmm/all/patches/enable_static_libs_2_75_0.patch deleted file mode 100644 index f24c64bb5bd54..0000000000000 --- a/recipes/glibmm/all/patches/enable_static_libs_2_75_0.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/glib/glibmmconfig.h.meson b/glib/glibmmconfig.h.meson -index ef4753d7..b926720b 100644 ---- a/glib/glibmmconfig.h.meson -+++ b/glib/glibmmconfig.h.meson -@@ -27,7 +27,9 @@ - # if defined(_MSC_VER) - # define GLIBMM_MSC 1 - # define GLIBMM_WIN32 1 --# define GLIBMM_DLL 1 -+# ifndef GLIBMM_STATIC_LIB -+# define GLIBMM_DLL 1 -+# endif - # elif defined(__CYGWIN__) - # define GLIBMM_CONFIGURE 1 - # elif defined(__MINGW32__) -diff --git a/glib/meson.build b/glib/meson.build -index d16621e9..3eb8bc47 100644 ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -37,12 +37,6 @@ pkg_conf_data.set('MSVC_TOOLSET_VER', msvc14x_toolset_ver) - - library_build_type = get_option('default_library') - --if cpp_compiler.get_argument_syntax() == 'msvc' -- if library_build_type == 'static' or library_build_type == 'both' -- error('Static builds are not supported by MSVC-style builds') -- endif --endif -- - if library_build_type == 'static' - pkg_conf_data.set('GLIBMM_STATIC_LIB', 1) - pkg_conf_data.set('GIOMM_STATIC_LIB', 1) diff --git a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_66_4.patch b/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_66_4.patch deleted file mode 100644 index 3cf9f867ed1f0..0000000000000 --- a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_66_4.patch +++ /dev/null @@ -1,163 +0,0 @@ -Author: Hesham -Date: Fri May 6 20:02:25 2022 +0000 - - Fix initialization order fiasco - - By default global static initialization with shared libraries begins down - the linking chain upwards, so that the deepest dependency initializes first - This is not guaranteed with static libraries, which might cause glibmm to - initialize before glib. This fix uses lazy initialization for static vars - in glibmm that depend on glib. - -diff --git a/glib/glibmm/class.cc b/glib/glibmm/class.cc -index 057abed..e51d01b 100644 ---- a/glib/glibmm/class.cc -+++ b/glib/glibmm/class.cc -@@ -170,7 +170,11 @@ Class::clone_custom_type( - } - - // Initialize the static quark to store/get custom type properties. -+#if GLIB_STATIC_COMPILATION -+GQuark Class::iface_properties_quark = 0; -+#else - GQuark Class::iface_properties_quark = g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif - - // static - void -diff --git a/glib/glibmm/init.cc b/glib/glibmm/init.cc -index ab96892..267a6c0 100644 ---- a/glib/glibmm/init.cc -+++ b/glib/glibmm/init.cc -@@ -14,15 +14,25 @@ - * License along with this library. If not, see . - */ - -+#include - #include - #include - -+#if GLIB_STATIC_COMPILATION -+#include -+#endif -+ - namespace Glib - { - - void - init() - { -+#if GLIB_STATIC_COMPILATION -+ Glib::Class::iface_properties_quark = -+ g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif -+ - // Also calls Glib::wrap_register_init() and Glib::wrap_init(). - Glib::Error::register_init(); - } -diff --git a/glib/glibmm/property.cc b/glib/glibmm/property.cc -index a2624e5..d9f1095 100644 ---- a/glib/glibmm/property.cc -+++ b/glib/glibmm/property.cc -@@ -89,8 +89,10 @@ struct custom_properties_type - }; - - // The quark used for storing/getting the custom properties of custom types. --static const GQuark custom_properties_quark = -- g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+static const GQuark& custom_properties_quark() { -+ static const GQuark custom_properties_quark_ = g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+ return custom_properties_quark_; -+} - - // Delete the custom properties data when an object of a custom type is finalized. - void destroy_notify_obj_custom_props(void* data) -@@ -111,12 +113,12 @@ custom_properties_type* - get_obj_custom_props(GObject* obj) - { - auto obj_custom_props = -- static_cast(g_object_get_qdata(obj, custom_properties_quark)); -+ static_cast(g_object_get_qdata(obj, custom_properties_quark())); - if (!obj_custom_props) - { - obj_custom_props = new custom_properties_type(); - g_object_set_qdata_full( -- obj, custom_properties_quark, obj_custom_props, destroy_notify_obj_custom_props); -+ obj, custom_properties_quark(), obj_custom_props, destroy_notify_obj_custom_props); - } - return obj_custom_props; - } -diff --git a/untracked/gio/giomm/application.cc b/untracked/gio/giomm/application.cc -index 43ae9df..0d12c9d 100644 ---- a/untracked/gio/giomm/application.cc -+++ b/untracked/gio/giomm/application.cc -@@ -51,8 +51,13 @@ struct ExtraApplicationData - } - }; - --GQuark quark_extra_application_data = -- g_quark_from_string("glibmm__Gio::Application::quark_extra_application_data"); -+static GQuark& -+quark_extra_application_data() -+{ -+ static GQuark quark_extra_application_data_ = -+ g_quark_from_string("glibmm__Gio::Application::quark_extra_application_data"); -+ return quark_extra_application_data_; -+} - - void - Application_delete_extra_application_data(gpointer data) -@@ -465,11 +470,11 @@ Application::add_main_option_entry_private(GOptionArg arg, const Glib::ustring& - gchar* arg_desc = arg_description.empty() ? nullptr : g_strdup(arg_description.c_str()); - - ExtraApplicationData* extra_application_data = -- static_cast(g_object_get_qdata(gobject_, quark_extra_application_data)); -+ static_cast(g_object_get_qdata(gobject_, quark_extra_application_data())); - if (!extra_application_data) - { - extra_application_data = new ExtraApplicationData(); -- g_object_set_qdata_full(gobject_, quark_extra_application_data, extra_application_data, -+ g_object_set_qdata_full(gobject_, quark_extra_application_data(), extra_application_data, - Application_delete_extra_application_data); - } - -@@ -1546,5 +1551,3 @@ void Gio::Application::run_mainloop_vfunc() - - - } // namespace Gio -- -- -diff --git a/untracked/glib/glibmm/binding.cc b/untracked/glib/glibmm/binding.cc -index d0d4f47..0528893 100644 ---- a/untracked/glib/glibmm/binding.cc -+++ b/untracked/glib/glibmm/binding.cc -@@ -29,7 +29,10 @@ - namespace - { - // TODO: When we can break ABI, replace this GQuark by a new data member in Glib::Binding. --GQuark quark_manage = g_quark_from_string("glibmm__Glib::Binding::manage"); -+GQuark& quark_manage() { -+ static GQuark quark_manage_ = g_quark_from_string("glibmm__Glib::Binding::manage"); -+ return quark_manage_; -+} - - struct BindingTransformSlots - { -@@ -150,7 +153,7 @@ Binding::unbind() - void - Binding::unreference() const - { -- if (!g_object_get_qdata(gobject_, quark_manage)) -+ if (!g_object_get_qdata(gobject_, quark_manage())) - { - GBinding* const binding = const_cast(gobj()); - -@@ -168,7 +171,7 @@ void - Binding::set_manage() - { - // Any pointer can be set, just not nullptr. -- g_object_set_qdata(gobject_, quark_manage, this); -+ g_object_set_qdata(gobject_, quark_manage(), this); - } - - const Glib::RefPtr& diff --git a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_72_1.patch b/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_72_1.patch deleted file mode 100644 index e2f8e705abbe0..0000000000000 --- a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_72_1.patch +++ /dev/null @@ -1,95 +0,0 @@ -Author: Hesham -Date: Fri May 6 19:37:32 2022 +0000 - - Fix initialization order fiasco - - By default global static initialization with shared libraries begins down - the linking chain upwards, so that the deepest dependency initializes first - This is not guaranteed with static libraries, which might cause glibmm to - initialize before glib. This fix uses lazy initialization for static vars - in glibmm that depend on glib. - -diff --git a/glib/glibmm/class.cc b/glib/glibmm/class.cc -index 36c3c4b..f735129 100644 ---- a/glib/glibmm/class.cc -+++ b/glib/glibmm/class.cc -@@ -157,7 +157,11 @@ Class::clone_custom_type( - } - - // Initialize the static quark to store/get custom type properties. -+#if GLIB_STATIC_COMPILATION -+GQuark Class::iface_properties_quark = 0; -+#else - GQuark Class::iface_properties_quark = g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif - - // static - void -diff --git a/glib/glibmm/init.cc b/glib/glibmm/init.cc -index 0b34447..6b70a4c 100644 ---- a/glib/glibmm/init.cc -+++ b/glib/glibmm/init.cc -@@ -14,12 +14,17 @@ - * License along with this library. If not, see . - */ - -+#include - #include - #include - #include - #include - #include - -+#if GLIB_STATIC_COMPILATION -+#include -+#endif -+ - namespace - { - bool init_to_users_preferred_locale = true; -@@ -45,6 +50,11 @@ void init() - if (is_initialized) - return; - -+#if GLIB_STATIC_COMPILATION -+ Glib::Class::iface_properties_quark = -+ g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif -+ - if (init_to_users_preferred_locale) - { - try -diff --git a/glib/glibmm/property.cc b/glib/glibmm/property.cc -index 56dad84..630b35b 100644 ---- a/glib/glibmm/property.cc -+++ b/glib/glibmm/property.cc -@@ -89,8 +89,12 @@ struct custom_properties_type - }; - - // The quark used for storing/getting the custom properties of custom types. --static const GQuark custom_properties_quark = -- g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+static const GQuark& -+custom_properties_quark() -+{ -+ static GQuark custom_properties_quark_ = g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+ return custom_properties_quark_; -+} - - // Delete the custom properties data when an object of a custom type is finalized. - void destroy_notify_obj_custom_props(void* data) -@@ -111,12 +115,12 @@ custom_properties_type* - get_obj_custom_props(GObject* obj) - { - auto obj_custom_props = -- static_cast(g_object_get_qdata(obj, custom_properties_quark)); -+ static_cast(g_object_get_qdata(obj, custom_properties_quark())); - if (!obj_custom_props) - { - obj_custom_props = new custom_properties_type(); - g_object_set_qdata_full( -- obj, custom_properties_quark, obj_custom_props, destroy_notify_obj_custom_props); -+ obj, custom_properties_quark(), obj_custom_props, destroy_notify_obj_custom_props); - } - return obj_custom_props; - } diff --git a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_75_0.patch b/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_75_0.patch deleted file mode 100644 index 6a24ae04d3038..0000000000000 --- a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_75_0.patch +++ /dev/null @@ -1,84 +0,0 @@ -diff --git a/glib/glibmm/class.cc b/glib/glibmm/class.cc -index 31f92c61..f5befb2d 100644 ---- a/glib/glibmm/class.cc -+++ b/glib/glibmm/class.cc -@@ -166,7 +166,11 @@ Class::clone_custom_type( - } - - // Initialize the static quark to store/get custom type properties. -+#if GLIB_STATIC_COMPILATION -+GQuark Class::iface_properties_quark = 0; -+#else - GQuark Class::iface_properties_quark = g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif - - // static - void -diff --git a/glib/glibmm/init.cc b/glib/glibmm/init.cc -index 0b34447d..6b70a4c2 100644 ---- a/glib/glibmm/init.cc -+++ b/glib/glibmm/init.cc -@@ -14,12 +14,17 @@ - * License along with this library. If not, see . - */ - -+#include - #include - #include - #include - #include - #include - -+#if GLIB_STATIC_COMPILATION -+#include -+#endif -+ - namespace - { - bool init_to_users_preferred_locale = true; -@@ -45,6 +50,11 @@ void init() - if (is_initialized) - return; - -+#if GLIB_STATIC_COMPILATION -+ Glib::Class::iface_properties_quark = -+ g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif -+ - if (init_to_users_preferred_locale) - { - try -diff --git a/glib/glibmm/property.cc b/glib/glibmm/property.cc -index 56dad849..630b35b1 100644 ---- a/glib/glibmm/property.cc -+++ b/glib/glibmm/property.cc -@@ -89,8 +89,12 @@ struct custom_properties_type - }; - - // The quark used for storing/getting the custom properties of custom types. --static const GQuark custom_properties_quark = -- g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+static const GQuark& -+custom_properties_quark() -+{ -+ static GQuark custom_properties_quark_ = g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+ return custom_properties_quark_; -+} - - // Delete the custom properties data when an object of a custom type is finalized. - void destroy_notify_obj_custom_props(void* data) -@@ -111,12 +115,12 @@ custom_properties_type* - get_obj_custom_props(GObject* obj) - { - auto obj_custom_props = -- static_cast(g_object_get_qdata(obj, custom_properties_quark)); -+ static_cast(g_object_get_qdata(obj, custom_properties_quark())); - if (!obj_custom_props) - { - obj_custom_props = new custom_properties_type(); - g_object_set_qdata_full( -- obj, custom_properties_quark, obj_custom_props, destroy_notify_obj_custom_props); -+ obj, custom_properties_quark(), obj_custom_props, destroy_notify_obj_custom_props); - } - return obj_custom_props; - } diff --git a/recipes/glibmm/config.yml b/recipes/glibmm/config.yml index 6aaa4e9d859bb..c3ca69bc81afd 100644 --- a/recipes/glibmm/config.yml +++ b/recipes/glibmm/config.yml @@ -1,4 +1,6 @@ versions: + "2.78.1": + folder: "all" "2.75.0": folder: "all" "2.72.1": diff --git a/recipes/glm/all/conandata.yml b/recipes/glm/all/conandata.yml index ea5c8f567b661..f0837f7018575 100644 --- a/recipes/glm/all/conandata.yml +++ b/recipes/glm/all/conandata.yml @@ -1,22 +1,7 @@ sources: - "cci.20230113": - url: "https://github.com/g-truc/glm/archive/efec5db081e3aad807d0731e172ac597f6a39447.zip" - sha256: "e7a1abc208278cc3f0dba59c5170d83863b3375f98136d588b8beb74825e503c" - "cci.20220420": - url: "https://github.com/g-truc/glm/archive/cc98465e3508535ba8c7f6208df934c156a018dc.zip" - sha256: "06d48e336857777d2d1f7da9ccd59e4b9d79720dbd70886d48837d19cda997bb" + "1.0.1": + url: "https://github.com/g-truc/glm/releases/download/1.0.1/glm-1.0.1-light.zip" + sha256: "9A995DE4DA09723BD33EF194E6B79818950E5A8F2E154792F02E4615277CFB8D" "0.9.9.8": url: "https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip" sha256: "37e2a3d62ea3322e43593c34bae29f57e3e251ea89f4067506c94043769ade4c" - "0.9.9.7": - url: "https://github.com/g-truc/glm/releases/download/0.9.9.7/glm-0.9.9.7.zip" - sha256: "6b79c3d06d9745d1cce3f38c0c15666596f9aefff25ddb74df3af0a02f011ee1" - "0.9.9.6": - url: "https://github.com/g-truc/glm/releases/download/0.9.9.6/glm-0.9.9.6.zip" - sha256: "9db7339c3b8766184419cfe7942d668fecabe9013ccfec8136b39e11718817d0" - "0.9.9.5": - url: "https://github.com/g-truc/glm/releases/download/0.9.9.5/glm-0.9.9.5.zip" - sha256: "4fe34860ce69156f63eea6c3d84c91cadfc330353cf275ff394aef4e163cafee" - "0.9.5.4": - url: "https://github.com/g-truc/glm/releases/download/0.9.5.4/glm-0.9.5.4.zip" - sha256: "c25002f109104bb8eb37a7e74c745cbc0a713ec5d9a857050c7878edb5ee246c" diff --git a/recipes/glm/all/conanfile.py b/recipes/glm/all/conanfile.py index 468e10f82d8df..71d8ed1fa37de 100644 --- a/recipes/glm/all/conanfile.py +++ b/recipes/glm/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.files import copy, get, load, save +from conan.tools.files import copy, get from conan.tools.layout import basic_layout from conan.tools.scm import Version import os @@ -25,33 +25,20 @@ def package_id(self): self.info.clear() def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=self.version < Version("1.0.0")) def build(self): pass def package(self): - glm_version = self.version if self.version.startswith("cci") else Version(self._get_semver()) - if glm_version == "0.9.8" or (glm_version == "0.9.9" and self._get_tweak_number() < 6): - save(self, os.path.join(self.package_folder, "licenses", "copying.txt"), self._get_license()) - else: + if self.version < Version("1.0.0"): copy(self, "copying.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - for headers in ("*.hpp", "*.inl", "*.h"): + else: + copy(self, "copying.txt", src=os.path.join(self.source_folder, "glm"), dst=os.path.join(self.package_folder, "licenses")) + for headers in ("*.hpp", "*.inl", "*.h", "*.cppm"): copy(self, headers, src=os.path.join(self.source_folder, "glm"), dst=os.path.join(self.package_folder, "include", "glm")) - def _get_semver(self): - return self.version.rsplit(".", 1)[0] - - def _get_tweak_number(self): - return int(self.version.rsplit(".", 1)[-1]) - - def _get_license(self): - manual = load(self, os.path.join(self.source_folder, "manual.md")) - begin = manual.find("### The Happy Bunny License (Modified MIT License)") - end = manual.find("\n![](./doc/manual/frontpage2.png)", begin) - return manual[begin:end] - def package_info(self): self.cpp_info.set_property("cmake_file_name", "glm") self.cpp_info.set_property("cmake_target_name", "glm::glm") diff --git a/recipes/glm/config.yml b/recipes/glm/config.yml index ee1899a79d2af..c716b00aceaa5 100644 --- a/recipes/glm/config.yml +++ b/recipes/glm/config.yml @@ -1,15 +1,5 @@ versions: - "cci.20230113": - folder: all - "cci.20220420": + "1.0.1": folder: all "0.9.9.8": folder: all - "0.9.9.7": - folder: all - "0.9.9.6": - folder: all - "0.9.9.5": - folder: all - "0.9.5.4": - folder: all diff --git a/recipes/glog/all/conandata.yml b/recipes/glog/all/conandata.yml index caa4c720569cf..620508ce97a33 100644 --- a/recipes/glog/all/conandata.yml +++ b/recipes/glog/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.1": + url: "https://github.com/google/glog/archive/refs/tags/v0.7.1.tar.gz" + sha256: "00e4a87e87b7e7612f519a41e491f16623b12423620006f59f5688bfd8d13b08" "0.7.0": url: "https://github.com/google/glog/archive/refs/tags/v0.7.0.tar.gz" sha256: "375106b5976231b92e66879c1a92ce062923b9ae573c42b56ba28b112ee4cc11" diff --git a/recipes/glog/config.yml b/recipes/glog/config.yml index a0804c43130f1..3e17acecd35c8 100644 --- a/recipes/glog/config.yml +++ b/recipes/glog/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.1": + folder: all "0.7.0": folder: all "0.6.0": diff --git a/recipes/glslang/all/conandata.yml b/recipes/glslang/all/conandata.yml index c41da7c94f094..091cef7cb2d40 100644 --- a/recipes/glslang/all/conandata.yml +++ b/recipes/glslang/all/conandata.yml @@ -1,55 +1,20 @@ +# Add only the SDK release versions from https://github.com/KhronosGroup/glslang/tags for consistency sources: + "1.3.268.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" + sha256: "8cfb4824f185bc246cd41cceedbfcdf14abd3d2fa861512baf81df8a263b9283" + "1.3.261.1": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.261.1.tar.gz" + sha256: "eb1f9c2ff0a1409151d7749fb37bc1988dc1fd908444c1e4f43d4190c90befcd" + "1.3.243.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "18b8f296874ac19d034bfb9060238c87b6d67a39af0dfd305d3252762c265f9f" "1.3.239.0": url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.239.0.tar.gz" sha256: "8b040328c18399b7bbf5bef84fac3d7b7376b39ec6833b7e19b7961bf7a72017" "1.3.236.0": url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.236.0.tar.gz" sha256: "fb6f323a36efcd98766bb72f598008f73c4c92bce69c79fc98ad2b3cdca0c263" - "1.3.231.1": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.231.1.tar.gz" - sha256: "df3857f01c1aa9ee1927d2feaaa431406d243958e07791e9aed4cb5ab22a5f2b" - "1.3.224.0": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.224.0.tar.gz" - sha256: "c43c6aa149fa1165e01b375b4d95cbc23b4fc72bd9972a89c55dd1eaa8a360ca" - "1.3.216.0": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.216.0.tar.gz" - sha256: "3f80a926390faedd33e6ed17ec68340abace83913b285174e2dee87156577be5" - "1.3.211.0": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.211.0.tar.gz" - sha256: "4335eec84b87d64130e860dad5d6dc1f722277d4e0ff5027153e2743628cb221" - "1.3.204.0": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.204.0.tar.gz" - sha256: "c6bec993194377944fb8d6d585a90e1288994660782d709e30fa1d91810d6820" - "11.7.0": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/11.7.0.tar.gz" - sha256: "b6c83864c3606678d11675114fa5f358c519fe1dad9a781802bcc87fb8fa32d5" - "11.6.0": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/11.6.0.tar.gz" - sha256: "99ecd3a0c2c2219293d76723846f762a9f3e7dd0dc2a4f346d0fc3a05a0ce000" - "11.5.0": - url: "https://github.com/KhronosGroup/glslang/archive/11.5.0.tar.gz" - sha256: "fd0b5e3bda591bb08bd3049655a99a0a55f0de4059b9c8f7b397e4b19cf5d51f" - "8.13.3559": - url: "https://github.com/KhronosGroup/glslang/archive/8.13.3559.tar.gz" - sha256: "c58fdcf7e00943ba10f9ae565b2725ec9d5be7dab7c8e82cac72fcaa83c652ca" -patches: - "1.3.239.0": - - patch_file: "patches/1.3.236.0-0001-no-force-glslang-pic.patch" - "1.3.236.0": - - patch_file: "patches/1.3.236.0-0001-no-force-glslang-pic.patch" - "1.3.231.1": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "1.3.224.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "1.3.216.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "1.3.211.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "1.3.204.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "11.7.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "11.6.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "11.5.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" + "1.2.198.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.2.198.0.tar.gz" + sha256: "b2a0541caf01de4fc411cbb32c805a3bd0f6578432e532c5fa6336d187a4a1b1" diff --git a/recipes/glslang/all/conanfile.py b/recipes/glslang/all/conanfile.py index 7d393607fb969..6582079e3edd8 100644 --- a/recipes/glslang/all/conanfile.py +++ b/recipes/glslang/all/conanfile.py @@ -1,11 +1,13 @@ +import os +import re + from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import is_apple_os +from conan.errors import ConanInvalidConfiguration, ConanException 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.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir from conan.tools.scm import Version -import os required_conan_version = ">=1.54.0" @@ -14,7 +16,7 @@ class GlslangConan(ConanFile): name = "glslang" description = "Khronos-reference front end for GLSL/ESSL, partial front " \ "end for HLSL, and a SPIR-V generator." - license = ["BSD-3-Clause", "NVIDIA"] + license = "DocumentRef-LICENSE.txt:LicenseRef-glslang" topics = ("glsl", "hlsl", "spirv", "spir-v", "validation", "translation") homepage = "https://github.com/KhronosGroup/glslang" url = "https://github.com/conan-io/conan-center-index" @@ -42,7 +44,6 @@ class GlslangConan(ConanFile): def export_sources(self): copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) - export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -55,30 +56,18 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") - @property - def _get_compatible_spirv_tools_version(self): - return { - "11.7.0": "2021.4", - "11.6.0": "2021.3", - "11.5.0": "2021.2", - "8.13.3559": "2020.5", - }.get(str(self.version), self.version) - def requirements(self): if self.options.enable_optimizer: - self.requires(f"spirv-tools/{self._get_compatible_spirv_tools_version}") + self.requires(f"spirv-tools/{self.version}") def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) # see https://github.com/KhronosGroup/glslang/issues/2283 - glslang_version = Version(self.version) - if (self.options.shared and - (self.settings.os == "Windows" or \ - (glslang_version >= "7.0.0" and glslang_version < "11.0.0" and is_apple_os(self))) - ): - raise ConanInvalidConfiguration(f"{self.ref} shared library build is broken on {self.settings.os}") + if self.options.shared: + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} shared library build is broken on {self.settings.os}") if self.options.enable_optimizer and self.dependencies["spirv-tools"].options.shared: raise ConanInvalidConfiguration( @@ -86,70 +75,56 @@ def validate(self): "because SPIRV-Tools-opt is not built if shared" ) + def build_requirements(self): + if Version(self.version) >= "1.3.261": + self.tool_requires("cmake/[>=3.17.2 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + venv = VirtualBuildEnv(self) + venv.generate() + tc = CMakeToolchain(self) tc.variables["BUILD_EXTERNAL"] = False tc.variables["SKIP_GLSLANG_INSTALL"] = False tc.variables["ENABLE_SPVREMAPPER"] = self.options.spv_remapper tc.variables["ENABLE_GLSLANG_BINARIES"] = self.options.build_executables - glslang_version = Version(self.version) - if glslang_version < "7.0.0" or glslang_version >= "8.13.3743": - tc.variables["ENABLE_GLSLANG_JS"] = False - tc.variables["ENABLE_GLSLANG_WEBMIN"] = False - tc.variables["ENABLE_GLSLANG_WEBMIN_DEVEL"] = False - else: - tc.variables["ENABLE_GLSLANG_WEB"] = False - tc.variables["ENABLE_GLSLANG_WEB_DEVEL"] = False + tc.variables["ENABLE_GLSLANG_JS"] = False + tc.variables["ENABLE_GLSLANG_WEBMIN"] = False + tc.variables["ENABLE_GLSLANG_WEBMIN_DEVEL"] = False tc.variables["ENABLE_EMSCRIPTEN_SINGLE_FILE"] = False tc.variables["ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE"] = False tc.variables["ENABLE_HLSL"] = self.options.hlsl - if glslang_version < "7.0.0" or glslang_version >= "8.13.3743": - tc.variables["ENABLE_RTTI"] = True + tc.variables["ENABLE_RTTI"] = True tc.variables["ENABLE_OPT"] = self.options.enable_optimizer if self.options.enable_optimizer: tc.variables["spirv-tools_SOURCE_DIR"] = self.dependencies["spirv-tools"].package_folder.replace("\\", "/") tc.variables["ENABLE_PCH"] = False tc.variables["ENABLE_CTEST"] = False tc.variables["USE_CCACHE"] = False - if (glslang_version < "7.0.0" or glslang_version >= "11.6.0") and self.settings.os == "Windows": - tc.variables["OVERRIDE_MSVCCRT"] = False - if is_apple_os(self): - tc.variables["CMAKE_MACOSX_BUNDLE"] = False - if glslang_version < "1.3.231" or glslang_version >= "7.0.0": - # Generate a relocatable shared lib on Macos - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.variables["OVERRIDE_MSVCCRT"] = False + tc.variables["CMAKE_MACOSX_BUNDLE"] = False + # Generate a relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # glslang builds intermediate static libs, but Conan does not set -fPIC for shared builds + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) tc.generate() deps = CMakeDeps(self) deps.generate() def _patch_sources(self): - apply_conandata_patches(self) - # Do not force PIC if static (but keep it if shared, because OGLCompiler, OSDependent, - # GenericCodeGen and MachineIndependent are still static and linked to glslang shared) - if not self.options.shared: - cmake_files_to_fix = [ - {"target": "OGLCompiler", "relpath": os.path.join("OGLCompilersDLL", "CMakeLists.txt")}, - {"target": "SPIRV" , "relpath": os.path.join("SPIRV", "CMakeLists.txt")}, - {"target": "SPVRemapper", "relpath": os.path.join("SPIRV", "CMakeLists.txt")}, - {"target": "OSDependent", "relpath": os.path.join("glslang", "OSDependent", "Unix","CMakeLists.txt")}, - {"target": "OSDependent", "relpath": os.path.join("glslang", "OSDependent", "Windows","CMakeLists.txt")}, - {"target": "HLSL" , "relpath": os.path.join("hlsl", "CMakeLists.txt")}, - ] - glslang_version = Version(self.version) - if glslang_version >= "7.0.0" and glslang_version < "11.0.0": - cmake_files_to_fix.append({"target": "glslang", "relpath": os.path.join("glslang", "CMakeLists.txt")}) - else: - cmake_files_to_fix.append({"target": "glslang-default-resource-limits", "relpath": os.path.join("StandAlone" , "CMakeLists.txt")}) - cmake_files_to_fix.append({"target": "MachineIndependent", "relpath": os.path.join("glslang", "CMakeLists.txt")}) - cmake_files_to_fix.append({"target": "GenericCodeGen", "relpath": os.path.join("glslang", "CMakeLists.txt")}) - for cmake_file in cmake_files_to_fix: - replace_in_file(self, os.path.join(self.source_folder, cmake_file["relpath"]), - "set_property(TARGET {} PROPERTY POSITION_INDEPENDENT_CODE ON)".format(cmake_file["target"]), - "") + for cmake_file in sorted(self.source_path.rglob("CMakeLists.txt")): + content = cmake_file.read_text(encoding="utf8") + if "POSITION_INDEPENDENT_CODE ON" in content: + content = re.sub(r"set_property\(TARGET \S+ PROPERTY POSITION_INDEPENDENT_CODE ON\)\n", "", content) + content = content.replace("POSITION_INDEPENDENT_CODE ON", "") + cmake_file.write_text(content, encoding="utf8") + self.output.info(f"Patched fPIC handling in {cmake_file.relative_to(self.source_path)}") + if "POSITION_INDEPENDENT_CODE" in content: + raise ConanException(f"POSITION_INDEPENDENT_CODE found in {cmake_file}, please update the recipe") def build(self): self._patch_sources() @@ -158,7 +133,7 @@ def build(self): cmake.build() def package(self): - copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) @@ -166,22 +141,21 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "glslang") - self.cpp_info.set_property("cmake_target_name", "glslang::glslang-do-not-use") # because glslang-core target is glslang::glslang + self.cpp_info.set_property("cmake_target_name", "glslang::_glslang-do-not-use") # because glslang-core target is glslang::glslang lib_suffix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" - glslang_version = Version(self.version) - has_machineindependent = (glslang_version < "7.0.0" or glslang_version >= "11.0.0") and not self.options.shared - has_genericcodegen = (glslang_version < "7.0.0" or glslang_version >= "11.0.0") and not self.options.shared - has_osdependent = glslang_version < "1.3.231" or glslang_version >= "7.0.0" or not self.options.shared - has_oglcompiler = glslang_version < "1.3.231" or glslang_version >= "7.0.0" or not self.options.shared + has_machineindependent = not self.options.shared + has_genericcodegen = not self.options.shared + has_osdependent = not self.options.shared + has_oglcompiler = not self.options.shared # glslang self.cpp_info.components["glslang-core"].set_property("cmake_target_name", "glslang::glslang") self.cpp_info.components["glslang-core"].names["cmake_find_package"] = "glslang" self.cpp_info.components["glslang-core"].names["cmake_find_package_multi"] = "glslang" self.cpp_info.components["glslang-core"].libs = [f"glslang{lib_suffix}"] - if (glslang_version < "7.0.0" or glslang_version >= "11.0.0") and self.options.shared: + if self.options.shared: self.cpp_info.components["glslang-core"].defines.append("GLSLANG_IS_SHARED_LIBRARY") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["glslang-core"].system_libs.extend(["m", "pthread"]) diff --git a/recipes/glslang/all/patches/0001-no-force-glslang-pic.patch b/recipes/glslang/all/patches/0001-no-force-glslang-pic.patch deleted file mode 100644 index 00e2266d3a9ae..0000000000000 --- a/recipes/glslang/all/patches/0001-no-force-glslang-pic.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/glslang/CMakeLists.txt -+++ b/glslang/CMakeLists.txt -@@ -167,7 +167,6 @@ - add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${GLSLANG_SOURCES} ${GLSLANG_HEADERS}) - set_target_properties(glslang PROPERTIES - FOLDER glslang -- POSITION_INDEPENDENT_CODE ON - VERSION "${GLSLANG_VERSION}" - SOVERSION "${GLSLANG_VERSION_MAJOR}") - target_link_libraries(glslang PRIVATE OGLCompiler OSDependent MachineIndependent) diff --git a/recipes/glslang/all/patches/1.3.236.0-0001-no-force-glslang-pic.patch b/recipes/glslang/all/patches/1.3.236.0-0001-no-force-glslang-pic.patch deleted file mode 100644 index 10a3ace245afd..0000000000000 --- a/recipes/glslang/all/patches/1.3.236.0-0001-no-force-glslang-pic.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/glslang/CMakeLists.txt -+++ b/glslang/CMakeLists.txt -@@ -169,7 +169,6 @@ set(GLSLANG_HEADERS - add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${GLSLANG_SOURCES} ${GLSLANG_HEADERS}) - set_target_properties(glslang PROPERTIES - FOLDER glslang -- POSITION_INDEPENDENT_CODE ON - VERSION "${GLSLANG_VERSION}" - SOVERSION "${GLSLANG_VERSION_MAJOR}") - target_link_libraries(glslang PRIVATE OGLCompiler OSDependent MachineIndependent) diff --git a/recipes/glslang/config.yml b/recipes/glslang/config.yml index 99298a61152e6..87519b61c9623 100644 --- a/recipes/glslang/config.yml +++ b/recipes/glslang/config.yml @@ -1,23 +1,13 @@ versions: - "1.3.239.0": - folder: all - "1.3.236.0": - folder: all - "1.3.231.1": - folder: all - "1.3.224.0": + "1.3.268.0": folder: all - "1.3.216.0": + "1.3.261.1": folder: all - "1.3.211.0": + "1.3.243.0": folder: all - "1.3.204.0": - folder: all - "11.7.0": - folder: all - "11.6.0": + "1.3.239.0": folder: all - "11.5.0": + "1.3.236.0": folder: all - "8.13.3559": + "1.2.198.0": folder: all diff --git a/recipes/gn/all/conanfile.py b/recipes/gn/all/conanfile.py index 14fc7169fc53f..2511e879a6bf4 100644 --- a/recipes/gn/all/conanfile.py +++ b/recipes/gn/all/conanfile.py @@ -1,128 +1,153 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from contextlib import contextmanager -import conan.tools.files as tools_files -import conan.tools.scm as tools_scm import os +import shutil import sys import textwrap import time -required_conan_version = ">=1.46.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os, XCRun +from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv, Environment +from conan.tools.files import chdir, copy, get, load, save, replace_in_file +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, VCVars +from conan.tools.scm import Version + +required_conan_version = ">=1.47.0" class GnConan(ConanFile): name = "gn" description = "GN is a meta-build system that generates build files for Ninja." - url = "https://github.com/conan-io/conan-center-index" - topics = ("gn", "build", "system", "ninja") license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://gn.googlesource.com/" + topics = ("build system", "ninja") + + package_type = "application" settings = "os", "arch", "compiler", "build_type" - @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.compiler @property def _minimum_compiler_version_supporting_cxx17(self): return { "Visual Studio": 15, + "msvc": 191, "gcc": 7, "clang": 4, "apple-clang": 10, }.get(str(self.settings.compiler)) - def validate(self): + def validate_build(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 17) + check_min_cppstd(self, 17) else: if self._minimum_compiler_version_supporting_cxx17: - if tools_scm.Version(self.settings.compiler.version) < self._minimum_compiler_version_supporting_cxx17: + if Version(self.settings.compiler.version) < self._minimum_compiler_version_supporting_cxx17: raise ConanInvalidConfiguration("gn requires a compiler supporting c++17") else: - self.output.warn("gn recipe does not recognize the compiler. gn requires a compiler supporting c++17. Assuming it does.") - - def package_id(self): - del self.info.settings.compiler - - def source(self): - tools_files.get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder) + self.output.warning( + "gn recipe does not recognize the compiler. gn requires a compiler supporting c++17." + " Assuming it does." + ) def build_requirements(self): # FIXME: add cpython build requirements for `build/gen.py`. - self.build_requires("ninja/1.10.2") + self.tool_requires("ninja/1.11.1") - @contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - yield - else: - compiler_defaults = {} - if self.settings.compiler == "gcc": - compiler_defaults = { - "CC": "gcc", - "CXX": "g++", - "AR": "ar", - "LD": "g++", - } - elif self.settings.compiler == "clang": - compiler_defaults = { - "CC": "clang", - "CXX": "clang++", - "AR": "ar", - "LD": "clang++", - } - env = {} - for k in ("CC", "CXX", "AR", "LD"): - v = tools.get_env(k, compiler_defaults.get(k, None)) - if v: - env[k] = v - with tools.environment_append(env): - yield - - @staticmethod - def _to_gn_platform(os_, compiler): - if tools.is_apple_os(os_): + def source(self): + get(self, **self.conan_data["sources"][self.version]) + + @property + def _gn_platform(self): + if is_apple_os(self): return "darwin" - if compiler == "Visual Studio": + if is_msvc(self): return "msvc" # Assume gn knows about the os - return str(os_).lower() + return str(self.settings.os).lower() + + @property + def _cxx(self): + compilers_by_conf = self.conf.get("tools.build:compiler_executables", default={}, check_type=dict) + cxx = compilers_by_conf.get("cpp") or VirtualBuildEnv(self).vars().get("CXX") + if cxx: + return cxx + if self.settings.compiler == "apple-clang": + return XCRun(self).cxx + compiler_version = self.settings.compiler.version + major = Version(compiler_version).major + if self.settings.compiler == "gcc": + return shutil.which(f"g++-{compiler_version}") or shutil.which(f"g++-{major}") or shutil.which("g++") or "" + if self.settings.compiler == "clang": + return shutil.which(f"clang++-{compiler_version}") or shutil.which(f"clang++-{major}") or shutil.which("clang++") or "" + return "" + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + # Make sure CXX env var is set, otherwise gn defaults it to clang++ + # https://gn.googlesource.com/gn/+/refs/heads/main/build/gen.py#386 + env = Environment() + env.define("CXX", self._cxx) + env.vars(self).save_script("conanbuild_gn") + + if is_msvc(self): + vcvars = VCVars(self) + vcvars.generate() + + configure_args = [ + "--no-last-commit-position", + f"--host={self._gn_platform}", + ] + if self.settings.build_type in ["Debug", "RelWithDebInfo"]: + configure_args.append("-d") + save(self, os.path.join(self.source_folder, "configure_args"), " ".join(configure_args)) def build(self): - with tools.chdir(self._source_subfolder): - with self._build_context(): - # Generate dummy header to be able to run `build/ben.py` with `--no-last-commit-position`. This allows running the script without the tree having to be a git checkout. - tools.save(os.path.join("src", "gn", "last_commit_position.h"), - textwrap.dedent("""\ - #pragma once - #define LAST_COMMIT_POSITION "1" - #define LAST_COMMIT_POSITION_NUM 1 - """)) - conf_args = [ - "--no-last-commit-position", - "--host={}".format(self._to_gn_platform(self.settings.os, self.settings.compiler)), - ] - if self.settings.build_type == "Debug": - conf_args.append("-d") - self.run("{} build/gen.py {}".format(sys.executable, " ".join(conf_args)), run_environment=True) - # Try sleeping one second to avoid time skew of the generated ninja.build file (and having to re-run build/gen.py) - time.sleep(1) - build_args = [ - "-C", "out", - "-j{}".format(tools.cpu_count()), - ] - self.run("ninja {}".format(" ".join(build_args)), run_environment=True) + with chdir(self, self.source_folder): + # Generate dummy header to be able to run `build/gen.py` with `--no-last-commit-position`. + # This allows running the script without the tree having to be a git checkout. + save(self, os.path.join(self.source_folder, "src", "gn", "last_commit_position.h"), + textwrap.dedent("""\ + #pragma once + #define LAST_COMMIT_POSITION "1" + #define LAST_COMMIT_POSITION_NUM 1 + """), + ) + + # Disable GenerateLastCommitPosition() + replace_in_file(self, os.path.join(self.source_folder, "build/gen.py"), + "def GenerateLastCommitPosition(host, header):", + "def GenerateLastCommitPosition(host, header):\n return") + + self.run(f"{sys.executable} build/gen.py " + load(self, "configure_args")) + self.run(f"ninja -C out -j{os.cpu_count()} -v") def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - self.copy("gn", src=os.path.join(self._source_subfolder, "out"), dst="bin") - self.copy("gn.exe", src=os.path.join(self._source_subfolder, "out"), dst="bin") + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.settings.os == "Windows": + copy(self, "gn.exe", + src=os.path.join(self.source_folder, "out"), + dst=os.path.join(self.package_folder, "bin")) + else: + copy(self, "gn", + src=os.path.join(self.source_folder, "out"), + dst=os.path.join(self.package_folder, "bin")) def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) - self.cpp_info.includedirs = [] diff --git a/recipes/gn/all/test_package/conanfile.py b/recipes/gn/all/test_package/conanfile.py index 6afe525facbbe..4a3175e52589e 100644 --- a/recipes/gn/all/test_package/conanfile.py +++ b/recipes/gn/all/test_package/conanfile.py @@ -1,46 +1,28 @@ -from conans import ConanFile, CMake, tools -from contextlib import contextmanager import os +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import can_run, cross_building +from conan.tools.env import VirtualRunEnv, VirtualBuildEnv +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path + class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" + generators = "VCVars" + test_type = "explicit" def build_requirements(self): - self.build_requires("ninja/1.10.2") + self.tool_requires(self.tested_reference_str) + self.tool_requires("ninja/1.11.1") - @contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - yield - else: - compiler_defaults = {} - if self.settings.compiler == "gcc": - compiler_defaults = { - "CC": "gcc", - "CXX": "g++", - "AR": "ar", - "LD": "g++", - } - elif self.settings.compiler in ("apple-clang", "clang"): - compiler_defaults = { - "CC": "clang", - "CXX": "clang++", - "AR": "ar", - "LD": "clang++", - } - env = {} - for k in ("CC", "CXX", "AR", "LD"): - v = tools.get_env(k, compiler_defaults.get(k, None)) - if v: - env[k] = v - with tools.environment_append(env): - yield + def layout(self): + basic_layout(self) @property def _target_os(self): - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): return "mac" # Assume gn knows about the os return { @@ -53,17 +35,22 @@ def _target_cpu(self): "x86_64": "x64", }.get(str(self.settings.arch), str(self.settings.arch)) + def generate(self): + VirtualBuildEnv(self).generate() + VirtualRunEnv(self).generate(scope="run") + VirtualRunEnv(self).generate(scope="build") + def build(self): - if not tools.cross_building(self.settings): - with tools.chdir(self.source_folder): - gn_args = [ - os.path.relpath(os.path.join(self.build_folder, "bin"), os.getcwd()).replace("\\", "/"), - "--args=\"target_os=\\\"{os_}\\\" target_cpu=\\\"{cpu}\\\"\"".format(os_=self._target_os, cpu=self._target_cpu), - ] - self.run("gn gen {}".format(" ".join(gn_args)), run_environment=True) - with self._build_context(): - self.run("ninja -v -j{} -C bin".format(tools.cpu_count()), run_environment=True) + if not cross_building(self): + rel_bindir = unix_path(self, os.path.relpath(os.path.join(self.cpp.build.bindir), os.getcwd())) + gn_args = [ + rel_bindir, + f'--args="target_os=\\"{self._target_os}\\" target_cpu=\\"{self._target_cpu}\\""', + ] + self.run("gn gen " + " ".join(gn_args)) + self.run(f"ninja -v -j{os.cpu_count()} -C {rel_bindir}") 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/gn/all/test_package/test_package.cpp b/recipes/gn/all/test_package/test_package.cpp index 576931dcb63ac..7a70c493ae50a 100644 --- a/recipes/gn/all/test_package/test_package.cpp +++ b/recipes/gn/all/test_package/test_package.cpp @@ -3,7 +3,7 @@ #include -int main(int argc, char* argv[]) { +int main() { std::cout << get_test_shared_text() << "\n"; std::cout << get_test_static_text() << "\n"; return 0; diff --git a/recipes/google-cloud-cpp/2.x/conanfile.py b/recipes/google-cloud-cpp/2.x/conanfile.py index 31ff84a094f69..18e1843526a3c 100644 --- a/recipes/google-cloud-cpp/2.x/conanfile.py +++ b/recipes/google-cloud-cpp/2.x/conanfile.py @@ -3,7 +3,7 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd, cross_building from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.env import VirtualRunEnv +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir from conan.tools.microsoft import check_min_vs, is_msvc from conan.tools.scm import Version @@ -72,6 +72,10 @@ class GoogleCloudCppConan(ConanFile): "bigquery", "bigtable", "iam", "oauth2", "pubsub", "spanner", "storage", } + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + def export_sources(self): export_conandata_patches(self) @@ -157,7 +161,8 @@ def requirements(self): def build_requirements(self): # For the `grpc-cpp-plugin` executable, and indirectly `protoc` - self.tool_requires("grpc/") + if not self._is_legacy_one_profile: + self.tool_requires("grpc/") def generate(self): tc = CMakeToolchain(self) @@ -166,7 +171,9 @@ def generate(self): tc.variables["GOOGLE_CLOUD_CPP_ENABLE_WERROR"] = False tc.variables["GOOGLE_CLOUD_CPP_ENABLE"] = ",".join(self._components()) tc.generate() - VirtualRunEnv(self).generate(scope="build") + VirtualBuildEnv(self).generate() + if self._is_legacy_one_profile: + VirtualRunEnv(self).generate(scope="build") deps = CMakeDeps(self) deps.generate() diff --git a/recipes/google-cloud-cpp/2.x/test_package/conanfile.py b/recipes/google-cloud-cpp/2.x/test_package/conanfile.py index 4544391b62f56..a1ab26b6de654 100644 --- a/recipes/google-cloud-cpp/2.x/test_package/conanfile.py +++ b/recipes/google-cloud-cpp/2.x/test_package/conanfile.py @@ -3,7 +3,7 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.build import can_run -from conan.tools.env import VirtualRunEnv +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.scm import Version @@ -14,6 +14,10 @@ class TestPackageConan(ConanFile): def requirements(self): self.requires(self.tested_reference_str) + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + def layout(self): cmake_layout(self) @@ -30,9 +34,12 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["WITH_COMPUTE"] = self._supports_compute() tc.generate() + if self._is_legacy_one_profile: + VirtualRunEnv(self).generate(scope="build") + else: + VirtualBuildEnv(self).generate() # Environment so that the compiled test executable can load shared libraries - runenv = VirtualRunEnv(self) - runenv.generate(scope="run") + VirtualRunEnv(self).generate(scope="run") deps = CMakeDeps(self) deps.generate() diff --git a/recipes/grpc/all/conandata.yml b/recipes/grpc/all/conandata.yml index 02c1ca609ebd2..4a85145efdbc0 100644 --- a/recipes/grpc/all/conandata.yml +++ b/recipes/grpc/all/conandata.yml @@ -12,6 +12,10 @@ sources: url: "https://github.com/grpc/grpc/archive/v1.48.4.tar.gz" sha256: "0c3faa83e39d4f1ab55fe1476362b9ac3b81632a46dce7fd4d50271bce816b53" patches: + "1.54.3": + - patch_file: "patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch" + patch_type: "backport" + patch_source: "https://github.com/grpc/grpc/commit/5c3400e8dc08d0810e3301d7e8cd8a718c82eeed" "1.50.1": - patch_file: "patches/v1.50.x/001-disable-cppstd-override.patch" "1.50.0": diff --git a/recipes/grpc/all/conanfile.py b/recipes/grpc/all/conanfile.py index 1d39ab202a3b0..0dc9dad8aa3db 100644 --- a/recipes/grpc/all/conanfile.py +++ b/recipes/grpc/all/conanfile.py @@ -15,13 +15,13 @@ class GrpcConan(ConanFile): name = "grpc" - package_type = "library" description = "Google's RPC (remote procedure call) library and framework." license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/grpc/grpc" topics = ("rpc",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -36,7 +36,8 @@ class GrpcConan(ConanFile): "php_plugin": [True, False], "python_plugin": [True, False], "ruby_plugin": [True, False], - "secure": [True, False] + "secure": [True, False], + "with_libsystemd": [True, False] } default_options = { "shared": False, @@ -51,6 +52,7 @@ class GrpcConan(ConanFile): "python_plugin": True, "ruby_plugin": True, "secure": False, + "with_libsystemd": True } short_paths = True @@ -67,6 +69,10 @@ def _cxxstd_required(self): def _is_legacy_one_profile(self): return not hasattr(self, "settings_build") + @property + def _supports_libsystemd(self): + return self.settings.os in ["Linux", "FreeBSD"] and Version(self.version) >= "1.52" + def export_sources(self): copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) copy(self, f"cmake/{self._grpc_plugin_template}", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) @@ -75,6 +81,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if not self._supports_libsystemd: + del self.options.with_libsystemd def configure(self): if self.options.shared: @@ -101,7 +109,7 @@ def requirements(self): self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True) self.requires("re2/20230301") self.requires("zlib/[>=1.2.11 <2]") - if self.settings.os in ["Linux", "FreeBSD"] and Version(self.version) >= "1.52": + if self.options.get_safe("with_libsystemd"): self.requires("libsystemd/255") def package_id(self): @@ -185,6 +193,9 @@ def generate(self): if is_msvc(self) and Version(self.version) >= "1.48": tc.cache_variables["CMAKE_SYSTEM_VERSION"] = "10.0.18362.0" + if self._supports_libsystemd: + tc.cache_variables["gRPC_USE_SYSTEMD"] = self.options.with_libsystemd + tc.generate() cmake_deps = CMakeDeps(self) @@ -288,7 +299,7 @@ def _module_path(self): def _grpc_components(self): def libsystemd(): - return ["libsystemd::libsystemd"] if self.settings.os in ["Linux", "FreeBSD"] and Version(self.version) >= "1.52" else [] + return ["libsystemd::libsystemd"] if self._supports_libsystemd and self.options.with_libsystemd else [] def libm(): return ["m"] if self.settings.os in ["Linux", "FreeBSD"] else [] diff --git a/recipes/grpc/all/patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch b/recipes/grpc/all/patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch new file mode 100644 index 0000000000000..a0b7846cd9ddb --- /dev/null +++ b/recipes/grpc/all/patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch @@ -0,0 +1,57 @@ +From 64d855b0ddd944369e96b24210a1ce59e704a779 Mon Sep 17 00:00:00 2001 +From: Kirill +Date: Tue, 2 Apr 2024 13:17:47 -0700 +Subject: [PATCH] [CMake] Add gRPC_USE_SYSTEMD option (#34384) + +Issue https://github.com/grpc/grpc/issues/34304 + +Allows to disable systemd support, +as well as linking with libsystemd, +when it is not required. + +The option has three possible values: +AUTO - Default, Will try to find libsystemd. If found, systemd support will be enabled. +ON - Enable systemd support. Build will fail if libsystemd is not found. +OFF - Disable systemd support. + +Closes #34384 + +COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/34384 from kirpichik:cmake-use-systemd-option 96f5f4bd68251ca62ccc45a2d44a68a8203531ac +PiperOrigin-RevId: 621274356 +--- + cmake/systemd.cmake | 21 ++++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) + +diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake +index a34210177e..559c8d24b6 100644 +--- a/cmake/systemd.cmake ++++ b/cmake/systemd.cmake +@@ -12,9 +12,20 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-find_package(systemd) +-if(TARGET systemd) +- set(_gRPC_SYSTEMD_LIBRARIES systemd ${SYSTEMD_LINK_LIBRARIES}) +- add_definitions(-DHAVE_LIBSYSTEMD) ++set(gRPC_USE_SYSTEMD "AUTO" CACHE STRING "Build with libsystemd support if available. Can be ON, OFF or AUTO") ++ ++if (NOT gRPC_USE_SYSTEMD STREQUAL "OFF") ++ if (gRPC_USE_SYSTEMD STREQUAL "ON") ++ find_package(systemd REQUIRED) ++ elseif (gRPC_USE_SYSTEMD STREQUAL "AUTO") ++ find_package(systemd) ++ else() ++ message(FATAL_ERROR "Unknown value for gRPC_USE_SYSTEMD = ${gRPC_USE_SYSTEMD}") ++ endif() ++ ++ if(TARGET systemd) ++ set(_gRPC_SYSTEMD_LIBRARIES systemd ${SYSTEMD_LINK_LIBRARIES}) ++ add_definitions(-DHAVE_LIBSYSTEMD) ++ endif() ++ set(_gRPC_FIND_SYSTEMD "if(NOT systemd_FOUND)\n find_package(systemd)\nendif()") + endif() +-set(_gRPC_FIND_SYSTEMD "if(NOT systemd_FOUND)\n find_package(systemd)\nendif()") +-- +2.43.0 + diff --git a/recipes/gsoap/all/conandata.yml b/recipes/gsoap/all/conandata.yml index cc91f201aaee4..a182b51ca54e4 100644 --- a/recipes/gsoap/all/conandata.yml +++ b/recipes/gsoap/all/conandata.yml @@ -1,11 +1,22 @@ +# The sources for this project get deleted from time to time. +# We use the backup sources from Conan Center as mirrors to let users compile in the future +# When adding new versions, directly add the URL following previous versions schema +# https://c3i.jfrog.io/artifactory/conan-center-backup-sources/ + sha256 of the sources +# The file will be automatically uploaded after the first successful compilation of the new version +# And will be usable as a mirror from then on. +# At some point the Conan client might come pre-configured with this backup remote by default, but don't delete the links then +# some users might still rely on the old revisions/not have it set to point to our CCI backup remote sources: + "2.8.134": + url: + - "https://sourceforge.net/projects/gsoap2/files/gsoap_2.8.134.zip/download" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/63478e555c0ccde0164f055ff605b02805db0abc6712a04bcb14cb617b047218" + sha256: "63478e555c0ccde0164f055ff605b02805db0abc6712a04bcb14cb617b047218" "2.8.132": url: - - "https://downloads.sourceforge.net/project/gsoap2/gsoap_2.8.132.zip" - - "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.132.zip" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/d6eb5d0d2c31532746f4dc9fa1ce95d4553414e918059eac23cf081d88c2aeee" sha256: "d6eb5d0d2c31532746f4dc9fa1ce95d4553414e918059eac23cf081d88c2aeee" "2.8.129": url: - - "https://downloads.sourceforge.net/project/gsoap2/gsoap_2.8.129.zip" - - "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.129.zip" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/16cb8852ea791a6aec8f0213d619c15eecc8171e0c888f3b0e0c66d3ef78e20a" sha256: "16cb8852ea791a6aec8f0213d619c15eecc8171e0c888f3b0e0c66d3ef78e20a" diff --git a/recipes/gsoap/all/test_package/conanfile.py b/recipes/gsoap/all/test_package/conanfile.py index 60209e04ba8a6..72383b4f0375e 100644 --- a/recipes/gsoap/all/test_package/conanfile.py +++ b/recipes/gsoap/all/test_package/conanfile.py @@ -7,36 +7,28 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" def layout(self): cmake_layout(self) def requirements(self): - self.requires(self.tested_reference_str, run=can_run(self)) - - def build_requirements(self): - if not can_run(self): - self.tool_requires(self.tested_reference_str) - - def generate(self): - VirtualRunEnv(self).generate() - if can_run(self): - VirtualRunEnv(self).generate(scope="build") - else: - VirtualBuildEnv(self).generate() + self.requires(self.tested_reference_str, run=True) def build(self): + if not can_run(self): + self.output.warning("Skipping build: the package was cross-built") + return calc_wsdl = os.path.join(self.source_folder, "calc.wsdl") self.output.info(f"Generating code from WSDL '{calc_wsdl}'") - self.run(f"wsdl2h -o calc.h {calc_wsdl}") + self.run(f"wsdl2h -o calc.h {calc_wsdl}", env="conanrun") if conan_version.major < "2": # conan v1 limitation: self.dependencies is not defined in build() method of test package import_dir = os.path.join(self.deps_cpp_info["gsoap"].rootpath, "bin", "import") else: import_dir = os.path.join(self.dependencies["gsoap"].package_folder, "bin", "import") - self.run(f"soapcpp2 -j -CL -I{import_dir} calc.h") + self.run(f"soapcpp2 -j -CL -I{import_dir} calc.h", env="conanrun") cmake = CMake(self) cmake.configure() diff --git a/recipes/gsoap/all/test_package/test_package.cpp b/recipes/gsoap/all/test_package/test_package.cpp index bf5391ec2d579..a2173524bd23c 100644 --- a/recipes/gsoap/all/test_package/test_package.cpp +++ b/recipes/gsoap/all/test_package/test_package.cpp @@ -6,15 +6,7 @@ int main() { calcProxy calc; - double sum; - if (calc.add(1.23, 4.56, sum) == SOAP_OK) - { - std::cout << "Sum = " << sum << std::endl; - } - else - { - std::cout << "Cannot sum" << std::endl; - calc.soap_stream_fault(std::cerr); - } calc.destroy(); // same as: soap_destroy(calc.soap); soap_end(calc.soap); + std::cout << "gSoap Test package successful\n"; + return 0; } diff --git a/recipes/gsoap/config.yml b/recipes/gsoap/config.yml index 9a5640854a072..89600de4b1c5d 100644 --- a/recipes/gsoap/config.yml +++ b/recipes/gsoap/config.yml @@ -1,4 +1,6 @@ versions: + "2.8.134": + folder: all "2.8.132": folder: all "2.8.129": diff --git a/recipes/gtest/all/conanfile.py b/recipes/gtest/all/conanfile.py index 556a1401b077b..9b88c6888f25b 100644 --- a/recipes/gtest/all/conanfile.py +++ b/recipes/gtest/all/conanfile.py @@ -37,6 +37,10 @@ class GTestConan(ConanFile): "debug_postfix": "d", "disable_pthreads": False, } + # disallow cppstd compatibility, as it affects the ABI in this library + # see https://github.com/conan-io/conan-center-index/issues/23854 + # Requires Conan >=1.53.0 <2 || >=2.1.0 to work + extension_properties = {"compatibility_cppstd": False} @property def _min_cppstd(self): @@ -158,7 +162,8 @@ def package_info(self): self.cpp_info.components["libgtest"].libs = [f"gtest{self._postfix}"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libgtest"].system_libs.append("m") - self.cpp_info.components["libgtest"].system_libs.append("pthread") + if not self.options.disable_pthreads: + self.cpp_info.components["libgtest"].system_libs.append("pthread") if self.settings.os == "Neutrino" and self.settings.os.version == "7.1": self.cpp_info.components["libgtest"].system_libs.append("regex") if self.options.shared: diff --git a/recipes/gtlab-logging/all/conandata.yml b/recipes/gtlab-logging/all/conandata.yml new file mode 100644 index 0000000000000..a3c93f35dda32 --- /dev/null +++ b/recipes/gtlab-logging/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.4.1": + sha256: "3f905b36de130e32a3b2230b78fee8dfc2747775a6171c7a81d3d02843093e72" + url: "https://github.com/dlr-gtlab/gt-logging/archive/refs/tags/4-4-1.tar.gz" diff --git a/recipes/gtlab-logging/all/conanfile.py b/recipes/gtlab-logging/all/conanfile.py new file mode 100644 index 0000000000000..4faba2a85c630 --- /dev/null +++ b/recipes/gtlab-logging/all/conanfile.py @@ -0,0 +1,110 @@ +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools import files +from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration +from conan import ConanFile +import os + +required_conan_version = ">=1.59.0" + +class GTLabLoggingConan(ConanFile): + name = "gtlab-logging" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dlr-gtlab/gt-logging" + topics = ("logging", "qt") + description = "Simple logging interface with qt support" + + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_qt": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_qt": False + } + + def requirements(self): + if self.options.with_qt: + self.requires("qt/[>=5.15 <7]", transitive_headers=True) + + + @property + def _min_cppstd(self): + return "14" + + @property + def _minimum_compilers_version(self): + return { + "14": { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7.3.1", + "clang": "6", + "apple-clang": "14", + }, + }.get(self._min_cppstd, {}) + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + return all(int(p1) < int(p2) for p1, p2 in zip(str(v1).split("."), str(v2).split("."))) + + compiler = self.settings.compiler + min_version = self._minimum_compilers_version.get(str(compiler)) + if min_version and loose_lt_semver(str(compiler.version), min_version): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def generate(self): + CMakeToolchain(self).generate() + CMakeDeps(self).generate() + + def layout(self): + cmake_layout(self, src_folder="src") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def source(self): + files.get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination=self.source_folder) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + + def package(self): + cmake = CMake(self) + cmake.install() + + files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + files.copy(self, os.path.join("LICENSES", "BSD-3-Clause.txt"), dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + def package_info(self): + self.cpp_info.libs = ["GTlabLogging"] if self.settings.build_type != "Debug" else ["GTlabLogging-d"] + + self.cpp_info.includedirs.append(os.path.join("include", "logging")) + + self.cpp_info.libdirs = [os.path.join("lib", "logging")] + + self.cpp_info.set_property("cmake_file_name", "GTlabLogging") + self.cpp_info.set_property("cmake_target_name", "GTlab::Logging") + + if self.options.with_qt: + self.cpp_info.defines = ['GT_LOG_USE_QT_BINDINGS'] diff --git a/recipes/gtlab-logging/all/test_package/CMakeLists.txt b/recipes/gtlab-logging/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..78edd9030ca73 --- /dev/null +++ b/recipes/gtlab-logging/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.12) +project(PackageTest CXX) + +find_package(GTlabLogging REQUIRED) + +add_executable(example example.cpp) +target_link_libraries(example GTlab::Logging) diff --git a/recipes/gtlab-logging/all/test_package/conanfile.py b/recipes/gtlab-logging/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1f279ef73c18b --- /dev/null +++ b/recipes/gtlab-logging/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run +import os + + +class GTlabLoggingTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + + 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], "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/gtlab-logging/all/test_package/example.cpp b/recipes/gtlab-logging/all/test_package/example.cpp new file mode 100644 index 0000000000000..831dda5df891b --- /dev/null +++ b/recipes/gtlab-logging/all/test_package/example.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + gtError() << "Hello World"; + return 0; +} diff --git a/recipes/gtlab-logging/config.yml b/recipes/gtlab-logging/config.yml new file mode 100644 index 0000000000000..e4bb798c7e054 --- /dev/null +++ b/recipes/gtlab-logging/config.yml @@ -0,0 +1,3 @@ +versions: + "4.4.1": + folder: all diff --git a/recipes/gtsam/all/conanfile.py b/recipes/gtsam/all/conanfile.py index bca7930e912c2..b0e2304308da8 100644 --- a/recipes/gtsam/all/conanfile.py +++ b/recipes/gtsam/all/conanfile.py @@ -17,7 +17,8 @@ class GtsamConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = ("GTSAM is a library of C++ classes that implement " "smoothing and mapping (SAM) in robotics and vision") - topics = ("mapping", "smoothing", "optimization", "factor-graphs") + topics = ("mapping", "smoothing", "optimization", "factor-graphs", + "state-estimation", "computer-vision", "robotics") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -25,7 +26,6 @@ class GtsamConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "allow_deprecated": [True, False], - "allow_deprecated_since_V4": [True, False, "deprecated"], "build_type_postfixes": [True, False], "build_unstable": [True, False], "build_with_march_native": [True, False], @@ -55,7 +55,6 @@ class GtsamConan(ConanFile): "shared": False, "fPIC": True, "allow_deprecated": True, - "allow_deprecated_since_V4": "deprecated", "build_type_postfixes": True, "build_unstable": True, "build_with_march_native": False, @@ -64,14 +63,14 @@ class GtsamConan(ConanFile): "enable_consistency_checks": False, "install_cppunitlite": True, "install_matlab_toolbox": False, - "pose3_expmap": False, - "rot3_expmap": False, + "pose3_expmap": True, + "rot3_expmap": True, "slow_but_correct_betweenfactor": False, - "support_nested_dissection": False, - "tangent_preintegration": False, + "support_nested_dissection": True, + "tangent_preintegration": True, "throw_cheirality_exception": True, "use_quaternions": False, - "with_TBB": False, + "with_TBB": True, "with_eigen_MKL": False, "with_eigen_MKL_OPENMP": False, @@ -95,7 +94,7 @@ class GtsamConan(ConanFile): "rot3_expmap": ("Ignore if GTSAM_USE_QUATERNIONS is OFF (Rot3::EXPMAP by default). " "Otherwise, enable Rot3::EXPMAP, or if disabled, use Rot3::CAYLEY."), "slow_but_correct_betweenfactor": "Use the slower but correct version of BetweenFactor", - "support_nested_dissection": "Support Metis-based nested dissection", + "support_nested_dissection": "Support METIS-based nested dissection", "tangent_preintegration": "Use the new ImuFactor with integration on tangent space", "throw_cheirality_exception": "Throw exception when a triangulated point is behind a camera", "use_quaternions": ("Enable an internal Quaternion representation for rotations instead of rotation matrices. " @@ -130,29 +129,28 @@ def configure(self): self.options.rm_safe("fPIC") if self.options.with_TBB: self.options["onetbb"].tbbmalloc = True - if self.options.allow_deprecated_since_V4 != "deprecated": - self.output.warn("'allow_deprecated_since_V4' option is deprecated. Use 'allow_deprecated' instead.") - def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.83.0", transitive_headers=True) + self.requires("boost/1.84.0", transitive_headers=True) self.requires("eigen/3.4.0", transitive_headers=True) if self.options.with_TBB: - self.requires("onetbb/2021.10.0", transitive_headers=True) + if Version(self.version) >= "4.1": + self.requires("onetbb/2021.10.0", transitive_headers=True, transitive_libs=True) + else: + self.requires("onetbb/2020.3.3", transitive_headers=True, transitive_libs=True) if self.options.default_allocator == "tcmalloc": - self.requires("gperftools/2.11.0") - # TODO: add use_vendored_metis=False option - # if self.options.support_nested_dissection and not self.options.use_vendored_metis: - # # Used in a public header here: - # # https://github.com/borglab/gtsam/blob/4.2a9/gtsam_unstable/partition/FindSeparator-inl.h#L23-L27 - # self.requires("metis/5.1.1", transitive_headers=True) + self.requires("gperftools/2.15") + if self.options.support_nested_dissection: + # Used in a public header here: + # https://github.com/borglab/gtsam/blob/4.2.0/gtsam_unstable/partition/FindSeparator-inl.h#L23-L27 + self.requires("metis/5.2.1", transitive_headers=True, transitive_libs=True) @property def _required_boost_components(self): - # Based on https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleBoost.cmake#L26 + # Based on https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleBoost.cmake#L26 return [ "chrono", "date_time", @@ -181,10 +179,7 @@ def validate(self): if not self.dependencies["onetbb"].options.tbbmalloc: raise ConanInvalidConfiguration("GTSAM with TBB requires onetbb/*:tbbmalloc=True") elif self.options.default_allocator != "tcmalloc": - raise ConanInvalidConfiguration( - "with_TBB option cannot be used with" - f" default_allocator={self.options.default_allocator}" - ) + raise ConanInvalidConfiguration(f"with_TBB option cannot be used with default_allocator={self.options.default_allocator}") elif self.options.default_allocator == "TBB": raise ConanInvalidConfiguration("default_allocator=TBB requires with_TBB=True") @@ -198,18 +193,15 @@ def validate(self): else "https://github.com/borglab/gtsam/issues/1541" ) - if self.options.allow_deprecated_since_V4 != "deprecated": - self.output.warn( - "'allow_deprecated_since_V4' option is deprecated. Use 'allow_deprecated' instead." - ) + if self.options.support_nested_dissection and self.dependencies["metis"].options.with_64bit_types: + raise ConanInvalidConfiguration("GTSAM does not support METIS with 64-bit types") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) - tc.variables["BUILD_SHARED_LIBS"] = self.options.shared - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleGeneralOptions.cmake + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleGeneralOptions.cmake tc.variables["GTSAM_BUILD_UNSTABLE"] = self.options.build_unstable tc.variables["GTSAM_UNSTABLE_BUILD_PYTHON"] = False tc.variables["GTSAM_UNSTABLE_INSTALL_MATLAB_TOOLBOX"] = self.options.install_matlab_toolbox @@ -224,8 +216,6 @@ def generate(self): tc.variables["GTSAM_BUILD_PYTHON"] = False tc.variables["GTSAM_INSTALL_MATLAB_TOOLBOX"] = self.options.install_matlab_toolbox tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V4"] = self.options.allow_deprecated - if self.options.allow_deprecated_since_V4 != "deprecated": - tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V4"] = self.options.allow_deprecated_since_V4 tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V41"] = self.options.allow_deprecated tc.variables["GTSAM_ALLOW_DEPRECATED_SINCE_V42"] = self.options.allow_deprecated tc.variables["GTSAM_SUPPORT_NESTED_DISSECTION"] = self.options.support_nested_dissection @@ -234,30 +224,30 @@ def generate(self): if Version(self.version) >= "4.1": tc.variables["GTSAM_SLOW_BUT_CORRECT_BETWEENFACTOR"] = self.options.slow_but_correct_betweenfactor tc.variables["GTSAM_BUILD_WITH_CCACHE"] = False - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleAllocators.cmake + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleAllocators.cmake if self.options.default_allocator is not None: tc.variables["GTSAM_DEFAULT_ALLOCATOR"] = self.options.default_allocator - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/GtsamBuildTypes.cmake#L59 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/GtsamBuildTypes.cmake#L59 tc.variables["GTSAM_BUILD_TYPE_POSTFIXES"] = self.options.build_type_postfixes - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/GtsamBuildTypes.cmake#L193 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/GtsamBuildTypes.cmake#L193 tc.variables["GTSAM_BUILD_WITH_MARCH_NATIVE"] = self.options.build_with_march_native - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleBoost.cmake#L36 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleBoost.cmake#L36 tc.variables["GTSAM_DISABLE_NEW_TIMERS"] = self.options.disable_new_timers - # https://github.com/borglab/gtsam/blob/4.2a9/CppUnitLite/CMakeLists.txt#L13 + # https://github.com/borglab/gtsam/blob/4.2.0/CppUnitLite/CMakeLists.txt#L13 tc.variables["GTSAM_INSTALL_CPPUNITLITE"] = self.options.install_cppunitlite - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleEigen.cmake#L3 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleEigen.cmake#L3 tc.variables["GTSAM_USE_SYSTEM_EIGEN"] = True - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleMetis.cmake#L11 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleMetis.cmake#L11 tc.variables["GTSAM_USE_SYSTEM_METIS"] = False - # https://github.com/borglab/gtsam/blob/4.2a9/gtsam/3rdparty/CMakeLists.txt#L76 + # https://github.com/borglab/gtsam/blob/4.2.0/gtsam/3rdparty/CMakeLists.txt#L76 tc.variables["GTSAM_INSTALL_GEOGRAPHICLIB"] = False - # https://github.com/borglab/gtsam/blob/4.2a9/matlab/CMakeLists.txt#L14-L15 + # https://github.com/borglab/gtsam/blob/4.2.0/matlab/CMakeLists.txt#L14-L15 tc.variables["GTSAM_MEX_BUILD_STATIC_MODULE"] = False - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/GtsamTesting.cmake#L89-L91 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/GtsamTesting.cmake#L89-L91 tc.variables["GTSAM_BUILD_TESTS"] = False tc.variables["GTSAM_BUILD_EXAMPLES_ALWAYS"] = False tc.variables["GTSAM_BUILD_TIMING_ALWAYS"] = False - # https://github.com/borglab/gtsam/blob/4.2a9/doc/CMakeLists.txt + # https://github.com/borglab/gtsam/blob/4.2.0/doc/CMakeLists.txt tc.variables["GTSAM_BUILD_DOCS"] = False tc.variables["GTSAM_BUILD_DOC_HTML"] = False tc.variables["GTSAM_BUILD_DOC_LATEX"] = False @@ -273,9 +263,15 @@ def generate(self): tc.variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.shared tc.variables["Boost_NO_SYSTEM_PATHS"] = True + + if Version(self.version) < "4.1": + # Fix "The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated" + tc.preprocessor_definitions["BOOST_BIND_GLOBAL_PLACEHOLDERS"] = "" + tc.generate() deps = CMakeDeps(self) + deps.set_property("metis", "cmake_target_name", "metis-gtsam-if") deps.generate() def _patch_sources(self): @@ -287,22 +283,39 @@ def _patch_sources(self): replace_in_file(self, gtsam_build_types_cmake, "/MD ", f"/{msvc_runtime_flag(self)} ") replace_in_file(self, gtsam_build_types_cmake, "/MDd ", f"/{msvc_runtime_flag(self)} ") + # Ensure a newer CMake standard is used for non-cache_variables support and other policies + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "cmake_minimum_required(VERSION 3.0)", + "cmake_minimum_required(VERSION 3.15)") + + # Fix tcmalloc / gperftools handling if self.options.default_allocator == "tcmalloc": handle_allocators_path = os.path.join(self.source_folder, "cmake", "HandleAllocators.cmake") if Version(self.version) < "4.1": handle_allocators_path = os.path.join(self.source_folder, "CMakeLists.txt") - replace_in_file( - self, - handle_allocators_path, - "if(GOOGLE", - "find_package(gperftools REQUIRED)\nset(GOOGLE_PERFTOOLS_FOUND TRUE)\nif(GOOGLE", - ) - replace_in_file( - self, - handle_allocators_path, - 'GTSAM_ADDITIONAL_LIBRARIES "tcmalloc"', - 'GTSAM_ADDITIONAL_LIBRARIES "gperftools::gperftools"', - ) + replace_in_file(self, handle_allocators_path, + "if(GOOGLE", + ("find_package(gperftools REQUIRED)\n" + "set(GOOGLE_PERFTOOLS_FOUND TRUE)\n" + "if(GOOGLE")) + replace_in_file(self, handle_allocators_path, + 'GTSAM_ADDITIONAL_LIBRARIES "tcmalloc"', + 'GTSAM_ADDITIONAL_LIBRARIES "gperftools::gperftools"') + + # Fix HandleMetis.cmake incompatibility with METIS from Conan + save(self, os.path.join(self.source_folder, "cmake", "HandleMetis.cmake"), + "find_package(metis REQUIRED CONFIG)\n") + + # Fix TBB handling + handle_tbb_path = os.path.join(self.source_folder, "cmake", "HandleTBB.cmake") + if Version(self.version) < "4.1": + handle_tbb_path = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, handle_tbb_path, "find_package(TBB 4.4 ", "find_package(TBB ") + if Version(self.version) < "4.2.1": + replace_in_file(self, handle_tbb_path, + "list(APPEND GTSAM_ADDITIONAL_LIBRARIES tbb tbbmalloc)", + "list(APPEND GTSAM_ADDITIONAL_LIBRARIES TBB::tbb TBB::tbbmalloc)") + def build(self): self._patch_sources() @@ -345,6 +358,8 @@ def _module_file_rel_path(self): return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): + # GTSAM uses targets without a namespace prefix: + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/example_cmake_find_gtsam/CMakeLists.txt self.cpp_info.set_property("cmake_file_name", "GTSAM") gtsam = self.cpp_info.components["libgtsam"] @@ -356,10 +371,11 @@ def package_info(self): gtsam.requires.append("onetbb::onetbb") if self.options.default_allocator == "tcmalloc": gtsam.requires.append("gperftools::gperftools") - if self.options.support_nested_dissection: - gtsam.requires.append("libmetis-gtsam") if self.settings.os == "Windows": gtsam.system_libs = ["dbghelp"] + if Version(self.version) < "4.1": + # Fix "The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated" + gtsam.defines.append("BOOST_BIND_GLOBAL_PLACEHOLDERS") if self.options.build_unstable: gtsam_unstable = self.cpp_info.components["libgtsam_unstable"] @@ -368,13 +384,7 @@ def package_info(self): gtsam_unstable.requires = ["libgtsam"] if self.options.support_nested_dissection: - metis = self.cpp_info.components["libmetis-gtsam"] - metis.set_property("cmake_target_name", "metis-gtsam") - if Version(self.version) >= "4.1": - metis.libs = ["metis-gtsam"] - else: - metis.libs = ["metis"] - metis.names["pkg_config"] = "metis-gtsam" + gtsam.requires.append("metis::metis") if self.options.install_cppunitlite: cppunitlite = self.cpp_info.components["gtsam_CppUnitLite"] diff --git a/recipes/harfbuzz/all/conanfile.py b/recipes/harfbuzz/all/conanfile.py index a0f1c1c55554a..873c8a5081e27 100644 --- a/recipes/harfbuzz/all/conanfile.py +++ b/recipes/harfbuzz/all/conanfile.py @@ -84,7 +84,7 @@ def requirements(self): if self.options.with_icu: self.requires("icu/74.1") if self.options.with_glib: - self.requires("glib/2.78.1") + self.requires("glib/2.78.3") def validate(self): if self.options.shared and self.options.with_glib and not self.dependencies["glib"].options.shared: @@ -100,7 +100,7 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("meson/1.3.2") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/2.1.0") if self.options.with_glib: diff --git a/recipes/harfbuzz/all/test_package/conanfile.py b/recipes/harfbuzz/all/test_package/conanfile.py index e9a060aba448d..ca918824970c4 100644 --- a/recipes/harfbuzz/all/test_package/conanfile.py +++ b/recipes/harfbuzz/all/test_package/conanfile.py @@ -23,6 +23,5 @@ def build(self): def test(self): if can_run(self): - font = os.path.join(self.source_folder, "example.ttf") bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(f"{bin_path} {font}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/harfbuzz/all/test_package/example.ttf b/recipes/harfbuzz/all/test_package/example.ttf deleted file mode 100644 index 1849f5cc07efa..0000000000000 Binary files a/recipes/harfbuzz/all/test_package/example.ttf and /dev/null differ diff --git a/recipes/harfbuzz/all/test_package/test_package.c b/recipes/harfbuzz/all/test_package/test_package.c index 5f2ac9a8454e4..0bd42e5ab1456 100644 --- a/recipes/harfbuzz/all/test_package/test_package.c +++ b/recipes/harfbuzz/all/test_package/test_package.c @@ -1,141 +1,9 @@ -/* - * Copyright © 2011 Google, Inc. - * - * This is part of HarfBuzz, a text shaping library. - * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. - * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - * - * Google Author(s): Behdad Esfahbod - */ - -#include #include -#include - -#include "harfbuzz/hb.h" -#include "harfbuzz/hb-ot.h" - -#define FONT_SIZE 36 -#define MARGIN (FONT_SIZE * .5) - -/* Use native open type implementation to load font - https://github.com/harfbuzz/harfbuzz/issues/255 */ -hb_font_t* -get_font_ot(const char *filename, int size) -{ - size_t result = 0; - FILE* file = fopen(filename, "rb"); - fseek(file, 0, SEEK_END); - unsigned int length = ftell(file); - fseek(file, 0, SEEK_SET); - - char* data = (char*) malloc(length); - result = fread(data, length, 1, file); - if (result != 1) - { - fputs ("Reading error", stderr); - exit (3); - } - fclose(file); - - hb_blob_t* blob = hb_blob_create(data, length, HB_MEMORY_MODE_WRITABLE, (void*)data, NULL); - hb_face_t* face = hb_face_create(blob, 0); - hb_font_t* font = hb_font_create(face); - - hb_ot_font_set_funcs(font); - hb_font_set_scale(font, size, size); - - return font; -} - -int -main(int argc, char **argv) -{ - if (argc < 2) { - fprintf(stderr, "Usage: %s FONT\n", argv[0]); - return 1; - } - const char *fontfile = argv[1]; - const char *text = "conan-center-index"; - - /* Create hb-ft font. */ - hb_font_t *hb_font; - hb_font = get_font_ot (fontfile, FONT_SIZE*64); - - /* Create hb-buffer and populate. */ - hb_buffer_t *hb_buffer; - hb_buffer = hb_buffer_create (); - hb_buffer_add_utf8 (hb_buffer, text, -1, 0, -1); - hb_buffer_guess_segment_properties (hb_buffer); - - /* Shape it! */ - hb_shape (hb_font, hb_buffer, NULL, 0); - - /* Get glyph information and positions out of the buffer. */ - unsigned int len = hb_buffer_get_length (hb_buffer); - hb_glyph_info_t *info = hb_buffer_get_glyph_infos (hb_buffer, NULL); - hb_glyph_position_t *pos = hb_buffer_get_glyph_positions (hb_buffer, NULL); - - /* Print them out as is. */ - printf ("Raw buffer contents:\n"); - for (unsigned int i = 0; i < len; i++) - { - hb_codepoint_t gid = info[i].codepoint; - unsigned int cluster = info[i].cluster; - double x_advance = pos[i].x_advance / 64.; - double y_advance = pos[i].y_advance / 64.; - double x_offset = pos[i].x_offset / 64.; - double y_offset = pos[i].y_offset / 64.; - - char glyphname[32]; - hb_font_get_glyph_name (hb_font, gid, glyphname, sizeof (glyphname)); - - printf ("glyph='%s' cluster=%d advance=(%g,%g) offset=(%g,%g)\n", - glyphname, cluster, x_advance, y_advance, x_offset, y_offset); - } - - printf ("Converted to absolute positions:\n"); - /* And converted to absolute positions. */ - { - double current_x = 0; - double current_y = 0; - for (unsigned int i = 0; i < len; i++) - { - hb_codepoint_t gid = info[i].codepoint; - unsigned int cluster = info[i].cluster; - double x_position = current_x + pos[i].x_offset / 64.; - double y_position = current_y + pos[i].y_offset / 64.; - - - char glyphname[32]; - hb_font_get_glyph_name (hb_font, gid, glyphname, sizeof (glyphname)); - - printf ("glyph='%s' cluster=%d position=(%g,%g)\n", - glyphname, cluster, x_position, y_position); - - current_x += pos[i].x_advance / 64.; - current_y += pos[i].y_advance / 64.; - } - } - - hb_buffer_destroy (hb_buffer); - hb_font_destroy (hb_font); +#include +#include - return 0; +int main() { + const char *version = hb_version_string(); + printf("harfbuzz version: %s\n", version); + return 0; } diff --git a/recipes/harfbuzz/all/test_v1_package/conanfile.py b/recipes/harfbuzz/all/test_v1_package/conanfile.py index a4aa2f28304a1..994065a757445 100644 --- a/recipes/harfbuzz/all/test_v1_package/conanfile.py +++ b/recipes/harfbuzz/all/test_v1_package/conanfile.py @@ -13,7 +13,6 @@ def build(self): def test(self): if not tools.cross_building(self): - font = os.path.join(self.source_folder, "..", "test_package", "example.ttf") bin_path = os.path.join("bin", "test_package") - self.run(f"{bin_path} {font}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/hdf5/all/conandata.yml b/recipes/hdf5/all/conandata.yml index c5d710eb6a95b..c66f044984654 100644 --- a/recipes/hdf5/all/conandata.yml +++ b/recipes/hdf5/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.14.4.3": + url: "https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5_1.14.4.3.tar.gz" + sha256: "690c1db7ba0fed4ffac61709236675ffd99d95d191e8920ee79c58d7e7ea3361" "1.14.3": url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_14_3/hdf5-1_14_3.tar.gz" sha256: "df5ee33c74d5efb59738075ef96f4201588e1f1eeb233f047ac7fd1072dee1f6" diff --git a/recipes/hdf5/all/conanfile.py b/recipes/hdf5/all/conanfile.py index 2f176fad53d61..5a2f1eb605129 100644 --- a/recipes/hdf5/all/conanfile.py +++ b/recipes/hdf5/all/conanfile.py @@ -4,7 +4,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.build import can_run, check_min_cppstd, valid_min_cppstd +from conan.tools.build import cross_building, check_min_cppstd, valid_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir, save from conan.tools.scm import Version @@ -85,9 +85,6 @@ def requirements(self): self.requires("openmpi/4.1.0") def validate(self): - if not can_run(self): - # While building it runs some executables like H5detect - raise ConanInvalidConfiguration("Current recipe doesn't support cross-building (yet)") if self.options.parallel and not self.options.enable_unsupported: if self.options.enable_cxx: raise ConanInvalidConfiguration("Parallel and C++ options are mutually exclusive, forcefully allow with enable_unsupported=True") @@ -100,6 +97,11 @@ def validate(self): if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, self._min_cppstd) + def validate_build(self): + if cross_building(self) and Version(self.version) < "1.14.4.3": + # While building it runs some executables like H5detect + raise ConanInvalidConfiguration("Current recipe doesn't support cross-building (yet)") + def build_requirements(self): if Version(self.version) >= "1.14.0": self.tool_requires("cmake/[>=3.18 <4]") diff --git a/recipes/hdf5/config.yml b/recipes/hdf5/config.yml index 78000beb7c226..d6e57d05527a1 100644 --- a/recipes/hdf5/config.yml +++ b/recipes/hdf5/config.yml @@ -1,4 +1,6 @@ versions: + "1.14.4.3": + folder: all "1.14.3": folder: all "1.14.2": diff --git a/recipes/hictk/all/conandata.yml b/recipes/hictk/all/conandata.yml index ba37c76167468..950caed4f27fb 100644 --- a/recipes/hictk/all/conandata.yml +++ b/recipes/hictk/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.0.12": + url: "https://github.com/paulsengroup/hictk/archive/refs/tags/v0.0.12.tar.gz" + sha256: "03e8f7c0076ea6209fdfee1580658e871895f6a59b895407c4a25512b9558fb7" "0.0.10": url: "https://github.com/paulsengroup/hictk/archive/refs/tags/v0.0.10.tar.gz" sha256: "0b2d60af73578b292317e5ab513f24965176f9852ceda29e8d02007a434588c3" diff --git a/recipes/hictk/all/conanfile.py b/recipes/hictk/all/conanfile.py index 5993c72d21567..287868ebce18c 100644 --- a/recipes/hictk/all/conanfile.py +++ b/recipes/hictk/all/conanfile.py @@ -40,8 +40,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("bshoshany-thread-pool/4.0.1", transitive_headers=True) - self.requires("fast_float/6.1.0", transitive_headers=True) + self.requires("bshoshany-thread-pool/4.1.0", transitive_headers=True) + self.requires("fast_float/6.1.1", transitive_headers=True) if self.options.with_eigen: self.requires("eigen/3.4.0", transitive_headers=True) self.requires("fmt/10.2.1", transitive_headers=True) @@ -49,9 +49,9 @@ def requirements(self): self.requires("highfive/2.9.0", transitive_headers=True) self.requires("libdeflate/1.19", transitive_headers=True) self.requires("parallel-hashmap/1.3.11", transitive_headers=True) # Note: v1.3.11 is more recent than v1.37 - self.requires("span-lite/0.10.3", transitive_headers=True) + self.requires("span-lite/0.11.0", transitive_headers=True) self.requires("spdlog/1.13.0", transitive_headers=True) - self.requires("zstd/1.5.5", transitive_headers=True) + self.requires("zstd/1.5.6", transitive_headers=True) if Version(self.version) == "0.0.3": self.requires("xxhash/0.8.2", transitive_headers=True) @@ -121,3 +121,6 @@ def package_info(self): self.cpp_info.libdirs = [] self.cpp_info.set_property("cmake_file_name", "hictk") self.cpp_info.set_property("cmake_target_name", "hictk::libhictk") + + if self.options.with_eigen: + self.cpp_info.defines.append("HICTK_WITH_EIGEN") diff --git a/recipes/hictk/all/test_package/test_package.cpp b/recipes/hictk/all/test_package/test_package.cpp index bbe13ab6a3219..30467b8f8512b 100644 --- a/recipes/hictk/all/test_package/test_package.cpp +++ b/recipes/hictk/all/test_package/test_package.cpp @@ -1,8 +1,13 @@ -#include -#include "hictk/fmt.hpp" -#include "hictk/cooler/utils.hpp" +#include + +#include "hictk/file.hpp" int main(int argc, char** argv) { - fmt::print("{}\n", hictk::cooler::utils::is_cooler(argv[0])); + try { + const hictk::File f(argv[0], 10); // This is expected to throw + return 1; + } catch (const std::exception& e) { + return 0; + } } diff --git a/recipes/hictk/config.yml b/recipes/hictk/config.yml index 351a3e971990d..2b16ffcd223a6 100644 --- a/recipes/hictk/config.yml +++ b/recipes/hictk/config.yml @@ -1,4 +1,6 @@ versions: + "0.0.12": + folder: all "0.0.10": folder: all "0.0.9": diff --git a/recipes/highs/all/conandata.yml b/recipes/highs/all/conandata.yml index 412ffae12f185..006006dd92224 100644 --- a/recipes/highs/all/conandata.yml +++ b/recipes/highs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.7.2": + url: "https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v1.7.2.tar.gz" + sha256: "5ff96c14ae19592d3568e9ae107624cbaf3409d328fb1a586359f0adf9b34bf7" "1.7.0": url: "https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v1.7.0.tar.gz" sha256: "D10175AD66E7F113AC5DC00C9D6650A620663A6884FBF2942D6EB7A3D854604F" diff --git a/recipes/highs/config.yml b/recipes/highs/config.yml index 2fc1c9523304b..bf38309e9bf30 100644 --- a/recipes/highs/config.yml +++ b/recipes/highs/config.yml @@ -1,4 +1,6 @@ versions: + "1.7.2": + folder: all "1.7.0": folder: all "1.6.0": diff --git a/recipes/highway/all/conandata.yml b/recipes/highway/all/conandata.yml index 959f287f753da..0d5218b55b50f 100644 --- a/recipes/highway/all/conandata.yml +++ b/recipes/highway/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.0": + url: "https://github.com/google/highway/archive/1.2.0.tar.gz" + sha256: "7e0be78b8318e8bdbf6fa545d2ecb4c90f947df03f7aadc42c1967f019e63343" "1.1.0": url: "https://github.com/google/highway/archive/1.1.0.tar.gz" sha256: "354a8b4539b588e70b98ec70844273e3f2741302c4c377bcc4e81b3d1866f7c9" @@ -32,3 +35,9 @@ sources: "0.12.2": url: "https://github.com/google/highway/archive/0.12.2.tar.gz" sha256: "e1d47ce510429fdcf31f41697ca74fb0dcd59d933196e531a86d51751a56f4cc" +patches: + "1.2.0": + - patch_file: "patches/1.2.0-0001-fix-dllexport.patch" + patch_description: "fix incorrect DLLEXPORT" + patch_type: "backport" + patch_source: "https://github.com/google/highway/pull/2229" diff --git a/recipes/highway/all/patches/1.2.0-0001-fix-dllexport.patch b/recipes/highway/all/patches/1.2.0-0001-fix-dllexport.patch new file mode 100644 index 0000000000000..30ecee4740bdb --- /dev/null +++ b/recipes/highway/all/patches/1.2.0-0001-fix-dllexport.patch @@ -0,0 +1,91 @@ +diff --git a/hwy/contrib/thread_pool/topology.cc b/hwy/contrib/thread_pool/topology.cc +index 3d24f4f..17f3563 100644 +--- a/hwy/contrib/thread_pool/topology.cc ++++ b/hwy/contrib/thread_pool/topology.cc +@@ -64,7 +64,7 @@ + + namespace hwy { + +-HWY_DLLEXPORT bool HaveThreadingSupport() { ++HWY_CONTRIB_DLLEXPORT bool HaveThreadingSupport() { + #if HWY_ARCH_WASM + return emscripten_has_threading_support() != 0; + #else +@@ -72,7 +72,7 @@ HWY_DLLEXPORT bool HaveThreadingSupport() { + #endif + } + +-HWY_DLLEXPORT size_t TotalLogicalProcessors() { ++HWY_CONTRIB_DLLEXPORT size_t TotalLogicalProcessors() { + size_t lp = 0; + #if HWY_ARCH_WASM + const int num_cores = emscripten_num_logical_cores(); +@@ -111,7 +111,7 @@ HWY_DLLEXPORT size_t TotalLogicalProcessors() { + #include + #endif + +-HWY_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps) { ++HWY_CONTRIB_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps) { + #if HWY_OS_WIN + // Only support the first 64 because WINE does not support processor groups. + const HANDLE hThread = GetCurrentThread(); +@@ -173,7 +173,7 @@ HWY_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps) { + #endif + } + +-HWY_DLLEXPORT bool SetThreadAffinity(const LogicalProcessorSet& lps) { ++HWY_CONTRIB_DLLEXPORT bool SetThreadAffinity(const LogicalProcessorSet& lps) { + #if HWY_OS_WIN + const HANDLE hThread = GetCurrentThread(); + const DWORD_PTR prev = SetThreadAffinityMask(hThread, lps.Get64()); +@@ -385,7 +385,7 @@ std::vector DetectPackages(std::vector& lps) { + } // namespace + #endif // HWY_OS_LINUX + +-HWY_DLLEXPORT Topology::Topology() { ++HWY_CONTRIB_DLLEXPORT Topology::Topology() { + #if HWY_OS_LINUX + lps.resize(TotalLogicalProcessors()); + const std::vector& per_package = DetectPackages(lps); +diff --git a/hwy/contrib/thread_pool/topology.h b/hwy/contrib/thread_pool/topology.h +index 95b0835..f80fc47 100644 +--- a/hwy/contrib/thread_pool/topology.h ++++ b/hwy/contrib/thread_pool/topology.h +@@ -28,7 +28,7 @@ + namespace hwy { + + // Returns false if std::thread should not be used. +-HWY_DLLEXPORT bool HaveThreadingSupport(); ++HWY_CONTRIB_DLLEXPORT bool HaveThreadingSupport(); + + // Upper bound on logical processors, including hyperthreads. + static constexpr size_t kMaxLogicalProcessors = 1024; // matches glibc +@@ -38,12 +38,12 @@ using LogicalProcessorSet = BitSet4096; + + // Returns false, or sets `lps` to all logical processors which are online and + // available to the current thread. +-HWY_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps); ++HWY_CONTRIB_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps); + + // Ensures the current thread can only run on the logical processors in `lps`. + // Returns false if not supported (in particular on Apple), or if the + // intersection between `lps` and `GetThreadAffinity` is the empty set. +-HWY_DLLEXPORT bool SetThreadAffinity(const LogicalProcessorSet& lps); ++HWY_CONTRIB_DLLEXPORT bool SetThreadAffinity(const LogicalProcessorSet& lps); + + // Returns false, or ensures the current thread will only run on `lp`, which + // must not exceed `TotalLogicalProcessors`. Note that this merely calls +@@ -58,11 +58,11 @@ static inline bool PinThreadToLogicalProcessor(size_t lp) { + // provided by the hardware clamped to `kMaxLogicalProcessors`. + // These processors are not necessarily all usable; you can determine which are + // via GetThreadAffinity(). +-HWY_DLLEXPORT size_t TotalLogicalProcessors(); ++HWY_CONTRIB_DLLEXPORT size_t TotalLogicalProcessors(); + + struct Topology { + // Caller must check packages.empty(); if so, do not use any fields. +- HWY_DLLEXPORT Topology(); ++ HWY_CONTRIB_DLLEXPORT Topology(); + + // Clique of cores with lower latency to each other. On Apple M1 these are + // four cores sharing an L2. On Zen4 these 'CCX' are up to eight cores sharing diff --git a/recipes/highway/config.yml b/recipes/highway/config.yml index 1af21a7852ddb..a5864ae8e0682 100644 --- a/recipes/highway/config.yml +++ b/recipes/highway/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.0": folder: all "1.0.7": diff --git a/recipes/hiredis/0.x.x/conandata.yml b/recipes/hiredis/0.x.x/conandata.yml deleted file mode 100644 index 0b74d88eff05f..0000000000000 --- a/recipes/hiredis/0.x.x/conandata.yml +++ /dev/null @@ -1,8 +0,0 @@ -sources: - "0.14.1": - url: "https://github.com/redis/hiredis/archive/v0.14.1.tar.gz" - sha256: "2663b2aed9fd430507e30fc5e63274ee40cdd1a296026e22eafd7d99b01c8913" -patches: - "0.14.1": - - patch_file: "patches/0001-fix-makefile.patch" - base_path: "source_subfolder" diff --git a/recipes/hiredis/0.x.x/conanfile.py b/recipes/hiredis/0.x.x/conanfile.py deleted file mode 100644 index f94cea21a0db9..0000000000000 --- a/recipes/hiredis/0.x.x/conanfile.py +++ /dev/null @@ -1,78 +0,0 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -import os - -required_conan_version = ">=1.36.0" - - -class HiredisConan(ConanFile): - name = "hiredis" - description = "Hiredis is a minimalistic C client library for the Redis database." - license = "BSD-3-Clause" - topics = ("hiredis", "redis", "client", "database") - homepage = "https://github.com/redis/hiredis" - url = "https://github.com/conan-io/conan-center-index" - - 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 export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) - - def configure(self): - if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx - - def validate(self): - if self.settings.os == "Windows": - raise ConanInvalidConfiguration("hiredis {} is not supported on Windows.".format(self.version)) - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - # Do not force PIC if static - if not self.options.shared: - makefile = os.path.join(self._source_subfolder, "Makefile") - tools.replace_in_file(makefile, "-fPIC ", "") - - def build(self): - self._patch_sources() - with tools.chdir(self._source_subfolder): - autoTools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autoTools.make() - - def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - with tools.chdir(self._source_subfolder): - autoTools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autoTools.install(vars={ - "DESTDIR": tools.unix_path(self.package_folder), - "PREFIX": "", - }) - tools.remove_files_by_mask( - os.path.join(self.package_folder, "lib"), - "*.a" if self.options.shared else "*.[so|dylib]*", - ) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - - def package_info(self): - self.cpp_info.set_property("pkg_config_name", "hiredis") - self.cpp_info.libs = ["hiredis"] diff --git a/recipes/hiredis/0.x.x/patches/0001-fix-makefile.patch b/recipes/hiredis/0.x.x/patches/0001-fix-makefile.patch deleted file mode 100644 index 52271f0ac9947..0000000000000 --- a/recipes/hiredis/0.x.x/patches/0001-fix-makefile.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- a/Makefile_old -+++ b/Makefile -@@ -38,10 +38,8 @@ export REDIS_TEST_CONFIG - # Fallback to gcc when $CC is not in $PATH. - CC:=$(shell sh -c 'type $${CC%% *} >/dev/null 2>/dev/null && echo $(CC) || echo gcc') - CXX:=$(shell sh -c 'type $${CXX%% *} >/dev/null 2>/dev/null && echo $(CXX) || echo g++') --OPTIMIZATION?=-O3 - WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings --DEBUG_FLAGS?= -g -ggdb --REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG_FLAGS) -+REAL_CFLAGS=-fPIC $(CFLAGS) $(WARNINGS) - REAL_LDFLAGS=$(LDFLAGS) - - DYLIBSUFFIX=so -@@ -49,7 +47,7 @@ STLIBSUFFIX=a - DYLIB_MINOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_SONAME) - DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR) - DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX) --DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS) -+DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(CFLAGS) $(LDFLAGS) - STLIBNAME=$(LIBNAME).$(STLIBSUFFIX) - STLIB_MAKE_CMD=ar rcs $(STLIBNAME) - -@@ -57,15 +55,15 @@ STLIB_MAKE_CMD=ar rcs $(STLIBNAME) - uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') - ifeq ($(uname_S),SunOS) - REAL_LDFLAGS+= -ldl -lnsl -lsocket -- DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(LDFLAGS) -+ DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(CFLAGS) $(LDFLAGS) - endif - ifeq ($(uname_S),Darwin) - DYLIBSUFFIX=dylib - DYLIB_MINOR_NAME=$(LIBNAME).$(HIREDIS_SONAME).$(DYLIBSUFFIX) -- DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS) -+ DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(CFLAGS) $(LDFLAGS) - endif - --all: $(DYLIBNAME) $(STLIBNAME) hiredis-test $(PKGCONFNAME) -+all: $(DYLIBNAME) $(STLIBNAME) $(PKGCONFNAME) - - # Deps (use make dep to generate this) - alloc.o: alloc.c fmacros.h alloc.h diff --git a/recipes/hiredis/0.x.x/test_package/CMakeLists.txt b/recipes/hiredis/0.x.x/test_package/CMakeLists.txt deleted file mode 100644 index 7b9b613cbb24a..0000000000000 --- a/recipes/hiredis/0.x.x/test_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/hiredis/0.x.x/test_package/conanfile.py b/recipes/hiredis/0.x.x/test_package/conanfile.py deleted file mode 100644 index 5c09494bc67c0..0000000000000 --- a/recipes/hiredis/0.x.x/test_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/hiredis/0.x.x/test_package/test_package.c b/recipes/hiredis/0.x.x/test_package/test_package.c deleted file mode 100644 index 6df475bd4539a..0000000000000 --- a/recipes/hiredis/0.x.x/test_package/test_package.c +++ /dev/null @@ -1,21 +0,0 @@ -#include - -#include -#include - -int main() -{ - printf("hiredis version: %i.%i.%i\n", HIREDIS_MAJOR, HIREDIS_MINOR, HIREDIS_PATCH); - - const char *hostname = "127.0.0.1"; - int port = 6379; - - redisContext *c = redisConnect(hostname, port); - if (c == NULL) - { - printf("Error: Can't allocate redis context\n"); - return EXIT_FAILURE; - } - - return EXIT_SUCCESS; -} diff --git a/recipes/hiredis/config.yml b/recipes/hiredis/config.yml index 44921f335f1c8..977ca3a028023 100644 --- a/recipes/hiredis/config.yml +++ b/recipes/hiredis/config.yml @@ -7,5 +7,3 @@ versions: folder: all "1.0.0": folder: all - "0.14.1": - folder: "0.x.x" diff --git a/recipes/hwdata/all/conandata.yml b/recipes/hwdata/all/conandata.yml index b5373423e2800..e9aebcb14c2d1 100644 --- a/recipes/hwdata/all/conandata.yml +++ b/recipes/hwdata/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.382": + url: "https://github.com/vcrhonek/hwdata/archive/v0.382.tar.gz" + sha256: "5e25457b562a5227eb77eac21d5e4344bd1183c7d62b41e7d3e780ae33e053c1" "0.378": url: "https://github.com/vcrhonek/hwdata/archive/v0.378.tar.gz" sha256: "098ea8db12a50290f4b23f7f521edf9c5bab25935d2740de17e4a487110b40c8" diff --git a/recipes/hwdata/config.yml b/recipes/hwdata/config.yml index edc1993064ac3..f134cf723e787 100644 --- a/recipes/hwdata/config.yml +++ b/recipes/hwdata/config.yml @@ -1,4 +1,6 @@ versions: + "0.382": + folder: all "0.378": folder: all "0.376": diff --git a/recipes/hwloc/all/conandata.yml b/recipes/hwloc/all/conandata.yml index c3a77f045e4ad..1f50c80dd4055 100644 --- a/recipes/hwloc/all/conandata.yml +++ b/recipes/hwloc/all/conandata.yml @@ -1,19 +1,7 @@ sources: + "2.10.0": + url: "https://download.open-mpi.org/release/hwloc/v2.10/hwloc-2.10.0.tar.bz2" + sha256: "0305dd60c9de2fbe6519fe2a4e8fdc6d3db8de574a0ca7812b92e80c05ae1392" "2.9.3": - sha256: "5985db3a30bbe51234c2cd26ebe4ae9b4c3352ab788b1a464c40c0483bf4de59" - url: https://download.open-mpi.org/release/hwloc/v2.9/hwloc-2.9.3.tar.gz - "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 - "2.9.0": - sha256: "9d7d3450e0a5fea4cb80ca07dc8db939abb7ab62e2a7bb27f9376447658738ec" - url: https://download.open-mpi.org/release/hwloc/v2.9/hwloc-2.9.0.tar.gz - "2.8.0": - sha256: "20b2bd4df436827d8e50f7afeafb6f967259f2fb374ce7330244f8d0ed2dde6f" - url: https://download.open-mpi.org/release/hwloc/v2.8/hwloc-2.8.0.tar.gz - "2.7.2": - sha256: "407d2712b1c9026787461ddb62044fa9b5c6007755ca37652b360d837a75344f" - url: https://download.open-mpi.org/release/hwloc/v2.7/hwloc-2.7.2.tar.gz + url: "https://download.open-mpi.org/release/hwloc/v2.9/hwloc-2.9.3.tar.bz2" + sha256: "5c4062ce556f6d3451fc177ffb8673a2120f81df6835dea6a21a90fbdfff0dec" diff --git a/recipes/hwloc/all/conanfile.py b/recipes/hwloc/all/conanfile.py index 231701d41f587..ff20e76545dae 100644 --- a/recipes/hwloc/all/conanfile.py +++ b/recipes/hwloc/all/conanfile.py @@ -32,7 +32,7 @@ def configure(self): def requirements(self): if self.options.with_libxml2: - self.requires("libxml2/2.12.3") + self.requires("libxml2/[>=2.12.5 <3]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/hwloc/config.yml b/recipes/hwloc/config.yml index d1ef77599f89a..2da6ef856dca9 100644 --- a/recipes/hwloc/config.yml +++ b/recipes/hwloc/config.yml @@ -1,13 +1,5 @@ versions: - "2.9.3": - folder: all - "2.9.2": - folder: all - "2.9.1": + "2.10.0": folder: all - "2.9.0": - folder: all - "2.8.0": - folder: all - "2.7.2": + "2.9.3": folder: all diff --git a/recipes/iceoryx/all/conandata.yml b/recipes/iceoryx/all/conandata.yml index 478d85f83e606..22e1451348b38 100644 --- a/recipes/iceoryx/all/conandata.yml +++ b/recipes/iceoryx/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.6": + url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v2.0.6.tar.gz" + sha256: "a2add8ffee0c3357ef985cc46c7de79ccb754ea2bed02c61f2ff805ab2c869f1" "2.0.5": url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v2.0.5.tar.gz" sha256: "bf6de70e3edee71223f993a29bff5e61af95ce4871104929d8bd1729f544bafb" diff --git a/recipes/iceoryx/all/conanfile.py b/recipes/iceoryx/all/conanfile.py index 30d23ca370fb4..3144cdb2e4a59 100644 --- a/recipes/iceoryx/all/conanfile.py +++ b/recipes/iceoryx/all/conanfile.py @@ -5,7 +5,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd, stdcpp_library from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rmdir, save +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rmdir, save, rm from conan.tools.microsoft import is_msvc, check_min_vs from conan.tools.scm import Version @@ -146,6 +146,7 @@ def package(self): copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, ".clang-tidy", os.path.join(self.package_folder, "include"), recursive=True) if self.options.toml_config: mkdir(self, os.path.join(self.package_folder, "res")) rename(self, os.path.join(self.package_folder, "etc", "roudi_config_example.toml"), diff --git a/recipes/iceoryx/config.yml b/recipes/iceoryx/config.yml index 8a33c3c252222..4a60749deb79c 100644 --- a/recipes/iceoryx/config.yml +++ b/recipes/iceoryx/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.6": + folder: all "2.0.5": folder: all "2.0.3": diff --git a/recipes/iconfontcppheaders/all/conandata.yml b/recipes/iconfontcppheaders/all/conandata.yml index 9cba4ae5061fd..81e9b251ba0f8 100644 --- a/recipes/iconfontcppheaders/all/conandata.yml +++ b/recipes/iconfontcppheaders/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "cci.20240620": + sha256: 363613c9ea6b4d4b290527bc1fcd626b09accd985a40f14442e86d1df16ec487 + url: https://github.com/juliettef/IconFontCppHeaders/archive/62d27fa93d8f1f881dac18f13881dd97af66fa74/main.zip + "cci.20240128": + sha256: de946a4471dca969426b2e7863d79136a91f2e4e4cc7a766df31bbb8412571f9 + url: https://github.com/juliettef/IconFontCppHeaders/archive/8886c5657bac22b8fee34354871e3ade2a596433/main.zip "cci.20231102": sha256: 7618e844dcbfea2404c209e8b52158a37c2368a79cc77e94087375a8186442c4 url: https://github.com/juliettef/IconFontCppHeaders/archive/41b304750e83c0a89375cc1834f65c1204308b4a/main.zip diff --git a/recipes/iconfontcppheaders/all/conanfile.py b/recipes/iconfontcppheaders/all/conanfile.py index 5541ed9fd754d..278c4d54b8232 100644 --- a/recipes/iconfontcppheaders/all/conanfile.py +++ b/recipes/iconfontcppheaders/all/conanfile.py @@ -9,7 +9,7 @@ class FireHppConan(ConanFile): name = "iconfontcppheaders" - description = "Headers for icon fonts Font Awesome, Fork Awesome, Google Material Design, Pictogrammers Material Design icons, Kenney game icons, Fontaudio, Codicons and Lucide." + description = "Headers for icon fonts Font Awesome, Fork Awesome, Google Material Design Icons, Google Material Design Symbols, Pictogrammers Material Design icons, Kenney game icons, Fontaudio, Codicons and Lucide." license = "Zlib" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/juliettef/IconFontCppHeaders" diff --git a/recipes/iconfontcppheaders/config.yml b/recipes/iconfontcppheaders/config.yml index 4c1b72279193a..163b17b48651e 100644 --- a/recipes/iconfontcppheaders/config.yml +++ b/recipes/iconfontcppheaders/config.yml @@ -1,4 +1,8 @@ versions: + "cci.20240620": + folder: all + "cci.20240128": + folder: all "cci.20231102": folder: all "cci.20231026": diff --git a/recipes/icu/all/conanfile.py b/recipes/icu/all/conanfile.py index 9e343976b416b..56924b287ebfd 100644 --- a/recipes/icu/all/conanfile.py +++ b/recipes/icu/all/conanfile.py @@ -69,6 +69,8 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + if Version(self.version) >= "74.1": + self.license = "Unicode-3.0" def validate(self): if self.options.dat_package_file: diff --git a/recipes/iguana/all/conandata.yml b/recipes/iguana/all/conandata.yml index 48d127d2fc21f..dc65f73b11bc3 100644 --- a/recipes/iguana/all/conandata.yml +++ b/recipes/iguana/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.0.5": + url: "https://github.com/qicosmos/iguana/archive/refs/tags/1.0.5.tar.gz" + sha256: "b7a7385c49574a60f9f6bf887c1addbc08f557a0117bf18cf7eec532ac2536b1" + "1.0.4": + url: "https://github.com/qicosmos/iguana/archive/refs/tags/1.0.4.tar.gz" + sha256: "b584cd26e65902a14a3a349ebc480beb7b4502fd5a5ffa3cb7c6102d857958b1" "1.0.3": url: "https://github.com/qicosmos/iguana/archive/refs/tags/v1.0.3.tar.gz" sha256: "7dcb21a36bd64a63a9ea857f3563ac61e965c49ec60ad7b99a2bfb9192f3e4c3" diff --git a/recipes/iguana/all/conanfile.py b/recipes/iguana/all/conanfile.py index 4bbd7a9302f02..20b73f1969975 100644 --- a/recipes/iguana/all/conanfile.py +++ b/recipes/iguana/all/conanfile.py @@ -21,14 +21,14 @@ class IguanaConan(ConanFile): @property def _min_cppstd(self): - return 20 + return 17 @property def _compilers_minimum_version(self): return { - "gcc": "11", - "clang": "12", - "apple-clang": "14", + "gcc": "8", + "clang": "7", + "apple-clang": "12", "Visual Studio": "16", "msvc": "192", } diff --git a/recipes/iguana/all/test_package/CMakeLists.txt b/recipes/iguana/all/test_package/CMakeLists.txt index 96ed5d3dde518..be16f17fdd6e3 100644 --- a/recipes/iguana/all/test_package/CMakeLists.txt +++ b/recipes/iguana/all/test_package/CMakeLists.txt @@ -5,4 +5,4 @@ find_package(iguana REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE iguana::iguana) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/iguana/config.yml b/recipes/iguana/config.yml index 372dd1cb646bd..7ec6a422c89a7 100644 --- a/recipes/iguana/config.yml +++ b/recipes/iguana/config.yml @@ -1,3 +1,7 @@ versions: + "1.0.5": + folder: all + "1.0.4": + folder: all "1.0.3": folder: all diff --git a/recipes/imagl/all/conandata.yml b/recipes/imagl/all/conandata.yml index 338c8a935d27e..83cf32f1dbe98 100644 --- a/recipes/imagl/all/conandata.yml +++ b/recipes/imagl/all/conandata.yml @@ -16,15 +16,27 @@ patches: - patch_file: "patches/0001-no-unmanaged-conan-0.1.x.patch" patch_description: "No unmanaged conan: update CMakeLists.txt remove call to conan" patch_type: conan + - patch_file: "patches/0002-use-findpackage-0.1.x.patch" + patch_description: "Use find_package: update CMakeLists.txt to use modern find_package compatible with conan 2.0" + patch_type: conan "0.1.1": - patch_file: "patches/0001-no-unmanaged-conan-0.1.x.patch" patch_description: "No unmanaged conan: update CMakeLists.txt remove call to conan" patch_type: conan + - patch_file: "patches/0002-use-findpackage-0.1.x.patch" + patch_description: "Use find_package: update CMakeLists.txt to use modern find_package compatible with conan 2.0" + patch_type: conan "0.1.2": - patch_file: "patches/0001-no-unmanaged-conan-0.1.x.patch" patch_description: "No unmanaged conan: update CMakeLists.txt remove call to conan" patch_type: conan + - patch_file: "patches/0002-use-findpackage-0.1.x.patch" + patch_description: "Use find_package: update CMakeLists.txt to use modern find_package compatible with conan 2.0" + patch_type: conan "0.2.1": - patch_file: "patches/0001-no-unmanaged-conan-0.2.1.patch" patch_description: "No unmanaged conan: update CMakeLists.txt remove call to conan" patch_type: conan + - patch_file: "patches/0002-use-findpackage-0.2.1.patch" + patch_description: "Use find_package: update CMakeLists.txt to use modern find_package compatible with conan 2.0" + patch_type: conan diff --git a/recipes/imagl/all/patches/0002-use-findpackage-0.1.x.patch b/recipes/imagl/all/patches/0002-use-findpackage-0.1.x.patch new file mode 100644 index 0000000000000..8be7d6463c6b8 --- /dev/null +++ b/recipes/imagl/all/patches/0002-use-findpackage-0.1.x.patch @@ -0,0 +1,15 @@ +--- a/imaGL/CMakeLists.txt ++++ b/imaGL/CMakeLists.txt +@@ -12,9 +12,10 @@ set_property(TARGET libImaGL PROPERTY OUTPUT_NAME imaGL) + set_property(TARGET libImaGL PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/public/imaGL/imaGL.h") + target_include_directories(libImaGL INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/public") + +-if(TARGET CONAN_PKG::libpng) ++find_package(PNG) ++if(PNG_FOUND) + add_compile_definitions(_HAS_PNG) +- target_link_libraries (libImaGL CONAN_PKG::libpng) ++ target_link_libraries (libImaGL PNG::PNG) + endif() + + file(GLOB_RECURSE ImaGL_SRC "*.h" "*.cpp") diff --git a/recipes/imagl/all/patches/0002-use-findpackage-0.2.1.patch b/recipes/imagl/all/patches/0002-use-findpackage-0.2.1.patch new file mode 100644 index 0000000000000..0053f809e4461 --- /dev/null +++ b/recipes/imagl/all/patches/0002-use-findpackage-0.2.1.patch @@ -0,0 +1,23 @@ +--- a/imaGL/CMakeLists.txt ++++ b/imaGL/CMakeLists.txt +@@ -12,14 +12,16 @@ set_property(TARGET libImaGL PROPERTY OUTPUT_NAME imaGL) + set_property(TARGET libImaGL PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/public/imaGL/imaGL.h") + target_include_directories(libImaGL INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/public") + +-if(TARGET CONAN_PKG::libpng) ++find_package(PNG) ++if(PNG_FOUND) + add_compile_definitions(_HAS_PNG) +- target_link_libraries (libImaGL CONAN_PKG::libpng) ++ target_link_libraries (libImaGL PNG::PNG) + endif() + +-if(TARGET CONAN_PKG::libjpeg) ++find_package(JPEG) ++if(JPEG_FOUND) + add_compile_definitions(_HAS_JPEG) +- target_link_libraries (libImaGL CONAN_PKG::libjpeg) ++ target_link_libraries (libImaGL JPEG::JPEG) + endif() + + file(GLOB_RECURSE ImaGL_SRC "*.h" "*.cpp") diff --git a/recipes/imath/all/conandata.yml b/recipes/imath/all/conandata.yml index 605325978acfe..3f20468a0db96 100644 --- a/recipes/imath/all/conandata.yml +++ b/recipes/imath/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.11": + url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.11.tar.gz" + sha256: "9057849585e49b8b85abe7cc1e76e22963b01bfdc3b6d83eac90c499cd760063" "3.1.10": url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.10.tar.gz" sha256: "f2943e86bfb694e216c60b9a169e5356f8a90f18fbd34d7b6e3450be14f60b10" @@ -8,18 +11,6 @@ sources: "3.1.8": url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.8.tar.gz" sha256: "a23a4e2160ca8ff68607a4e129e484edd1d0d13f707394d32af7aed659020803" - "3.1.7": - url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.7.tar.gz" - sha256: "bff1fa140f4af0e7f02c6cb78d41b9a7d5508e6bcdfda3a583e35460eb6d4b47" - "3.1.6": - url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.6.tar.gz" - sha256: "ea5592230f5ab917bea3ceab266cf38eb4aa4a523078d46eac0f5a89c52304db" - "3.1.5": - url: "https://github.com/AcademySoftwareFoundation/Imath/archive/refs/tags/v3.1.5.tar.gz" - sha256: "1e9c7c94797cf7b7e61908aed1f80a331088cc7d8873318f70376e4aed5f25fb" - "3.1.4": - url: "https://github.com/AcademySoftwareFoundation/Imath/archive/refs/tags/v3.1.4.tar.gz" - sha256: "fcca5fbb37d375a252bacd8a29935569bdc28b888f01ef1d9299ca0c9e87c17a" patches: "3.1.10": - patch_file: "patches/3.1.10-gcc5-backport.patch" diff --git a/recipes/imath/config.yml b/recipes/imath/config.yml index a3cca600992b6..61b9f04e8a57f 100644 --- a/recipes/imath/config.yml +++ b/recipes/imath/config.yml @@ -1,15 +1,9 @@ versions: + "3.1.11": + folder: all "3.1.10": folder: all "3.1.9": folder: all "3.1.8": folder: all - "3.1.7": - folder: all - "3.1.6": - folder: all - "3.1.5": - folder: all - "3.1.4": - folder: all diff --git a/recipes/imgui/all/conandata.yml b/recipes/imgui/all/conandata.yml index e9eda4969aa9b..13e8b4cdf2bb6 100644 --- a/recipes/imgui/all/conandata.yml +++ b/recipes/imgui/all/conandata.yml @@ -1,67 +1,40 @@ sources: - "1.90.4": - url: "https://github.com/ocornut/imgui/archive/v1.90.4.tar.gz" - sha256: "5d9dc738af74efa357f2a9fc39fe4a28d29ef1dfc725dd2977ccf3f3194e996e" - "1.90.4-docking": - url: "https://github.com/ocornut/imgui/archive/v1.90.4-docking.tar.gz" - sha256: "91ac3c6fd83cc3bea38745af57665b13464ba235dc11373d0898ae6fe35a8a65" - "1.90.3": - url: "https://github.com/ocornut/imgui/archive/v1.90.3.tar.gz" - sha256: "40b302d01092c9393373b372fe07ea33ac69e9491893ebab3bf952b2c1f5fd23" - "1.90.3-docking": - url: "https://github.com/ocornut/imgui/archive/v1.90.3-docking.tar.gz" - sha256: "ebd1da0f76a95a7a690f8a0dfa119e1c6da4eee40383e582fb75374792be0891" - "1.90.2": - url: "https://github.com/ocornut/imgui/archive/v1.90.2.tar.gz" - sha256: "452d1c11e5c4b4dfcca272915644a65f1c076498e8318b141ca75cd30470dd68" - "1.90.2-docking": - url: "https://github.com/ocornut/imgui/archive/v1.90.2-docking.tar.gz" - sha256: "69f1cd78d49ec9cc847b7082d641434ea731f0be41c6930bea08a46a0794ac17" - "1.90.1": - url: "https://github.com/ocornut/imgui/archive/v1.90.1.tar.gz" - sha256: "21dcc985bb2ae8fe48047c86135dbc438d6980a8f2e08babbda5be820592f282" - "1.90.1-docking": - url: "https://github.com/ocornut/imgui/archive/v1.90.1-docking.tar.gz" - sha256: "6804c3d8dc6d83b892d3c5491d8164840079d9a795fb7c4cef2eaa1b04c86a0c" - "1.90": - url: "https://github.com/ocornut/imgui/archive/v1.90.tar.gz" - sha256: "170986e6a4b83d165bfc1d33c2c5a5bc2d67e5b97176287485c51a2299249296" - "1.90-docking": - url: "https://github.com/ocornut/imgui/archive/v1.90-docking.tar.gz" - sha256: "d4b7fd185443111a3a892d4625c85ab9666c6c9cb5484e3a447de6af419f8d2f" + "1.90.9": + url: "https://github.com/ocornut/imgui/archive/v1.90.9.tar.gz" + sha256: "04943919721e874ac75a2f45e6eb6c0224395034667bf508923388afda5a50bf" + "1.90.9-docking": + url: "https://github.com/ocornut/imgui/archive/v1.90.9-docking.tar.gz" + sha256: "48e7e4e4f154ad98d0946126a84e2375f849f6a67792129a805817dd60a34330" + "1.90.8": + url: "https://github.com/ocornut/imgui/archive/v1.90.8.tar.gz" + sha256: "f606b4fb406aa0f8dad36d4a9dd3d6f0fd39f5f0693e7468abc02d545fb505ae" + "1.90.8-docking": + url: "https://github.com/ocornut/imgui/archive/v1.90.8-docking.tar.gz" + sha256: "51845ed8b8e81490288c3c8165173d47e9bcf92f7d999aea800635f95587b9e7" + "1.90.7": + url: "https://github.com/ocornut/imgui/archive/v1.90.7.tar.gz" + sha256: "872574217643d4ad7e9e6df420bb8d9e0d468fb90641c2bf50fd61745e05de99" + "1.90.7-docking": + url: "https://github.com/ocornut/imgui/archive/v1.90.7-docking.tar.gz" + sha256: "582a9061a508b82b0ff6504aa17af6bb449bca9edf0a0f0f33bf729252cd3194" + "1.90.6": + url: "https://github.com/ocornut/imgui/archive/v1.90.6.tar.gz" + sha256: "70b4b05ac0938e82b4d5b8d59480d3e2ca63ca570dfb88c55023831f387237ad" + "1.90.6-docking": + url: "https://github.com/ocornut/imgui/archive/v1.90.6-docking.tar.gz" + sha256: "fc7f81d009ef718917aee0ac3ea1c74c8a5cfc8016049ad153b4d91d302b8aef" + "1.90.5": + url: "https://github.com/ocornut/imgui/archive/v1.90.5.tar.gz" + sha256: "e94b48dba7311c85ba8e3e6fe7c734d76a0eed21b2b42c5180fd5706d1562241" + "1.90.5-docking": + url: "https://github.com/ocornut/imgui/archive/v1.90.5-docking.tar.gz" + sha256: "8a5e1e594d6c8552e46e4c1ba8dd9deb51262067f04937904babc04384533ccc" "1.89.9": url: "https://github.com/ocornut/imgui/archive/v1.89.9.tar.gz" sha256: "1acc27a778b71d859878121a3f7b287cd81c29d720893d2b2bf74455bf9d52d6" "1.89.9-docking": url: "https://github.com/ocornut/imgui/archive/v1.89.9-docking.tar.gz" sha256: "2481489ce9091239b3cab8a330d0409ffdd9ee607ad1f3fe3a0b0b751c27a8eb" - "1.89.8": - url: "https://github.com/ocornut/imgui/archive/v1.89.8.tar.gz" - sha256: "6680ccc32430009a8204291b1268b2367d964bd6d1b08a4e0358a017eb8e8c9e" - "1.89.8-docking": - url: "https://github.com/ocornut/imgui/archive/v1.89.8-docking.tar.gz" - sha256: "d48c4856e42a8fa3e6df3efae7eae86012fa65d9dceb03d1a2080a2386063635" - "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" - "1.89.3": - url: "https://github.com/ocornut/imgui/archive/v1.89.3.tar.gz" - sha256: "3b665fadd5580b7ef494d5d8bb1c12b2ec53ee723034caf43332956381f5d631" - "1.89.2": - url: "https://github.com/ocornut/imgui/archive/v1.89.2.tar.gz" - sha256: "e110beffda505e6954feb7b13541d35a7c12a176b9723290c853684713df6a67" - "1.89.1": - url: "https://github.com/ocornut/imgui/archive/v1.89.1.tar.gz" - sha256: "6d02a0079514d869e4b5f8f590f9060259385fcddd93a07ef21298b6a9610cbd" "1.88": url: "https://github.com/ocornut/imgui/archive/v1.88.tar.gz" sha256: "9f14c788aee15b777051e48f868c5d4d959bd679fc5050e3d2a29de80d8fd32e" @@ -74,16 +47,3 @@ sources: "1.85": url: "https://github.com/ocornut/imgui/archive/v1.85.tar.gz" sha256: "7ed49d1f4573004fa725a70642aaddd3e06bb57fcfe1c1a49ac6574a3e895a77" - - # These versions belong to the docking branch in ImGUI repository. This branch is declared stable and production ready, and - # it is synced with `master` regularly. These versions are taken from that branch using the commit where `master` was synced - # after a regular release - "cci.20230105+1.89.2.docking": - url: "https://github.com/ocornut/imgui/archive/d822c65317ba881798bed8fce9ffba267d27dada.zip" - sha256: "0d2c09ae4c450d4c74f62e66667809752c9d11438354fc331ed9da5d5e850071" - "cci.20220621+1.88.docking": - url: "https://github.com/ocornut/imgui/archive/9cd9c2eff99877a3f10a7f9c2a3a5b9c15ea36c6.tar.gz" - sha256: "61fb1ce5d48089bce1b4f92e9320fd234b2ce960f35f965b313c4842b3c8e440" - "cci.20220207+1.87.docking": - url: "https://github.com/ocornut/imgui/archive/1ee252772ae9c0a971d06257bb5c89f628fa696a.tar.gz" - sha256: "c50e263660e1deb6e85b10a0382bf8a6fc861645e44b7012bd32da5460829ae0" diff --git a/recipes/imgui/config.yml b/recipes/imgui/config.yml index 9443d0df2e210..a40371b3d6a3b 100644 --- a/recipes/imgui/config.yml +++ b/recipes/imgui/config.yml @@ -1,46 +1,28 @@ versions: - "1.90.4": + "1.90.9": folder: all - "1.90.4-docking": + "1.90.9-docking": folder: all - "1.90.3": + "1.90.8": folder: all - "1.90.3-docking": + "1.90.8-docking": folder: all - "1.90.2": + "1.90.7": folder: all - "1.90.2-docking": + "1.90.7-docking": folder: all - "1.90.1": + "1.90.6": folder: all - "1.90.1-docking": + "1.90.6-docking": folder: all - "1.90": + "1.90.5": folder: all - "1.90-docking": + "1.90.5-docking": folder: all "1.89.9": folder: all "1.89.9-docking": folder: all - "1.89.8": - folder: all - "1.89.8-docking": - folder: all - "1.89.7": - folder: all - "1.89.7-docking": - folder: all - "1.89.5": - folder: all - "1.89.4": - folder: all - "1.89.3": - folder: all - "1.89.2": - folder: all - "1.89.1": - folder: all "1.88": folder: all "1.87": @@ -50,12 +32,3 @@ versions: "1.85": folder: all - # These versions belong to the docking branch in ImGUI repository. This branch is declared stable and production ready, and - # it is synced with `master` regularly. These versions are taken from that branch using the commit where `master` was synced - # after a regular release - "cci.20230105+1.89.2.docking": - folder: all - "cci.20220621+1.88.docking": - folder: all - "cci.20220207+1.87.docking": - folder: all diff --git a/recipes/imguizmo/all/conandata.yml b/recipes/imguizmo/all/conandata.yml index 11e9cb824cab9..ae95ecdea6a27 100644 --- a/recipes/imguizmo/all/conandata.yml +++ b/recipes/imguizmo/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20231114": + url: "https://github.com/CedricGuillemet/ImGuizmo/archive/ba662b119d64f9ab700bb2cd7b2781f9044f5565.zip" + sha256: "5a63baebb5bce96d83e5e3d6daa4598844ba8d5d0e3cb1ee385fcc54cf996115" "1.83": url: "https://github.com/CedricGuillemet/ImGuizmo/archive/refs/tags/1.83.tar.gz" sha256: "e6d05c5ebde802df7f6c342a06bc675bd2aa1c754d2d96755399a182187098a8" diff --git a/recipes/imguizmo/all/conanfile.py b/recipes/imguizmo/all/conanfile.py index 57281934555cf..64f8cb9f6dab2 100644 --- a/recipes/imguizmo/all/conanfile.py +++ b/recipes/imguizmo/all/conanfile.py @@ -2,7 +2,8 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get +from conan.tools.files import copy, get, replace_in_file +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -41,21 +42,26 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - # 1.89 is the newest imgui version compatible with imguizmo - self.requires("imgui/1.89.3", transitive_headers=True) + self.requires("imgui/1.90.5", transitive_headers=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) + tc.preprocessor_definitions["IMGUI_DEFINE_MATH_OPERATORS"] = "" tc.generate() tc = CMakeDeps(self) tc.generate() def build(self): + if self.version == "1.83" and Version(self.dependencies["imgui"].ref.version) >= "1.89.4": + # Related to a breaking change: https://github.com/ocornut/imgui/blob/master/docs/CHANGELOG.txt#L912 + # Redirection: ImDrawList::AddBezierCurve() -> use ImDrawList::AddBezierCubic() + replace_in_file(self, os.path.join(self.source_folder, "GraphEditor.cpp"), + "AddBezierCurve", "AddBezierCubic") cmake = CMake(self) - cmake.configure(build_script_folder=self.export_sources_folder) + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() def package(self): diff --git a/recipes/imguizmo/config.yml b/recipes/imguizmo/config.yml index cc1b28a70b3ee..a2886d669a4e7 100644 --- a/recipes/imguizmo/config.yml +++ b/recipes/imguizmo/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20231114": + folder: "all" "1.83": folder: "all" diff --git a/recipes/implot/all/CMakeLists.txt b/recipes/implot/all/CMakeLists.txt index 8f2c9651b41e6..317f2805b1b38 100644 --- a/recipes/implot/all/CMakeLists.txt +++ b/recipes/implot/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(implot LANGUAGES CXX) file(GLOB HEADER_FILES ${IMPLOT_SRC_DIR}/*.h) @@ -6,6 +6,9 @@ file(GLOB HEADER_FILES ${IMPLOT_SRC_DIR}/*.h) add_library(${PROJECT_NAME} ${IMPLOT_SRC_DIR}/implot.cpp ${IMPLOT_SRC_DIR}/implot_items.cpp + # implot_demo.cpp is included so that user can use it to display the main documentation of implot. + # Note that these functions are not declared by the public headers. + # https://github.com/conan-io/conan-center-index/pull/20374 ${IMPLOT_SRC_DIR}/implot_demo.cpp ) target_include_directories(${PROJECT_NAME} PRIVATE ${IMPLOT_SRC_DIR}) @@ -14,7 +17,6 @@ find_package(imgui CONFIG REQUIRED) target_link_libraries(${PROJECT_NAME} PUBLIC imgui::imgui) -target_compile_definitions(${PROJECT_NAME} PRIVATE IMGUI_DEFINE_MATH_OPERATORS) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) diff --git a/recipes/implot/all/conanfile.py b/recipes/implot/all/conanfile.py index 0f83131c24116..ce5a386b006bb 100644 --- a/recipes/implot/all/conanfile.py +++ b/recipes/implot/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 get, copy +from conan.tools.files import get, copy, replace_in_file from conan.tools.scm import Version from conan.tools.microsoft import is_msvc import os @@ -31,17 +31,15 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC # rm_safe not needed + del self.options.fPIC def configure(self): if self.options.shared: self.options.rm_safe("fPIC") def requirements(self): - if Version(self.version) >= "0.15": - self.requires("imgui/1.90", transitive_headers=True) - elif Version(self.version) >= "0.14": - self.requires("imgui/1.89.4", transitive_headers=True) + if Version(self.version) >= "0.14": + self.requires("imgui/1.90.5", transitive_headers=True) elif Version(self.version) >= "0.13": # imgui 1.89 renamed ImGuiKeyModFlags_* to ImGuiModFlags_* self.requires("imgui/1.88", transitive_headers=True) @@ -61,11 +59,22 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["IMPLOT_SRC_DIR"] = self.source_folder.replace("\\", "/") + if Version(self.version) < "0.16": + # Set in code since v0.16 https://github.com/epezent/implot/commit/33c5a965f55f80057f197257d1d1cdb06523e963 + tc.preprocessor_definitions["IMGUI_DEFINE_MATH_OPERATORS"] = "" tc.generate() deps = CMakeDeps(self) deps.generate() + def _patch_sources(self): + if Version(self.version) == "0.14" and Version(self.dependencies["imgui"].ref.version) >= "1.89.7": + # https://github.com/ocornut/imgui/commit/51f564eea6333bae9242f40c983a3e29d119a9c2 + replace_in_file(self, os.path.join(self.source_folder, "implot.cpp"), + "ImGuiButtonFlags_AllowItemOverlap", + "ImGuiButtonFlags_AllowOverlap") + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() diff --git a/recipes/iowow/all/conandata.yml b/recipes/iowow/all/conandata.yml index 3dc81fcb10588..047330d4f8fd9 100644 --- a/recipes/iowow/all/conandata.yml +++ b/recipes/iowow/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.18": + url: "https://github.com/Softmotions/iowow/archive/refs/tags/v1.4.18.tar.gz" + sha256: "ef4ee56dd77ce326fff25b6f41e7d78303322cca3f11cf5683ce9abfda34faf9" "1.4.17": url: "https://github.com/Softmotions/iowow/archive/refs/tags/v1.4.17.tar.gz" sha256: "13a851026dbc1f31583fba96986e86e94a7554f9e7d38aa12a9ea5dbebdf328b" @@ -6,6 +9,10 @@ sources: url: "https://github.com/Softmotions/iowow/archive/refs/tags/v1.4.16.tar.gz" sha256: "6e3b92b6c342ef6ef4a2731ca2d43368749d66ca876b24b773587364cff01003" patches: + "1.4.18": + - patch_file: "patches/1.4.18-0002-fix-uint64_t-format.patch" + patch_description: "fix uint64_t printf format" + patch_type: "portability" "1.4.17": - patch_file: "patches/1.4.16-0002-fix-uint64_t-format.patch" patch_description: "fix uint64_t printf format" diff --git a/recipes/iowow/all/patches/1.4.18-0002-fix-uint64_t-format.patch b/recipes/iowow/all/patches/1.4.18-0002-fix-uint64_t-format.patch new file mode 100644 index 0000000000000..3253bb3ff1bdd --- /dev/null +++ b/recipes/iowow/all/patches/1.4.18-0002-fix-uint64_t-format.patch @@ -0,0 +1,13 @@ +diff --git a/src/fs/iwfsmfile.c b/src/fs/iwfsmfile.c +index 2d1452a..121e989 100644 +--- a/src/fs/iwfsmfile.c ++++ b/src/fs/iwfsmfile.c +@@ -1339,7 +1339,7 @@ static iwrc _fsm_read_meta_lr(struct fsm *fsm) { + fsm->bmlen = llv; + if (llv & (64 - 1)) { + rc = IWFS_ERROR_INVALID_FILEMETA; +- iwlog_ecode_error(rc, "Free-space bitmap length is not 64bit aligned: %" PRIuMAX "", fsm->bmlen); ++ iwlog_ecode_error(rc, "Free-space bitmap length is not 64bit aligned: %" PRIx64 "", fsm->bmlen); + } + rp += sizeof(llv); + diff --git a/recipes/iowow/config.yml b/recipes/iowow/config.yml index 764e66b7855a6..c30ae14aca332 100644 --- a/recipes/iowow/config.yml +++ b/recipes/iowow/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.18": + folder: all "1.4.17": folder: all "1.4.16": diff --git a/recipes/ipaddress/all/conandata.yml b/recipes/ipaddress/all/conandata.yml new file mode 100644 index 0000000000000..a3ae373c62221 --- /dev/null +++ b/recipes/ipaddress/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1.0": + url: "https://github.com/VladimirShaleev/ipaddress/archive/v1.1.0.tar.gz" + sha256: "e5084d83ebd712210882eb6dac14ed1b9b71584dede523b35c6181e0a06375f1" + "1.0.1": + url: "https://github.com/VladimirShaleev/ipaddress/archive/v1.0.1.tar.gz" + sha256: "49c16294f06fe95ffc66cae828dc08d116efb4a1ede3dddd21dcc182a2eceb03" diff --git a/recipes/ipaddress/all/conanfile.py b/recipes/ipaddress/all/conanfile.py new file mode 100644 index 0000000000000..1bdda098db7d5 --- /dev/null +++ b/recipes/ipaddress/all/conanfile.py @@ -0,0 +1,89 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.52.0" + + +class IpAddressConan(ConanFile): + name = "ipaddress" + description = "A library for working and manipulating IPv4/IPv6 addresses and networks" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/VladimirShaleev/ipaddress" + topics = ("ipv4", "ipv6", "ipaddress", "ip", "network", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + options = { + "exceptions": [True, False], + "overload_std": [True, False], + "ipv6_scope": [True, False], + "ipv6_scope_max_length": ["ANY"], + } + default_options = { + "exceptions": True, + "overload_std": True, + "ipv6_scope": True, + "ipv6_scope_max_length": 16, + } + + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "13.0", + "clang": "6.0", + "gcc": "7.5", + "msvc": "192", + "Visual Studio": "16", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} doesn't support {self.settings.compiler} < {minimum_version}" + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.hpp", + os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include") + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if not self.options.exceptions: + self.cpp_info.defines.append("IPADDRESS_NO_EXCEPTIONS") + if not self.options.overload_std: + self.cpp_info.defines.append("IPADDRESS_NO_OVERLOAD_STD") + if not self.options.ipv6_scope: + self.cpp_info.defines.append("IPADDRESS_NO_IPV6_SCOPE") + else: + self.cpp_info.defines.append(f"IPADDRESS_IPV6_SCOPE_MAX_LENGTH={int(self.options.ipv6_scope_max_length)}") diff --git a/recipes/ipaddress/all/test_package/CMakeLists.txt b/recipes/ipaddress/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f9368cb4ca108 --- /dev/null +++ b/recipes/ipaddress/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ipaddress CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ipaddress::ipaddress) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/ipaddress/all/test_package/conanfile.py b/recipes/ipaddress/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/ipaddress/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ipaddress/all/test_package/test_package.cpp b/recipes/ipaddress/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1e0a4a4597eaf --- /dev/null +++ b/recipes/ipaddress/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include +#include "ipaddress/ipaddress.hpp" + + +int main(void) { + auto ip = ipaddress::ipv6_address::parse("fec0::1ff:fe23:4567:890a%eth2"); + std::cout << "Parsing ipv6: " << ip << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/ipaddress/config.yml b/recipes/ipaddress/config.yml new file mode 100644 index 0000000000000..20ec1c9e2bdee --- /dev/null +++ b/recipes/ipaddress/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.0": + folder: all + "1.0.1": + folder: all diff --git a/recipes/isa-l/all/conanfile.py b/recipes/isa-l/all/conanfile.py index 09af37c4cc900..de6e6376e8a4f 100644 --- a/recipes/isa-l/all/conanfile.py +++ b/recipes/isa-l/all/conanfile.py @@ -2,8 +2,9 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name from conan.tools.env import VirtualBuildEnv -from conan.tools.files import chdir, collect_libs, copy, get, replace_in_file +from conan.tools.files import chdir, copy, get, replace_in_file from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, NMakeToolchain @@ -29,6 +30,10 @@ class LibisalConan(ConanFile): "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 @@ -45,13 +50,17 @@ def layout(self): def validate(self): if self.settings.arch not in ["x86", "x86_64"]: raise ConanInvalidConfiguration(f"{self.settings.arch} architecture is not supported") - if self.version == "2.30.0" and self.settings.arch == "armv8": + if self.version == "2.30.0" and self._settings_build.arch == "armv8": raise ConanInvalidConfiguration(f"Version {self.version} does not support armv8") def build_requirements(self): self.tool_requires("nasm/2.15.05") - if self.settings.os != "Windows": + if not is_msvc(self): self.tool_requires("libtool/2.4.7") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -102,6 +111,12 @@ def package(self): dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) + fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.libs = collect_libs(self) + self.cpp_info.set_property("pkg_config_name", "libisal") + if is_msvc(self): + suffix = "" if self.options.shared else "_static" + self.cpp_info.libs = [f"isa-l{suffix}"] + else: + self.cpp_info.libs = ["isal"] diff --git a/recipes/isl/all/conanfile.py b/recipes/isl/all/conanfile.py index bd3795141c531..892a970bf8f60 100644 --- a/recipes/isl/all/conanfile.py +++ b/recipes/isl/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 is_msvc, msvc_runtime_flag, check_min_vs, unix_path, is_msvc_static_runtime +from conan.tools.scm import Version import os required_conan_version = ">=1.58.0" @@ -50,7 +51,7 @@ def configure(self): def validate(self): if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration("Cannot build shared isl library on Windows (due to libtool refusing to link to static/import libraries)") - if is_apple_os(self) and cross_building(self): + if Version(self.version) < "0.25" and is_apple_os(self) and cross_building(self): raise ConanInvalidConfiguration("Cross-building with Apple Clang is not supported yet") if msvc_runtime_flag(self) == "MDd" and not check_min_vs(self, 192, raise_invalid=False): # isl fails to link with this version of visual studio and MDd runtime: diff --git a/recipes/ixwebsocket/all/conandata.yml b/recipes/ixwebsocket/all/conandata.yml index f9b0b0853afce..7ab18405e8412 100644 --- a/recipes/ixwebsocket/all/conandata.yml +++ b/recipes/ixwebsocket/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "11.4.5": + url: "https://github.com/machinezone/IXWebSocket/archive/refs/tags/v11.4.5.tar.gz" + sha256: "c5fc225edec32bf7d583e55347ef2c9c4940d005c13ef5e848354a85602f5fd6" "11.4.3": url: "https://github.com/machinezone/IXWebSocket/archive/refs/tags/v11.4.3.tar.gz" sha256: "aa2d02c9c71339943cc61eb4efeb2ffc3a5a0011128a67027b9251b7d8a6e0ac" diff --git a/recipes/ixwebsocket/all/conanfile.py b/recipes/ixwebsocket/all/conanfile.py index 839ba03a95e16..1c2ba7acf0e06 100644 --- a/recipes/ixwebsocket/all/conanfile.py +++ b/recipes/ixwebsocket/all/conanfile.py @@ -135,6 +135,7 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "ixwebsocket") diff --git a/recipes/ixwebsocket/config.yml b/recipes/ixwebsocket/config.yml index c72c054440963..876784ab3f633 100644 --- a/recipes/ixwebsocket/config.yml +++ b/recipes/ixwebsocket/config.yml @@ -1,4 +1,6 @@ versions: + "11.4.5": + folder: all "11.4.3": folder: all "11.2.4": diff --git a/recipes/jasper/all/conandata.yml b/recipes/jasper/all/conandata.yml index 0996a2f915ff8..a0a3b5ff5c970 100644 --- a/recipes/jasper/all/conandata.yml +++ b/recipes/jasper/all/conandata.yml @@ -1,39 +1,26 @@ sources: + "4.2.4": + url: "https://github.com/jasper-software/jasper/releases/download/version-4.2.4/jasper-4.2.4.tar.gz" + sha256: "6a597613d8d84c500b5b83bf0eec06cd3707c23d19957f70354ac2394c9914e7" "4.2.0": url: "https://github.com/jasper-software/jasper/releases/download/version-4.2.0/jasper-4.2.0.tar.gz" sha256: "69f0b08a0cc281a06eaf7feed510736854bbff9af89ab1d01b77382ad57ec957" "4.1.2": url: "https://github.com/jasper-software/jasper/releases/download/version-4.1.2/jasper-4.1.2.tar.gz" sha256: "22392e439b87c79aaf8689ec79a286a7147e811c4bee34edf3d0b239798d672b" - "4.1.1": - url: "https://github.com/jasper-software/jasper/releases/download/version-4.1.1/jasper-4.1.1.tar.gz" - sha256: "03ba86823f8798f3f60a5a34e36f3eff9e9cbd76175643a33d4aac7c0390240a" - "4.1.0": - url: "https://github.com/jasper-software/jasper/releases/download/version-4.1.0/jasper-4.1.0.tar.gz" - sha256: "ffe1543d87f7ffc5039d2415afd48c314a7cc0b0c750b4982cd881d6ed4b5743" "4.0.0": url: "https://github.com/jasper-software/jasper/releases/download/version-4.0.0/jasper-4.0.0.tar.gz" sha256: "39514e1b53a5333fcff817e19565371f016ea536c36fd2d13a9c4d8da8f0be0c" - "3.0.6": - url: "https://github.com/jasper-software/jasper/releases/download/version-3.0.6/jasper-3.0.6.tar.gz" - sha256: "169be004d91f6940c649a4f854ada2755d4f35f62b0555ce9e1219c778cffc09" - "2.0.33": - url: "https://github.com/jasper-software/jasper/releases/download/version-2.0.33/jasper-2.0.33.tar.gz" - sha256: "28d28290cc2eaf70c8756d391ed8bcc8ab809a895b9a67ea6e89da23a611801a" patches: - "4.2.0": + "4.2.4": - patch_file: "patches/4.2.0-0003-deterministic-libname.patch" patch_description: "No generator dependent libname" patch_type: "conan" - "4.1.2": - - patch_file: "patches/4.1.1-0001-skip-rpath.patch" - patch_description: "Do not enforce rpath configuration" - patch_source: "https://github.com/jasper-software/jasper/pull/347" - patch_type: "conan" - - patch_file: "patches/4.1.1-0003-deterministic-libname.patch" + "4.2.0": + - patch_file: "patches/4.2.0-0003-deterministic-libname.patch" patch_description: "No generator dependent libname" patch_type: "conan" - "4.1.1": + "4.1.2": - patch_file: "patches/4.1.1-0001-skip-rpath.patch" patch_description: "Do not enforce rpath configuration" patch_source: "https://github.com/jasper-software/jasper/pull/347" @@ -41,14 +28,6 @@ patches: - patch_file: "patches/4.1.1-0003-deterministic-libname.patch" patch_description: "No generator dependent libname" patch_type: "conan" - "4.1.0": - - patch_file: "patches/4.1.0-0001-skip-rpath.patch" - patch_description: "Do not enforce rpath configuration" - patch_source: "https://github.com/jasper-software/jasper/pull/347" - patch_type: "conan" - - patch_file: "patches/4.1.0-0003-deterministic-libname.patch" - patch_description: "No generator dependent libname" - patch_type: "conan" "4.0.0": - patch_file: "patches/4.0.0-0001-skip-rpath.patch" patch_description: "Do not enforce rpath configuration" @@ -57,16 +36,3 @@ patches: - patch_file: "patches/4.0.0-0003-deterministic-libname.patch" patch_description: "No generator dependent libname" patch_type: "conan" - "3.0.6": - - patch_file: "patches/3.0.6-0001-skip-rpath.patch" - patch_description: "Do not enforce rpath configuration" - patch_source: "https://github.com/jasper-software/jasper/pull/347" - patch_type: "conan" - - patch_file: "patches/3.0.6-0003-deterministic-libname.patch" - patch_description: "No generator dependent libname" - patch_type: "conan" - "2.0.33": - - patch_file: "patches/2.0.33-0001-skip-rpath.patch" - patch_description: "Do not enforce rpath configuration" - patch_source: "https://github.com/jasper-software/jasper/pull/347" - patch_type: "conan" diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 29bbcb6c115d7..25cff6caab8e5 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -65,8 +65,7 @@ def generate(self): VirtualBuildEnv(self).generate() tc = CMakeToolchain(self) - if Version(self.version) >= "4.0.0": - tc.variables["JAS_ENABLE_PIC"] = self.options.get_safe("fPIC", True) + tc.variables["JAS_ENABLE_PIC"] = self.options.get_safe("fPIC", True) tc.variables["JAS_ENABLE_DOC"] = False tc.variables["JAS_ENABLE_LATEX"] = False tc.variables["JAS_ENABLE_PROGRAMS"] = False @@ -74,8 +73,7 @@ def generate(self): tc.variables["JAS_LIBJPEG_REQUIRED"] = "REQUIRED" tc.variables["JAS_ENABLE_LIBJPEG"] = bool(self.options.with_libjpeg) tc.variables["JAS_HAVE_JPEGLIB_H"] = True - if Version(self.version) >= "3.0.0": - tc.variables["JAS_ENABLE_LIBHEIF"] = False + tc.variables["JAS_ENABLE_LIBHEIF"] = False tc.variables["JAS_ENABLE_OPENGL"] = False if cross_building(self): tc.cache_variables["JAS_CROSSCOMPILING"] = True diff --git a/recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch b/recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch deleted file mode 100644 index eb9d47cbbb014..0000000000000 --- a/recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 230d88c..79081c2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -298,19 +298,15 @@ if (JAS_ENABLE_SHARED) - # (but later on when installing) - set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - -- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") - - # add the automatically determined parts of the RPATH - # which point to directories outside the build tree to the install RPATH -- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - - # The RPATH to be used when installing, but only if it's not a - # system directory - list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES - "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) - if("${isSystemDir}" STREQUAL "-1") -- set(CMAKE_INSTALL_RPATH -- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") - endif("${isSystemDir}" STREQUAL "-1") - - endif() diff --git a/recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch b/recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch deleted file mode 100644 index 959d169bd49ad..0000000000000 --- a/recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5cf594c..a0d253d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -740,19 +740,15 @@ if(JAS_ENABLE_SHARED) - # (but later on when installing) - set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - -- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") - - # add the automatically determined parts of the RPATH - # which point to directories outside the build tree to the install RPATH -- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - - # The RPATH to be used when installing, but only if it's not a - # system directory - list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES - "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) - if(isSystemDir EQUAL -1) -- set(CMAKE_INSTALL_RPATH -- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") - endif() - endif() - diff --git a/recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch b/recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch deleted file mode 100644 index 567ff16e021a4..0000000000000 --- a/recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -254,7 +254,7 @@ endif() - # If a multiconfiguration generator is used, ensure that various output - # files are not placed in subdirectories (such as Debug and Release) - # as this will cause the CTest test suite to fail. --if(JAS_MULTICONFIGURATION_GENERATOR) -+if(0) - if(CMAKE_CONFIGURATION_TYPES) - set(CMAKE_DEBUG_POSTFIX d) - endif() diff --git a/recipes/jasper/all/patches/4.1.0-0001-skip-rpath.patch b/recipes/jasper/all/patches/4.1.0-0001-skip-rpath.patch deleted file mode 100644 index 9ebb0ac66b98c..0000000000000 --- a/recipes/jasper/all/patches/4.1.0-0001-skip-rpath.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ba6f117..6b79a94 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -804,19 +804,19 @@ if(JAS_ENABLE_SHARED) - # (but later on when installing) - set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - -- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") -+# set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") - - # add the automatically determined parts of the RPATH - # which point to directories outside the build tree to the install RPATH -- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) -+# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - - # The RPATH to be used when installing, but only if it's not a - # system directory - list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES - "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) - if(isSystemDir EQUAL -1) -- set(CMAKE_INSTALL_RPATH -- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") -+# set(CMAKE_INSTALL_RPATH -+# "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") - endif() - endif() - diff --git a/recipes/jasper/all/patches/4.1.0-0003-deterministic-libname.patch b/recipes/jasper/all/patches/4.1.0-0003-deterministic-libname.patch deleted file mode 100644 index 0603e4f665033..0000000000000 --- a/recipes/jasper/all/patches/4.1.0-0003-deterministic-libname.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 86eb065..9c2da51 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -274,7 +274,7 @@ endif() - # If a multiconfiguration generator is used, ensure that various output - # files are not placed in subdirectories (such as Debug and Release) - # as this will cause the CTest test suite to fail. --if(JAS_MULTICONFIGURATION_GENERATOR) -+if(0) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY .) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY .) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY .) diff --git a/recipes/jasper/config.yml b/recipes/jasper/config.yml index 2539649ff499b..7d70ab2a393a0 100644 --- a/recipes/jasper/config.yml +++ b/recipes/jasper/config.yml @@ -1,15 +1,9 @@ versions: + "4.2.4": + folder: all "4.2.0": folder: all "4.1.2": folder: all - "4.1.1": - folder: all - "4.1.0": - folder: all "4.0.0": folder: all - "3.0.6": - folder: all - "2.0.33": - folder: all diff --git a/recipes/jnk0le_ringbuffer/all/conandata.yml b/recipes/jnk0le_ringbuffer/all/conandata.yml new file mode 100644 index 0000000000000..e3e3019c5ae04 --- /dev/null +++ b/recipes/jnk0le_ringbuffer/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20240422": + url: "https://github.com/jnk0le/Ring-Buffer/archive/160190e0c985e0181e728a0b9f321f25ac549f20.tar.gz" + sha256: "9984f0f9c9bc453c3e835a9954e0b1914472e3657086accd5d1345a7c7c28e88" diff --git a/recipes/jnk0le_ringbuffer/all/conanfile.py b/recipes/jnk0le_ringbuffer/all/conanfile.py new file mode 100644 index 0000000000000..473c00193624d --- /dev/null +++ b/recipes/jnk0le_ringbuffer/all/conanfile.py @@ -0,0 +1,48 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + +class RingBufferConan(ConanFile): + name = "jnk0le_ringbuffer" + description = "simple C++11 ring buffer implementation, allocated and evaluated at compile time" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jnk0le/Ring-Buffer" + topics = ("ring buffer", "compile time", "data-structures", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/jnk0le_ringbuffer/all/test_package/CMakeLists.txt b/recipes/jnk0le_ringbuffer/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..75a4d646f54c0 --- /dev/null +++ b/recipes/jnk0le_ringbuffer/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(jnk0le_ringbuffer CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jnk0le_ringbuffer::jnk0le_ringbuffer) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jnk0le_ringbuffer/all/test_package/conanfile.py b/recipes/jnk0le_ringbuffer/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/jnk0le_ringbuffer/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/jnk0le_ringbuffer/all/test_package/test_package.cpp b/recipes/jnk0le_ringbuffer/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..63ad1c8b9609b --- /dev/null +++ b/recipes/jnk0le_ringbuffer/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +int main() { + // older gcc(4.9, 5.3) has a bug for alignas(0) + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69089 + jnk0le::Ringbuffer message; + + message.insert("Hello world"); + + const char* tmp = nullptr; + message.remove(tmp); + + return 0; +} diff --git a/recipes/jnk0le_ringbuffer/config.yml b/recipes/jnk0le_ringbuffer/config.yml new file mode 100644 index 0000000000000..2dbea38f25622 --- /dev/null +++ b/recipes/jnk0le_ringbuffer/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20240422": + folder: all diff --git a/recipes/jom/all/conandata.yml b/recipes/jom/all/conandata.yml index 0fe464cf0c395..0b87aa433e46a 100644 --- a/recipes/jom/all/conandata.yml +++ b/recipes/jom/all/conandata.yml @@ -1,4 +1,15 @@ sources: + "1.1.4": + x86_64: + url: "http://download.qt.io/official_releases/jom/jom_1_1_4.zip" + sha256: "d533c1ef49214229681e90196ed2094691e8c4a0a0bef0b2c901debcb562682b" + license: + url: "https://code.qt.io/cgit/qt-labs/jom.git/plain/LICENSE.GPL?h=v1.1.3" + sha256: "d3d9052b838761dbe00067168ed9ebc437734d53ebf71dea1c8e9f7532a5333b" "1.1.3": - sha256: "128fdd846fe24f8594eed37d1d8929a0ea78df563537c0c1b1861a635013fff8" - url: "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" + x86_64: + url: "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" + sha256: "128fdd846fe24f8594eed37d1d8929a0ea78df563537c0c1b1861a635013fff8" + license: + url: "https://code.qt.io/cgit/qt-labs/jom.git/plain/LICENSE.GPL?h=v1.1.3" + sha256: "d3d9052b838761dbe00067168ed9ebc437734d53ebf71dea1c8e9f7532a5333b" diff --git a/recipes/jom/all/conanfile.py b/recipes/jom/all/conanfile.py index 4962bc3e3e42f..6605c75c3ffa3 100644 --- a/recipes/jom/all/conanfile.py +++ b/recipes/jom/all/conanfile.py @@ -30,8 +30,8 @@ def source(self): pass def build(self): - get(self, **self.conan_data["sources"][self.version]) - download(self, f"https://code.qt.io/cgit/qt-labs/jom.git/plain/LICENSE.GPL?h=v{self.version}", filename="LICENSE.GPL") + get(self, **self.conan_data["sources"][self.version]["x86_64"]) + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE.GPL") def package(self): copy(self, "LICENSE.GPL", self.build_folder, os.path.join(self.package_folder, "licenses")) diff --git a/recipes/jom/config.yml b/recipes/jom/config.yml index e1c4f3be24983..7f3d713ab8481 100644 --- a/recipes/jom/config.yml +++ b/recipes/jom/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.4": + folder: all "1.1.3": folder: all diff --git a/recipes/jpeg-compressor/all/test_package/conanfile.py b/recipes/jpeg-compressor/all/test_package/conanfile.py index ea70607af0172..0a6bc68712d90 100644 --- a/recipes/jpeg-compressor/all/test_package/conanfile.py +++ b/recipes/jpeg-compressor/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_path = os.path.join(self.source_folder, "testimg.jpg") - self.run(f"{bin_path} {img_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/jpeg-compressor/all/test_package/test_package.cpp b/recipes/jpeg-compressor/all/test_package/test_package.cpp index ef3f49c1a1fba..956e76e45a8b0 100644 --- a/recipes/jpeg-compressor/all/test_package/test_package.cpp +++ b/recipes/jpeg-compressor/all/test_package/test_package.cpp @@ -5,29 +5,21 @@ int main(int argc, const char* argv[]) { - if (argc < 2) { - std::cerr << "Need at least one argument" << std::endl; - return 1; - } - - const char* pSrc_filename = argv[1]; + const char* pSrc_filename = "non-real-file.jpg"; const int req_comps = 4; int width = 0, height = 0, actual_comps = 0; uint8_t* pImage_data = jpgd::decompress_jpeg_image_from_file(pSrc_filename, &width, &height, &actual_comps, req_comps); if (!pImage_data) { - std::cerr << "Failed loading file " << pSrc_filename << std::endl; - return EXIT_FAILURE; + std::cerr << "Test jpgd function" << std::endl;// Always displayed } int buf_size = width * height * 3; - if (buf_size < 1024) buf_size = 1024; void* pBuf = malloc(buf_size); if (!jpge::compress_image_to_jpeg_file_in_memory(pBuf, buf_size, width, height, req_comps, pImage_data)) { - std::cerr << "Failed creating JPEG data" << std::endl; - return EXIT_FAILURE; + std::cerr << "Test jpge function" << std::endl;// Always displayed } free(pBuf); diff --git a/recipes/jpeg-compressor/all/test_package/testimg.jpg b/recipes/jpeg-compressor/all/test_package/testimg.jpg deleted file mode 100644 index a026e486f57de..0000000000000 Binary files a/recipes/jpeg-compressor/all/test_package/testimg.jpg and /dev/null differ diff --git a/recipes/jpeg-compressor/all/test_v1_package/conanfile.py b/recipes/jpeg-compressor/all/test_v1_package/conanfile.py index ff285a92f9ca9..38f4483872d47 100644 --- a/recipes/jpeg-compressor/all/test_v1_package/conanfile.py +++ b/recipes/jpeg-compressor/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - img_path = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_path}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/jsbsim/all/conanfile.py b/recipes/jsbsim/all/conanfile.py index 3d180281b5649..048e4a19a18e0 100644 --- a/recipes/jsbsim/all/conanfile.py +++ b/recipes/jsbsim/all/conanfile.py @@ -48,7 +48,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/jsoncons/all/conandata.yml b/recipes/jsoncons/all/conandata.yml index 7d2ea6ccc163d..aca299f96976a 100644 --- a/recipes/jsoncons/all/conandata.yml +++ b/recipes/jsoncons/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.176.0": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.176.0.tar.gz" + sha256: "2eb50b5cbe204265fef96c052511ed6e3b8808935c6e2c8d28e0aba7b08fda33" + "0.175.0": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.175.0.tar.gz" + sha256: "7f8a04cfd25a73d2ba2283be8eb98a39780df1e90600d8c75ddf19d52bd2c2c9" + "0.174.0": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.174.0.tar.gz" + sha256: "60507721a26c752c71fbb228568f7944ea3fd287e9b179a9128ca32d7ddbb386" "0.173.4": url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.173.4.tar.gz" sha256: "3e3525325c88b33f15af2e1f3cf7a1893a49e47aa787a2df723a098b3a4b20b1" diff --git a/recipes/jsoncons/config.yml b/recipes/jsoncons/config.yml index 89bdd7665089f..6025c4b0dd2aa 100644 --- a/recipes/jsoncons/config.yml +++ b/recipes/jsoncons/config.yml @@ -1,4 +1,10 @@ versions: + "0.176.0": + folder: "all" + "0.175.0": + folder: "all" + "0.174.0": + folder: "all" "0.173.4": folder: "all" "0.173.3": diff --git a/recipes/jsonifier/all/conandata.yml b/recipes/jsonifier/all/conandata.yml new file mode 100644 index 0000000000000..b2b7a5da8d77b --- /dev/null +++ b/recipes/jsonifier/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.9.96": + url: "https://github.com/RealTimeChris/Jsonifier/archive/refs/tags/v0.9.96.tar.gz" + sha256: "9f2658282f53680be0121091adacc8f82b2de5b95c31bc6eadb98802c0aa59f0" + "0.9.95": + url: "https://github.com/RealTimeChris/Jsonifier/archive/refs/tags/v0.9.95.tar.gz" + sha256: "4db5fd2c4ae77bbd13e4f80fcc255edb39835cb5cf00d33468cb957af04d933b" diff --git a/recipes/jsonifier/all/conanfile.py b/recipes/jsonifier/all/conanfile.py new file mode 100644 index 0000000000000..5dcf12ea3c5b0 --- /dev/null +++ b/recipes/jsonifier/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, rmdir +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 JsonifierConan(ConanFile): + name = "jsonifier" + description = "A few classes for parsing and serializing objects from/into JSON - very rapidly." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/RealTimeChris/Jsonifier" + topics = ("serialization", "json", "simd", "parswer", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "12", + "clang": "17", + "apple-clang": "14", + "Visual Studio": "17", + "msvc": "193", + } + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 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.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, "share")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/jsonifier/all/test_package/CMakeLists.txt b/recipes/jsonifier/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..386a7df4b60c0 --- /dev/null +++ b/recipes/jsonifier/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) +find_package(jsonifier REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jsonifier::jsonifier) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/jsonifier/all/test_package/conanfile.py b/recipes/jsonifier/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/jsonifier/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/jsonifier/all/test_package/test_package.cpp b/recipes/jsonifier/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..21035cf3ed4c1 --- /dev/null +++ b/recipes/jsonifier/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include +#include + +#include "jsonifier/Index.hpp" + +struct MyObject { + std::string name; + int age; +}; + +template<> struct jsonifier::core { + using value_type = MyObject; + static constexpr auto parseValue = createValue("name", &value_type::name, "age", &value_type::age); +}; + +int main() { + MyObject obj("John", 30); + jsonifier::jsonifier_core jsonifier{}; + std::string jsonBuffer{}; + jsonifier.serializeJson(obj, jsonBuffer); + + std::cout << jsonBuffer << std::endl; + + return 0; +} diff --git a/recipes/jsonifier/config.yml b/recipes/jsonifier/config.yml new file mode 100644 index 0000000000000..4072492ec419c --- /dev/null +++ b/recipes/jsonifier/config.yml @@ -0,0 +1,5 @@ +versions: + "0.9.96": + folder: all + "0.9.95": + folder: all diff --git a/recipes/jxrlib/all/test_package/conanfile.py b/recipes/jxrlib/all/test_package/conanfile.py index b8d2e695e4b3a..0a6bc68712d90 100644 --- a/recipes/jxrlib/all/test_package/conanfile.py +++ b/recipes/jxrlib/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_path = os.path.join(self.source_folder, "test.jxr") - self.run(f"{bin_path} {img_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/jxrlib/all/test_package/test.jxr b/recipes/jxrlib/all/test_package/test.jxr deleted file mode 100644 index 4f66a2e27671a..0000000000000 Binary files a/recipes/jxrlib/all/test_package/test.jxr and /dev/null differ diff --git a/recipes/jxrlib/all/test_package/test_package.c b/recipes/jxrlib/all/test_package/test_package.c index 122b6c2fd1cc3..03492cea6383f 100644 --- a/recipes/jxrlib/all/test_package/test_package.c +++ b/recipes/jxrlib/all/test_package/test_package.c @@ -4,28 +4,14 @@ int main(int argc, char* argv[]) { - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return 1; - } - - const char *jxr_path = argv[1]; - - { - ERR err = WMP_errSuccess; - - PKCodecFactory* pCodecFactory = NULL; - PKImageDecode* pDecoder = NULL; - - Call(PKCreateCodecFactory(&pCodecFactory, WMP_SDK_VERSION)); - Call(pCodecFactory->CreateDecoderFromFile(jxr_path, &pDecoder)); + ERR err = WMP_errSuccess; + PKCodecFactory* pCodecFactory = NULL; - PKPixelFormatGUID pix_frmt; - Call(pDecoder->GetPixelFormat(pDecoder, &pix_frmt)); + Call(PKCreateCodecFactory(&pCodecFactory, WMP_SDK_VERSION)); Cleanup: - if(pDecoder) pDecoder->Release(&pDecoder); - if(pCodecFactory) pCodecFactory->Release(&pCodecFactory); + if(pCodecFactory) { + pCodecFactory->Release(&pCodecFactory); } return 0; diff --git a/recipes/jxrlib/all/test_v1_package/conanfile.py b/recipes/jxrlib/all/test_v1_package/conanfile.py index ffd0b1c74921b..38f4483872d47 100644 --- a/recipes/jxrlib/all/test_v1_package/conanfile.py +++ b/recipes/jxrlib/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - img_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.jxr") - self.run(f"{bin_path} {img_path}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/kcov/all/CMakeLists.txt b/recipes/kcov/all/CMakeLists.txt deleted file mode 100644 index a69305eb3971f..0000000000000 --- a/recipes/kcov/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/kcov/all/conan_deps.cmake b/recipes/kcov/all/conan_deps.cmake new file mode 100644 index 0000000000000..47c0823a35eb3 --- /dev/null +++ b/recipes/kcov/all/conan_deps.cmake @@ -0,0 +1,34 @@ +# Wrapper for find_package() that also adds upper-case variables and allows only Conan packages +macro(custom_find_package name) + find_package(${name} ${ARGN} CONFIG + # Allow only Conan packages + NO_DEFAULT_PATH + PATHS ${CMAKE_PREFIX_PATH} + ) + string(TOUPPER ${name} name_upper) + set(${name_upper}_FOUND TRUE) + set(${name_upper}_VERSION_STRING ${${name}_VERSION_STRING}) + set(${name_upper}_INCLUDE_DIRS ${${name}_INCLUDE_DIRS}) + set(${name_upper}_INCLUDE_DIR ${${name}_INCLUDE_DIR}) + set(${name_upper}_LIBRARIES ${${name}_LIBRARIES}) + set(${name_upper}_DEFINITIONS ${${name}_DEFINITIONS}) + unset(name_upper) +endmacro() + +custom_find_package(Bfd) +custom_find_package(ZLIB REQUIRED) +custom_find_package(CURL REQUIRED) + +if(APPLE) + custom_find_package(Dwarfutils REQUIRED) + set(dwarfutils_FOUND TRUE) +else() + custom_find_package(ElfUtils REQUIRED) + set(Elfutils_FOUND TRUE) + # ElfUtils also provides LibElf + set(LibElf_FOUND TRUE) + set(LIBELF_FOUND TRUE) + set(LIBELF_INCLUDE_DIRS ${ElfUtils_INCLUDE_DIRS}) + set(LIBELF_LIBRARIES ${ElfUtils_LIBRARIES}) + set(LIBELF_DEFINITIONS ${ElfUtils_DEFINITIONS}) +endif() diff --git a/recipes/kcov/all/conandata.yml b/recipes/kcov/all/conandata.yml index b98fb5f6098f5..972457056a28e 100644 --- a/recipes/kcov/all/conandata.yml +++ b/recipes/kcov/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "42": + url: "https://github.com/SimonKagstrom/kcov/archive/refs/tags/v42.tar.gz" + sha256: "2c47d75397af248bc387f60cdd79180763e1f88f3dd71c94bb52478f8e74a1f8" "40": url: "https://github.com/SimonKagstrom/kcov/archive/refs/tags/v40.tar.gz" sha256: "6b1c11b066d57426d61375a31c3816f1fcd2610b447050c86d9920e22d5200b3" @@ -6,9 +9,14 @@ sources: url: "https://github.com/SimonKagstrom/kcov/archive/38.tar.gz" sha256: "b37af60d81a9b1e3b140f9473bdcb7975af12040feb24cc666f9bb2bb0be68b4" patches: - "40": [] + "42": + - patch_file: "patches/0003-fix-missing-include.patch" + patch_description: "Add a missing includes on macOS" + patch_type: "backport" + patch_source: "https://github.com/SimonKagstrom/kcov/commit/4efe5e4a4ac4e7b6d99fc869d826aa74ff716ebf" + - patch_file: "patches/0004-fix-libdwarf-prefix.patch" + patch_description: "Adjust libdwarf include to match CCI includedirs" + patch_type: "conan" "38": - patch_file: "patches/0001-fix-SOLIB-path.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-fix-missing-libssl-dependency.patch" - base_path: "source_subfolder" diff --git a/recipes/kcov/all/conanfile.py b/recipes/kcov/all/conanfile.py index 563b33b2f010e..ccb250afff541 100644 --- a/recipes/kcov/all/conanfile.py +++ b/recipes/kcov/all/conanfile.py @@ -1,63 +1,98 @@ import os + from conan import ConanFile -from conans import CMake, tools -from conans.errors import ConanInvalidConfiguration +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, rmdir, rm +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + class KcovConan(ConanFile): name = "kcov" + description = ( + "Code coverage tool for compiled programs, Python and Bash which uses " + "debugging information to collect and report data without special compilation options" + ) license = "GPL-2.0" - url = "https://github.com/conan-io/conan-center-index/" + url = "https://github.com/conan-io/conan-center-index" homepage = "http://simonkagstrom.github.io/kcov/index.html" - description = "Code coverage tool for compiled programs, Python and Bash\ - which uses debugging information to collect and report data without\ - special compilation options" topics = ("coverage", "linux", "debug") - settings = "os", "compiler", "build_type", "arch" - exports_sources = "CMakeLists.txt", "patches/**" - requires = ["zlib/1.2.12", - "libiberty/9.1.0", - "libcurl/7.83.1", - "elfutils/0.180"] - generators = "cmake" - _cmake = None - _source_subfolder = "source_subfolder" - _build_subfolder = "build_subfolder" - - def configure(self): + + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/[>=1.2.11 <2]") + self.requires("libcurl/[>=7.78 <9]") + self.requires("openssl/[>=1.1 <4]") + if is_apple_os(self): + self.requires("libdwarf/0.8.0") + else: + self.requires("elfutils/0.190") + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type + + def validate(self): if self.settings.os == "Windows": - raise ConanInvalidConfiguration( - "kcov can not be built on windows.") + raise ConanInvalidConfiguration("kcov can not be built on windows.") + if is_apple_os(self): + if Version(self.version) < 42: + # MachO support was added in v42 + raise ConanInvalidConfiguration(f"{self.ref} does not support {self.settings.os}.") + if self.settings.arch == "armv8": + # https://github.com/SimonKagstrom/kcov/blob/v42/cmake/TargetArch.cmake + raise ConanInvalidConfiguration(f"{self.ref} does not support {self.settings.arch}.") 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 _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_PROJECT_kcov_INCLUDE"] = "conan_deps.cmake" + tc.generate() + deps = CMakeDeps(self) + # Match Find*.cmake module names used by the project + deps.set_property("libbfd", "cmake_file_name", "Bfd") + deps.set_property("libdwarf", "cmake_file_name", "Dwarfutils") + deps.set_property("elfutils", "cmake_file_name", "ElfUtils") + deps.set_property("libcrpcut", "cmake_file_name", "LibCRPCUT") + deps.generate() - def _configure_cmake(self): - if self._cmake is not None: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def _patch_sources(self): + apply_conandata_patches(self) + # Disable project Find*.cmake modules just in case + rm(self, "Find*.cmake", os.path.join(self.source_folder, "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, "COPYING*", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "share")) - self.copy("COPYING*", dst="licenses", src=self._source_subfolder) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + # TODO: to remove in conan v2 bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}" - .format(bindir)) self.env_info.PATH.append(bindir) - self.cpp_info.includedirs = [] diff --git a/recipes/kcov/all/patches/0003-fix-missing-include.patch b/recipes/kcov/all/patches/0003-fix-missing-include.patch new file mode 100644 index 0000000000000..49167148ac3b4 --- /dev/null +++ b/recipes/kcov/all/patches/0003-fix-missing-include.patch @@ -0,0 +1,20 @@ +Use updated includes from master to fix a missing and +https://github.com/SimonKagstrom/kcov/blob/1d036f7799f95fed025c5fa0665c19df38632ab4/src/engines/mach-engine.cc + +--- src/engines/mach-engine.cc ++++ src/engines/mach-engine.cc +@@ -26,7 +26,14 @@ + #include + #include + #include ++#include ++// clang-format off ++// sys/ptrace.h needs sys/types.h, so make sure clang-format doesn't change the order ++#include + #include ++// clang-format on ++#include ++#include + #include + #include + #include diff --git a/recipes/kcov/all/patches/0004-fix-libdwarf-prefix.patch b/recipes/kcov/all/patches/0004-fix-libdwarf-prefix.patch new file mode 100644 index 0000000000000..3c5509fce924d --- /dev/null +++ b/recipes/kcov/all/patches/0004-fix-libdwarf-prefix.patch @@ -0,0 +1,18 @@ +FIXME: update libdwarf instead + +--- src/parsers/macho-parser.cc ++++ src/parsers/macho-parser.cc +@@ -6,11 +6,11 @@ + */ + #include + #include +-#include ++#include + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/recipes/kcov/all/test_package/conanfile.py b/recipes/kcov/all/test_package/conanfile.py index ea5ad0c50ed3e..9808e9680a682 100644 --- a/recipes/kcov/all/test_package/conanfile.py +++ b/recipes/kcov/all/test_package/conanfile.py @@ -1,9 +1,19 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.cmake import cmake_layout +from conan.tools.build import can_run -class KcovTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def test(self): - if not tools.cross_building(self.settings): - self.run("kcov --version", run_environment=True) + if can_run(self): + self.run("kcov --version", env="conanrun") diff --git a/recipes/kcov/all/test_v1_package/conanfile.py b/recipes/kcov/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ea5ad0c50ed3e --- /dev/null +++ b/recipes/kcov/all/test_v1_package/conanfile.py @@ -0,0 +1,9 @@ +from conans import ConanFile, tools + + +class KcovTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + def test(self): + if not tools.cross_building(self.settings): + self.run("kcov --version", run_environment=True) diff --git a/recipes/kcov/config.yml b/recipes/kcov/config.yml index b36ca0e497b00..97b2691d28e3b 100644 --- a/recipes/kcov/config.yml +++ b/recipes/kcov/config.yml @@ -1,4 +1,6 @@ versions: + "42": + folder: all "40": folder: all "38": diff --git a/recipes/kdbindings/all/conandata.yml b/recipes/kdbindings/all/conandata.yml index fa9ce176c1b03..37cdf4e77533d 100644 --- a/recipes/kdbindings/all/conandata.yml +++ b/recipes/kdbindings/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.5": + url: "https://github.com/KDAB/KDBindings/archive/refs/tags/v1.0.5.tar.gz" + sha256: "4d001419809a719f8c966e9bc73f457180325655deca0a11c07c47ee112447a3" "1.0.3": url: "https://github.com/KDAB/KDBindings/archive/refs/tags/v1.0.3.tar.gz" sha256: "da8de679d12bf123df6a3c63a482a862d4122a2f3d3567c9b3b2fc2c4f574393" diff --git a/recipes/kdbindings/all/conanfile.py b/recipes/kdbindings/all/conanfile.py index 9f1cf776a90f2..6f71f9d6240bb 100644 --- a/recipes/kdbindings/all/conanfile.py +++ b/recipes/kdbindings/all/conanfile.py @@ -13,7 +13,7 @@ class KDBindingsConan(ConanFile): homepage = "https://github.com/KDAB/KDBindings" url = "https://github.com/conan-io/conan-center-index" package_type = "header-library" - settings = "os", "arch", "compiler", "build_type" + settings = "compiler" no_copy_source = True def package_id(self): @@ -26,9 +26,10 @@ def source(self): def _compilers_minimum_version(self): return { "gcc": "9", - "Visual Studio": "15.7", "clang": "7", "apple-clang": "11", + "Visual Studio": "15.7", + "msvc": "191", } def validate(self): diff --git a/recipes/kdbindings/config.yml b/recipes/kdbindings/config.yml index 372dd1cb646bd..36ff9efdcab85 100644 --- a/recipes/kdbindings/config.yml +++ b/recipes/kdbindings/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.5": + folder: all "1.0.3": folder: all diff --git a/recipes/kealib/all/CMakeLists.txt b/recipes/kealib/all/CMakeLists.txt deleted file mode 100644 index fd2f93f3b4298..0000000000000 --- a/recipes/kealib/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/kealib/all/conandata.yml b/recipes/kealib/all/conandata.yml index f812df3cfab60..d999ff7ca194b 100644 --- a/recipes/kealib/all/conandata.yml +++ b/recipes/kealib/all/conandata.yml @@ -1,14 +1,10 @@ sources: + "1.5.2": + url: "https://github.com/ubarsc/kealib/archive/refs/tags/kealib-1.5.2.tar.gz" + sha256: "f16a51007ab7612aa598de6ee2cac0aa4421040894777c8e57cb4a50ea552ab1" + "1.4.15": + url: "https://github.com/ubarsc/kealib/archive/kealib-1.4.15.tar.gz" + sha256: "fc7bd049663985e9528acd894724f0c730c84a3408d5bff3c0c0f01d7c6cd172" "1.4.14": url: "https://github.com/ubarsc/kealib/archive/kealib-1.4.14.tar.gz" sha256: "b3f73104acebe5304ecce5c19c1560def66fd5c448ce251e9486494baeb141bc" - "1.4.13": - url: "https://github.com/ubarsc/kealib/archive/kealib-1.4.13.tar.gz" - sha256: "2a254eb557a4ec20638a5134ed549a16b7f64977f37de3cf3853a206c8d82199" -patches: - "1.4.14": - - patch_file: "patches/fix-cmake-1.4.14.patch" - base_path: "source_subfolder" - "1.4.13": - - patch_file: "patches/fix-export-symbols-and-cmake.patch" - base_path: "source_subfolder" diff --git a/recipes/kealib/all/conanfile.py b/recipes/kealib/all/conanfile.py index 292c817544c7d..fb6eebf5cc31b 100644 --- a/recipes/kealib/all/conanfile.py +++ b/recipes/kealib/all/conanfile.py @@ -1,32 +1,38 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.32.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd, valid_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class KealibConan(ConanFile): name = "kealib" description = "C++ library providing complete access to the KEA image format." license = "MIT" - topics = ("conan", "kealib", "image", "raster") - homepage = "https://github.com/ubarsc/kealib" url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - - _cmake = None + homepage = "https://github.com/ubarsc/kealib" + topics = ("image", "raster") - @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, + } @property - def _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return 11 def config_options(self): if self.settings.os == "Windows": @@ -34,41 +40,62 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") self.options["hdf5"].enable_cxx = True self.options["hdf5"].hl = True + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): - self.requires("hdf5/1.12.0") + self.requires("hdf5/1.14.3", transitive_headers=True, transitive_libs=True) def validate(self): - if not (self.options["hdf5"].enable_cxx and self.options["hdf5"].hl): - raise ConanInvalidConfiguration("kealib requires hdf5 with cxx and hl enabled.") + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + hdf5_opts = self.dependencies["hdf5"].options + if not (hdf5_opts.enable_cxx and hdf5_opts.hl): + raise ConanInvalidConfiguration(f"{self.ref} requires dependencies options -o 'hdf5/*:enable_cxx=True' -o 'hdf5/*:hl=True'") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("{0}-{0}-{1}".format(self.name, self.version), self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["HDF5_USE_STATIC_LIBRARIES"] = not self.options["hdf5"].shared - self._cmake.definitions["HDF5_PREFER_PARALLEL"] = False # TODO: rely on self.options["hdf5"].parallel when implemented in hdf5 recipe - self._cmake.definitions["LIBKEA_WITH_GDAL"] = 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["HDF5_USE_STATIC_LIBRARIES"] = not self.dependencies["hdf5"].options.shared + tc.variables["HDF5_PREFER_PARALLEL"] = self.dependencies["hdf5"].options.parallel + tc.variables["HDF5_THREADSAFE"] = self.dependencies["hdf5"].options.get_safe("threadsafe", False) + tc.variables["LIBKEA_WITH_GDAL"] = False + # INFO: kealib uses C++11 but does not configure in cmake: https://github.com/ubarsc/kealib/pull/48 + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + tc = CMakeDeps(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - 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, "LICENSE.txt", + 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 = tools.collect_libs(self) + if is_msvc(self): + if not self.options.shared and Version(self.version) <= "1.4.14": + self.cpp_info.libs = ["liblibkea"] + else: + self.cpp_info.libs = ["libkea"] + else: + self.cpp_info.libs = ["kea"] + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("shlwapi") diff --git a/recipes/kealib/all/patches/fix-cmake-1.4.14.patch b/recipes/kealib/all/patches/fix-cmake-1.4.14.patch deleted file mode 100644 index 40e8ed0c1a606..0000000000000 --- a/recipes/kealib/all/patches/fix-cmake-1.4.14.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -30,7 +30,7 @@ source_group("include_kea" FILES ${LIBKEA_H}) - ############################################################################### - # Build, link and install library - add_library(${LIBKEA_LIB_NAME} ${LIBKEA_CPP} ${LIBKEA_H} ) --target_link_libraries(${LIBKEA_LIB_NAME} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES}) -+target_link_libraries(${LIBKEA_LIB_NAME} ${CONAN_LIBS}) - - include(GenerateExportHeader) - generate_export_header(${LIBKEA_LIB_NAME} -@@ -63,8 +63,6 @@ target_link_libraries(Kealib INTERFACE "${LIBKEA_LIB_NAME}") - ############################################################################### - # Testing - # exe needs to be in 'src' otherwise it doesn't work --add_executable (test1 ${PROJECT_SOURCE_DIR}/src/tests/test1.cpp) --target_link_libraries (test1 ${LIBKEA_LIB_NAME}) - ############################################################################### - - ############################################################################### diff --git a/recipes/kealib/all/patches/fix-export-symbols-and-cmake.patch b/recipes/kealib/all/patches/fix-export-symbols-and-cmake.patch deleted file mode 100644 index 0107ba1879496..0000000000000 --- a/recipes/kealib/all/patches/fix-export-symbols-and-cmake.patch +++ /dev/null @@ -1,219 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -52,14 +52,7 @@ set (LIBKEA_PACKAGE_BUGREPORT "petebunting@mac.com") - set (LIBKEA_PACKAGE "LibKEA") - set (LIBKEA_COPYRIGHT_YEAR 2013) - --if(MSVC) -- # set Name of C++ library -- # this forces it to be libkea on Windows with VC -- set(LIBKEA_LIB_NAME libkea) --else() -- # set Name of C++ library -- set(LIBKEA_LIB_NAME kea) --endif() -+set(LIBKEA_LIB_NAME kea) - - include(CMakeDependentOption) - # CMake global option valiable -@@ -195,11 +188,11 @@ endif(MSVC) - - ############################################################################### - # Setup configure file --configure_file ( "${PROJECT_HEADER_DIR}/kea-config.h.in" "${CMAKE_BINARY_DIR}/${PROJECT_HEADER_DIR}/libkea/kea-config.h" ) -+configure_file ( "${PROJECT_HEADER_DIR}/kea-config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/libkea/kea-config.h" ) - if(MSVC) -- configure_file ( "${PROJECT_TOOLS_DIR}/kea-config.bat.in" "${CMAKE_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config.bat" ) -+ configure_file ( "${PROJECT_TOOLS_DIR}/kea-config.bat.in" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config.bat" ) - else() -- configure_file ( "${PROJECT_TOOLS_DIR}/kea-config.in" "${CMAKE_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config" ) -+ configure_file ( "${PROJECT_TOOLS_DIR}/kea-config.in" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config" ) - endif(MSVC) - ############################################################################### - -@@ -213,7 +206,7 @@ endif(MSVC) - # Build library - - include_directories ("${PROJECT_HEADER_DIR}") --include_directories ("${CMAKE_BINARY_DIR}/${PROJECT_HEADER_DIR}") -+include_directories ("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_HEADER_DIR}") - include_directories(${HDF5_INCLUDE_DIRS}) - add_subdirectory ("${PROJECT_SOURCE_DIR}") - if (LIBKEA_WITH_GDAL) -@@ -234,7 +227,7 @@ if(MSVC) - else() - install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config" DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - endif(MSVC) --install (FILES "${CMAKE_BINARY_DIR}/${PROJECT_HEADER_DIR}/libkea/kea-config.h" DESTINATION include/libkea) -+install (FILES "${CMAKE_CURRENT_BINARY_DIR}/include/libkea/kea-config.h" DESTINATION include/libkea) - ############################################################################### - - ############################################################################### ---- a/include/libkea/KEAAttributeTable.h -+++ b/include/libkea/KEAAttributeTable.h -@@ -98,7 +98,7 @@ namespace kealib{ - void *p; - } VarLenFieldHDF; - -- class DllExport KEAAttributeTable -+ class KEA_EXPORT KEAAttributeTable - { - public: - KEAAttributeTable(KEAATTType keaAttType); ---- a/include/libkea/KEAAttributeTableFile.h -+++ b/include/libkea/KEAAttributeTableFile.h -@@ -43,7 +43,7 @@ - - namespace kealib{ - -- class DllExport KEAAttributeTableFile : public KEAAttributeTable -+ class KEA_EXPORT KEAAttributeTableFile : public KEAAttributeTable - { - public: - KEAAttributeTableFile(H5::H5File *keaImgIn, const std::string &bandPathBaseIn, size_t numRowsIn, size_t chunkSizeIn, unsigned int deflateIn=KEA_DEFLATE); ---- a/include/libkea/KEAAttributeTableInMem.h -+++ b/include/libkea/KEAAttributeTableInMem.h -@@ -43,7 +43,7 @@ - - namespace kealib{ - -- class DllExport KEAAttributeTableInMem : public KEAAttributeTable -+ class KEA_EXPORT KEAAttributeTableInMem : public KEAAttributeTable - { - public: - KEAAttributeTableInMem(); ---- a/include/libkea/KEACommon.h -+++ b/include/libkea/KEACommon.h -@@ -38,15 +38,7 @@ - - #include "H5Cpp.h" - --// mark all exported classes/functions with DllExport to have --// them exported by Visual Studio --#ifndef DllExport -- #ifdef _MSC_VER -- #define DllExport __declspec( dllexport ) -- #else -- #define DllExport -- #endif --#endif -+#include "libkea/kea_export.h" - - // MSVC 2008 uses different names.... - #ifdef _MSC_VER ---- a/include/libkea/KEAException.h -+++ b/include/libkea/KEAException.h -@@ -37,7 +37,7 @@ - - namespace kealib - { -- class DllExport KEAException : public std::exception -+ class KEA_EXPORT KEAException : public std::exception - { - public: - KEAException() : exception() {msgs = "A KEAException has been created.";}; -@@ -49,7 +49,7 @@ namespace kealib - std::string msgs; - }; - -- class DllExport KEAIOException : public KEAException -+ class KEA_EXPORT KEAIOException : public KEAException - { - public: - KEAIOException() : KEAException("KEAIOException has been created."){}; -@@ -58,7 +58,7 @@ namespace kealib - ~KEAIOException() throw() {}; - }; - -- class DllExport KEAATTException : public KEAException -+ class KEA_EXPORT KEAATTException : public KEAException - { - public: - KEAATTException() : KEAException("KEAATTException has been created."){}; ---- a/include/libkea/KEAImageIO.h -+++ b/include/libkea/KEAImageIO.h -@@ -45,7 +45,7 @@ - - namespace kealib{ - -- class DllExport KEAImageIO -+ class KEA_EXPORT KEAImageIO - { - public: - KEAImageIO(); -@@ -171,7 +171,7 @@ namespace kealib{ - } - - // returns the current KEA version as a double --extern "C" DllExport double get_kealibversion(); -+extern "C" KEA_EXPORT double get_kealibversion(); - - #endif - ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -30,34 +30,37 @@ source_group("include_kea" FILES ${LIBKEA_H}) - ############################################################################### - # Build, link and install library - add_library(${LIBKEA_LIB_NAME} ${LIBKEA_CPP} ${LIBKEA_H} ) --target_link_libraries(${LIBKEA_LIB_NAME} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES}) -+target_link_libraries(${LIBKEA_LIB_NAME} ${CONAN_LIBS}) - --if(BUILD_SHARED_LIBS) -- SET_TARGET_PROPERTIES(${LIBKEA_LIB_NAME} -- PROPERTIES -- SOVERSION ${LIBKEA_VERSION_MAJOR}.${LIBKEA_VERSION_MINOR} -- VERSION ${LIBKEA_VERSION} -- CLEAN_DIRECT_OUTPUT 1) --else() -- SET_TARGET_PROPERTIES(${LIBKEA_LIB_NAME} -- PROPERTIES -- OUTPUT_NAME "${LIBKEA_LIB_NAME}" -- PREFIX "lib" -- VERSION ${LIBKEA_VERSION} -- CLEAN_DIRECT_OUTPUT 1) -+include(GenerateExportHeader) -+generate_export_header(${LIBKEA_LIB_NAME} -+ EXPORT_MACRO_NAME KEA_EXPORT -+ EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/include/libkea/kea_export.h -+) -+target_include_directories(${LIBKEA_LIB_NAME} PUBLIC -+ $ -+ $ -+ $ -+) -+set_target_properties(${LIBKEA_LIB_NAME} -+ PROPERTIES -+ CXX_VISIBILITY_PRESET hidden -+ VISIBILITY_INLINES_HIDDEN 1 -+ PREFIX "lib" -+ IMPORT_PREFIX "lib" -+ SOVERSION ${LIBKEA_VERSION_MAJOR}.${LIBKEA_VERSION_MINOR} -+ VERSION ${LIBKEA_VERSION} -+) -+if(MSVC AND NOT BUILD_SHARED_LIBS) -+ set_target_properties(${LIBKEA_LIB_NAME} PROPERTIES OUTPUT_NAME "libkea") - endif() - add_library(Kealib INTERFACE) - target_link_libraries(Kealib INTERFACE "${LIBKEA_LIB_NAME}") --target_include_directories(Kealib INTERFACE -- $ -- $) - ############################################################################### - - ############################################################################### - # Testing - # exe needs to be in 'src' otherwise it doesn't work --add_executable (test1 ${CMAKE_SOURCE_DIR}/src/tests/test1.cpp) --target_link_libraries (test1 ${LIBKEA_LIB_NAME}) - - ############################################################################### - # Set target properties -@@ -76,5 +79,6 @@ install (TARGETS ${LIBKEA_LIB_NAME} - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) --install (FILES ${LIBKEA_H} DESTINATION include/libkea) -+install (FILES ${LIBKEA_H} ${CMAKE_CURRENT_BINARY_DIR}/include/libkea/kea_export.h -+ DESTINATION include/libkea) - ############################################################################### diff --git a/recipes/kealib/all/test_package/CMakeLists.txt b/recipes/kealib/all/test_package/CMakeLists.txt index 196188113685c..0d6f2bcf3918c 100644 --- a/recipes/kealib/all/test_package/CMakeLists.txt +++ b/recipes/kealib/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(kealib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE kealib::kealib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/kealib/all/test_package/conanfile.py b/recipes/kealib/all/test_package/conanfile.py index ea57a464900be..ef5d7042163ec 100644 --- a/recipes/kealib/all/test_package/conanfile.py +++ b/recipes/kealib/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/kealib/all/test_package/test_package.cpp b/recipes/kealib/all/test_package/test_package.cpp index ed6447aec5e35..4a9b2a79bfb1a 100644 --- a/recipes/kealib/all/test_package/test_package.cpp +++ b/recipes/kealib/all/test_package/test_package.cpp @@ -7,23 +7,23 @@ * * This file is part of LibKEA. * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, - * merge, publish, distribute, sublicense, and/or sell copies of the - * Software, and to permit persons to whom the Software is furnished + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, + * merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished * to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be + * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ @@ -42,7 +42,7 @@ int main() try { kealib::KEAImageIO io; - H5::H5File *h5file = kealib::KEAImageIO::createKEAImage("bob.kea", + H5::H5File *h5file = kealib::KEAImageIO::createKEAImage("bob.kea", kealib::kea_8uint, IMG_XSIZE, IMG_YSIZE, 1); io.openKEAImageHeader(h5file); @@ -52,7 +52,7 @@ int main() { pData[i] = rand() % 255; } - io.writeImageBlock2Band(1, pData, 0, 0, IMG_XSIZE, IMG_YSIZE, + io.writeImageBlock2Band(1, pData, 0, 0, IMG_XSIZE, IMG_YSIZE, IMG_XSIZE, IMG_YSIZE, kealib::kea_8uint); free(pData); diff --git a/recipes/kealib/all/test_v1_package/CMakeLists.txt b/recipes/kealib/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/kealib/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/kealib/all/test_v1_package/conanfile.py b/recipes/kealib/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..84ee68733e516 --- /dev/null +++ b/recipes/kealib/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/kealib/config.yml b/recipes/kealib/config.yml index 46b5f6a142b86..d8de052a2b5a1 100644 --- a/recipes/kealib/config.yml +++ b/recipes/kealib/config.yml @@ -1,5 +1,7 @@ versions: - "1.4.14": + "1.5.2": + folder: all + "1.4.15": folder: all - "1.4.13": + "1.4.14": folder: all diff --git a/recipes/krb5/all/conandata.yml b/recipes/krb5/all/conandata.yml new file mode 100644 index 0000000000000..f074e932120e0 --- /dev/null +++ b/recipes/krb5/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.21.2": + url: "https://kerberos.org/dist/krb5/1.21/krb5-1.21.2.tar.gz" + sha256: "9560941a9d843c0243a71b17a7ac6fe31c7cebb5bce3983db79e52ae7e850491" +patches: + "1.21.2": + - patch_file: "patches/0001-no-tests.patch" + patch_type: "conan" + patch_description: "Disable building tests" + - patch_file: "patches/0002-disable_ksu_root.patch" + patch_description: "No ksu install as root user" + patch_type: "conan" + - patch_file: "patches/0003-find-openssl-module.patch" + patch_description: "Use OpenSSL .pc module to find libraries" + patch_source: "https://github.com/krb5/krb5/pull/1351" + patch_type: "portability" diff --git a/recipes/krb5/all/conanfile.py b/recipes/krb5/all/conanfile.py new file mode 100644 index 0000000000000..45d89ebc279af --- /dev/null +++ b/recipes/krb5/all/conanfile.py @@ -0,0 +1,169 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, rmdir, export_conandata_patches, apply_conandata_patches, chdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.54.0" + +class Krb5Conan(ConanFile): + name = "krb5" + description = "Kerberos is a network authentication protocol. It is designed to provide strong authentication " \ + "for client/server applications by using secret-key cryptography." + homepage = "https://web.mit.edu/kerberos" + topics = ("kerberos", "network", "authentication", "protocol", "client", "server", "cryptography") + license = "LicenseRef-NOTICE" + url = "https://github.com/conan-io/conan-center-index" + package_type = "shared-library" + options = { + "use_thread": [True, False], + "use_dns_realms": [True, False], + "with_tls": [False, "openssl"], + } + default_options = { + "use_thread": True, + "use_dns_realms": False, + "with_tls": "openssl" + } + options_description = { + "use_thread": "Enable thread support", + "use_dns_realms": "Enable DNS for realms", + "with_tls": "Enable TLS support with OpenSSL", + } + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} Conan recipe is not prepared for Windows yet. Contributions are welcome!") + if self.settings.os == "Macos": + raise ConanInvalidConfiguration(f"{self.ref} Conan recipe is not prepared for Macos yet. Contributions are welcome!") + if self.options.with_tls == "openssl" and not self.dependencies["openssl"].options.shared: + # k5tls does not respect linkage order, it passes krb5 and krb5support before openssl to the linker, which causes linking errors + # gcc -shared -fPIC -Wl,-h,k5tls.so.0 -Wl,--no-undefined -o k5tls.so openssl.so notls.so -L../../../lib -lkrb5 -lkrb5support ... + # /usr/bin/ld: /.../lib/libssl.a(libssl-lib-ssl_cert_comp.o): in function `OSSL_COMP_CERT_from_uncompressed_data': + # ssl_cert_comp.c:(.text+0x3d1): undefined reference to `COMP_CTX_free' + raise ConanInvalidConfiguration(f"{self.ref} building with static OpenSSL generates linking errors. Please use '-o openssl/*:shared=True'") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tls_impl = {"openssl": "openssl",}.get(str(self.options.get_safe('with_tls'))) + tc.configure_args.extend([ + f"--enable-thread-support={yes_no(self.options.get_safe('use_thread'))}", + f"--enable-dns-for-realm={yes_no(self.options.use_dns_realms)}", + f"--enable-pkinit={yes_no(self.options.get_safe('with_tls'))}", + f"--with-crypto-impl={(tls_impl or 'builtin')}", + f"--with-spake-openssl={yes_no(self.options.get_safe('with_tls') == 'openssl')}", + f"--with-tls-impl={(tls_impl or 'no')}", + "--disable-nls", + "--disable-rpath", + "--without-libedit", + "--without-readline", + "--with-system-verto", + "--enable-dns-for-realm", + f"--with-keyutils={self.package_folder}", + f"--with-tcl={(self.dependencies['tcl'].package_folder if self.options.get_safe('with_tcl') else 'no')}", + ]) + tc.generate() + + pkg = AutotoolsDeps(self) + pkg.generate() + pkg = PkgConfigDeps(self) + pkg.generate() + + def requirements(self): + self.requires("libverto/0.3.2") + if self.options.get_safe("with_tls") == "openssl": + self.requires("openssl/[>=1.1 <4]") + if self.options.get_safe("with_tcl"): + self.requires("tcl/8.6.11") + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + self.build_requires("automake/1.16.5") + self.build_requires("bison/3.8.2") + + def build(self): + apply_conandata_patches(self) + with chdir(self, os.path.join(self.source_folder, "src")): + self.run("autoreconf -vif") + autotools = Autotools(self) + autotools.configure(build_script_folder=os.path.join(self.source_folder, "src")) + autotools.make() + + def package(self): + copy(self, "NOTICE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "var")) + + def package_info(self): + self.cpp_info.components["mit-krb5"].libs = ["krb5", "k5crypto", "com_err"] + if self.options.get_safe('with_tls') == "openssl": + self.cpp_info.components["mit-krb5"].requires = ["openssl::crypto"] + self.cpp_info.components["mit-krb5"].names["pkg_config"] = "mit-krb5" + if self.settings.os == "Linux": + self.cpp_info.components["mit-krb5"].system_libs = ["resolv"] + + self.cpp_info.components["libkrb5"].libs = [] + self.cpp_info.components["libkrb5"].requires = ["mit-krb5"] + self.cpp_info.components["libkrb5"].names["pkg_config"] = "krb5" + + self.cpp_info.components["mit-krb5-gssapi"].libs = ["gssapi_krb5"] + self.cpp_info.components["mit-krb5-gssapi"].requires = ["mit-krb5"] + self.cpp_info.components["mit-krb5-gssapi"].names["pkg_config"] = "mit-krb5-gssapi" + + self.cpp_info.components["krb5-gssapi"].libs = [] + self.cpp_info.components["krb5-gssapi"].requires = ["mit-krb5-gssapi"] + self.cpp_info.components["krb5-gssapi"].names["pkg_config"] = "krb5-gssapi" + + self.cpp_info.components["gssrpc"].libs = ["gssrpc"] + self.cpp_info.components["gssrpc"].requires = ["mit-krb5-gssapi"] + self.cpp_info.components["gssrpc"].names["pkg_config"] = "gssrpc" + + self.cpp_info.components["kadm-client"].libs = ["kadm5clnt_mit"] + self.cpp_info.components["kadm-client"].requires = ["mit-krb5-gssapi", "gssrpc"] + self.cpp_info.components["kadm-client"].names["pkg_config"] = "kadm-client" + + self.cpp_info.components["kdb"].libs = ["kdb5"] + self.cpp_info.components["kdb"].requires = ["mit-krb5-gssapi", "mit-krb5", "gssrpc"] + self.cpp_info.components["kdb"].names["pkg_config"] = "kdb-client" + + self.cpp_info.components["kadm-server"].libs = ["kadm5srv_mit"] + self.cpp_info.components["kadm-server"].requires = ["kdb", "mit-krb5-gssapi"] + self.cpp_info.components["kadm-server"].names["pkg_config"] = "kadm-server" + + self.cpp_info.components["krad"].libs = ["krad"] + self.cpp_info.components["krad"].requires = ["libkrb5", "libverto::libverto"] + + krb5_config = os.path.join(self.package_folder, "bin", "krb5-config").replace("\\", "/") + self.output.info("Appending KRB5_CONFIG environment variable: {}".format(krb5_config)) + self.runenv_info.define_path("KRB5_CONFIG", krb5_config) diff --git a/recipes/krb5/all/patches/0001-no-tests.patch b/recipes/krb5/all/patches/0001-no-tests.patch new file mode 100644 index 0000000000000..6277a45dd0a98 --- /dev/null +++ b/recipes/krb5/all/patches/0001-no-tests.patch @@ -0,0 +1,13 @@ +diff --git a/src/Makefile.in b/src/Makefile.in +index 8f14e9bf2..dfb6843c9 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -30,7 +30,7 @@ SUBDIRS=util include lib \ + plugins/preauth/spake \ + plugins/preauth/test \ + plugins/tls/k5tls \ +- kdc kadmin kprop clients appl tests \ ++ kdc kadmin kprop clients appl \ + config-files build-tools man doc @po@ + WINSUBDIRS=include util lib ccapi windows clients appl plugins\preauth\spake + BUILDTOP=$(REL). diff --git a/recipes/krb5/all/patches/0002-disable_ksu_root.patch b/recipes/krb5/all/patches/0002-disable_ksu_root.patch new file mode 100644 index 0000000000000..1c0aa45316310 --- /dev/null +++ b/recipes/krb5/all/patches/0002-disable_ksu_root.patch @@ -0,0 +1,13 @@ +diff --git a/src/config/pre.in b/src/config/pre.in +index 3752174..98dbe0f 100644 +--- a/src/config/pre.in ++++ b/src/config/pre.in +@@ -184,7 +184,7 @@ INSTALL_PROGRAM=@INSTALL_PROGRAM@ $(INSTALL_STRIP) + INSTALL_SCRIPT=@INSTALL_PROGRAM@ + INSTALL_DATA=@INSTALL_DATA@ + INSTALL_SHLIB=@INSTALL_SHLIB@ +-INSTALL_SETUID=$(INSTALL) $(INSTALL_STRIP) -m 4755 -o root ++INSTALL_SETUID=$(INSTALL) $(INSTALL_STRIP) -m 755 + ## This is needed because autoconf will sometimes define @exec_prefix@ to be + ## ${prefix}. + prefix=@prefix@ diff --git a/recipes/krb5/all/patches/0003-find-openssl-module.patch b/recipes/krb5/all/patches/0003-find-openssl-module.patch new file mode 100644 index 0000000000000..6c1d8cf5ff6fb --- /dev/null +++ b/recipes/krb5/all/patches/0003-find-openssl-module.patch @@ -0,0 +1,20 @@ +diff --git a/src/configure.ac b/src/configure.ac +index 77be7a2..577da79 100644 +--- a/src/configure.ac ++++ b/src/configure.ac +@@ -295,13 +295,10 @@ AC_ARG_WITH([tls-impl], + [TLS_IMPL=$withval], [TLS_IMPL=auto]) + case "$TLS_IMPL" in + openssl|auto) +- AC_CHECK_LIB(ssl,SSL_CTX_new,[have_lib_ssl=true],[have_lib_ssl=false], +- -lcrypto) +- AC_MSG_CHECKING([for OpenSSL]) ++ PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.1.0], [have_lib_ssl=true], [have_lib_ssl=false]) + if test x$have_lib_ssl = xtrue ; then + AC_DEFINE(TLS_IMPL_OPENSSL,1,[Define if TLS implementation is OpenSSL]) +- AC_MSG_RESULT([yes]) +- TLS_IMPL_LIBS="-lssl -lcrypto" ++ TLS_IMPL_LIBS=$OPENSSL_LIBS + TLS_IMPL=openssl + AC_MSG_NOTICE([TLS module will use OpenSSL]) + else diff --git a/recipes/krb5/all/test_package/CMakeLists.txt b/recipes/krb5/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8bf1b7258ab16 --- /dev/null +++ b/recipes/krb5/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(krb5 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE krb5::krb5) diff --git a/recipes/krb5/all/test_package/conanfile.py b/recipes/krb5/all/test_package/conanfile.py new file mode 100644 index 0000000000000..23c0291e76c1f --- /dev/null +++ b/recipes/krb5/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "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 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/krb5/all/test_package/test_package.c b/recipes/krb5/all/test_package/test_package.c new file mode 100644 index 0000000000000..1e241814c8386 --- /dev/null +++ b/recipes/krb5/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include "krb5.h" + +#include + +int +main(int argc, char **argv) +{ + krb5_context context; + int ret = krb5_init_context(&context); + if (ret != 0) { + fprintf(stderr, "krb5_init_context failed\n"); + return 1; + } + krb5_free_context(context); + return 0; +} diff --git a/recipes/krb5/config.yml b/recipes/krb5/config.yml new file mode 100644 index 0000000000000..5522f8acd1f0a --- /dev/null +++ b/recipes/krb5/config.yml @@ -0,0 +1,3 @@ +versions: + "1.21.2": + folder: "all" diff --git a/recipes/ktx/all/conandata.yml b/recipes/ktx/all/conandata.yml index bc8cca1018446..a63666c9c170a 100644 --- a/recipes/ktx/all/conandata.yml +++ b/recipes/ktx/all/conandata.yml @@ -1,10 +1,16 @@ sources: + "4.3.2": + url: "https://github.com/KhronosGroup/KTX-Software/archive/refs/tags/v4.3.2.tar.gz" + sha256: "74a114f465442832152e955a2094274b446c7b2427c77b1964c85c173a52ea1f" "4.0.0": url: "https://github.com/KhronosGroup/KTX-Software/archive/refs/tags/v4.0.0.tar.gz" sha256: "6091f5064d0cfd54c6155bb6c0d2ba7287f312d109010e9b702839ac78529fd3" patches: + "4.3.2": + - patch_file: "patches/4.3.2/0001-objutil-cxx-std.patch" + - patch_file: "patches/4.3.2/0004-unvendor-dependencies.patch" "4.0.0": - - patch_file: "patches/0001-objutil-cxx-std.patch" - - patch_file: "patches/0002-lodepng-no-export-symbols.patch" - - patch_file: "patches/0003-clamp-include-algorithm.patch" - - patch_file: "patches/0004-unvendor-dependencies.patch" + - patch_file: "patches/4.0.0/0001-objutil-cxx-std.patch" + - patch_file: "patches/4.0.0/0002-lodepng-no-export-symbols.patch" + - patch_file: "patches/4.0.0/0003-clamp-include-algorithm.patch" + - patch_file: "patches/4.0.0/0004-unvendor-dependencies.patch" diff --git a/recipes/ktx/all/conanfile.py b/recipes/ktx/all/conanfile.py index 5d9cc3ea68050..a7aab249baf8d 100644 --- a/recipes/ktx/all/conanfile.py +++ b/recipes/ktx/all/conanfile.py @@ -1,7 +1,9 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd, stdcpp_library from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file, save +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -29,6 +31,25 @@ class KtxConan(ConanFile): "tools": True, } + @property + def _min_cppstd(self): + if Version(self.version) < "4.3.2": + return 11 + return 17 + + @property + def _compilers_minimum_version(self): + if self._min_cppstd == 17: + return { + "gcc": "8", + "clang": "7", + "apple-clang": "10", + "msvc": "191", + "Visual Studio": "15", + } + return {} + + @property def _has_sse_support(self): return self.settings.arch in ["x86", "x86_64"] @@ -53,15 +74,30 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("lodepng/cci.20230410") + if Version(self.version) < "4.2.0": + # Newer versions use modified lodepng + # https://github.com/KhronosGroup/KTX-Software/blob/v4.2.1/tools/imageio/png.imageio/lodepng.h#L26-L32 + self.requires("lodepng/cci.20230410") self.requires("zstd/1.5.5") def validate(self): if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + 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) >= "4.2" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 6: + # astcenc_vecmathlib_sse_4.h:809:41: error: the last argument must be a 4-bit immediate + raise ConanInvalidConfiguration("GCC v6+ is required") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + # Avoid copying of 300 MB of test assets and third-party binaries + rmdir(self, os.path.join(self.source_folder, "tests")) + rmdir(self, os.path.join(self.source_folder, "other_lib")) + save(self, os.path.join(self.source_folder, "tests", "CMakeLists.txt"), "") def generate(self): tc = CMakeToolchain(self) @@ -73,6 +109,7 @@ def generate(self): tc.variables["BASISU_SUPPORT_SSE"] = self.options.get_safe("sse", False) tc.generate() deps = CMakeDeps(self) + deps.set_property("zstd", "cmake_target_name", "zstd::libzstd") deps.generate() def _patch_sources(self): @@ -80,11 +117,16 @@ def _patch_sources(self): # Unvendor several libs (we rely on patch files to link those libs) # It's worth noting that vendored jpeg-compressor can't be replaced by CCI equivalent basisu_dir = os.path.join(self.source_folder, "lib", "basisu") - ## lodepng (the patch file 0002-lodepng-no-export-symbols is important, in order to not try to export lodepng symbols) - os.remove(os.path.join(basisu_dir, "encoder", "lodepng.cpp")) - os.remove(os.path.join(basisu_dir, "encoder", "lodepng.h")) + if Version(self.version) < "4.1.0": + ## lodepng (the patch file 0002-lodepng-no-export-symbols is important, in order to not try to export lodepng symbols) + os.remove(os.path.join(basisu_dir, "encoder", "lodepng.cpp")) + os.remove(os.path.join(basisu_dir, "encoder", "lodepng.h")) ## zstd rmdir(self, os.path.join(basisu_dir, "zstd")) + # disable -Werror + if Version(self.version) >= "4.3.2": + replace_in_file(self, os.path.join(self.source_folder, "lib", "astc-encoder", "Source", "cmake_core.cmake"), + "-Werror", "") def build(self): self._patch_sources() @@ -125,6 +167,8 @@ def package_info(self): self.cpp_info.components["libktx"].names["cmake_find_package"] = "ktx" self.cpp_info.components["libktx"].names["cmake_find_package_multi"] = "ktx" self.cpp_info.components["libktx"].set_property("cmake_target_name", "KTX::ktx") - self.cpp_info.components["libktx"].requires = ["lodepng::lodepng", "zstd::zstd"] + self.cpp_info.components["libktx"].requires = ["zstd::zstd"] + if Version(self.version) < "4.2.0": + self.cpp_info.components["libktx"].requires.append("lodepng::lodepng") if self.options.tools: self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/ktx/all/patches/0004-unvendor-dependencies.patch b/recipes/ktx/all/patches/0004-unvendor-dependencies.patch deleted file mode 100644 index d09e2d811a873..0000000000000 --- a/recipes/ktx/all/patches/0004-unvendor-dependencies.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -121,7 +121,6 @@ set(KTX_MAIN_SRC - lib/basisu/transcoder/basisu_transcoder.cpp - lib/basisu/transcoder/basisu_transcoder.h - lib/basisu/transcoder/basisu.h -- lib/basisu/zstd/zstd.c - lib/checkheader.c - lib/dfdutils/createdfd.c - lib/dfdutils/colourspaces.c -@@ -415,11 +414,13 @@ PRIVATE - lib/basisu/encoder/cppspmd_type_aliases.h - lib/basisu/encoder/jpgd.cpp - lib/basisu/encoder/jpgd.h -- lib/basisu/encoder/lodepng.cpp -- lib/basisu/encoder/lodepng.h - lib/writer1.c - lib/writer2.c - ) -+find_package(lodepng REQUIRED CONFIG) -+find_package(zstd REQUIRED CONFIG) -+target_link_libraries(ktx PRIVATE lodepng::lodepng $,zstd::libzstd_shared,zstd::libzstd_static>) -+target_link_libraries(ktx_read PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) - target_include_directories( - ktx - PRIVATE ---- a/tools/toktx/CMakeLists.txt -+++ b/tools/toktx/CMakeLists.txt -@@ -28,6 +28,8 @@ PRIVATE - target_link_libraries( - toktx - ktx -+ lodepng::lodepng -+ $,zstd::libzstd_shared,zstd::libzstd_static> - ) - - target_compile_definitions( ---- a/tools/toktx/pngimage.cc -+++ b/tools/toktx/pngimage.cc -@@ -21,7 +21,7 @@ - #include - - #include "image.hpp" --#include "encoder/lodepng.h" -+#include - #include - #include "dfd.h" - diff --git a/recipes/ktx/all/patches/0001-objutil-cxx-std.patch b/recipes/ktx/all/patches/4.0.0/0001-objutil-cxx-std.patch similarity index 100% rename from recipes/ktx/all/patches/0001-objutil-cxx-std.patch rename to recipes/ktx/all/patches/4.0.0/0001-objutil-cxx-std.patch diff --git a/recipes/ktx/all/patches/0002-lodepng-no-export-symbols.patch b/recipes/ktx/all/patches/4.0.0/0002-lodepng-no-export-symbols.patch similarity index 100% rename from recipes/ktx/all/patches/0002-lodepng-no-export-symbols.patch rename to recipes/ktx/all/patches/4.0.0/0002-lodepng-no-export-symbols.patch diff --git a/recipes/ktx/all/patches/0003-clamp-include-algorithm.patch b/recipes/ktx/all/patches/4.0.0/0003-clamp-include-algorithm.patch similarity index 100% rename from recipes/ktx/all/patches/0003-clamp-include-algorithm.patch rename to recipes/ktx/all/patches/4.0.0/0003-clamp-include-algorithm.patch diff --git a/recipes/ktx/all/patches/4.0.0/0004-unvendor-dependencies.patch b/recipes/ktx/all/patches/4.0.0/0004-unvendor-dependencies.patch new file mode 100644 index 0000000000000..076b9eecaa908 --- /dev/null +++ b/recipes/ktx/all/patches/4.0.0/0004-unvendor-dependencies.patch @@ -0,0 +1,48 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -121,7 +121,6 @@ set(KTX_MAIN_SRC + lib/basisu/transcoder/basisu_transcoder.cpp + lib/basisu/transcoder/basisu_transcoder.h + lib/basisu/transcoder/basisu.h +- lib/basisu/zstd/zstd.c + lib/checkheader.c + lib/dfdutils/createdfd.c + lib/dfdutils/colourspaces.c +@@ -415,11 +414,13 @@ PRIVATE + lib/basisu/encoder/cppspmd_type_aliases.h + lib/basisu/encoder/jpgd.cpp + lib/basisu/encoder/jpgd.h +- lib/basisu/encoder/lodepng.cpp +- lib/basisu/encoder/lodepng.h + lib/writer1.c + lib/writer2.c + ) ++find_package(lodepng REQUIRED CONFIG) ++find_package(zstd REQUIRED CONFIG) ++target_link_libraries(ktx PRIVATE lodepng::lodepng zstd::libzstd) ++target_link_libraries(ktx_read PRIVATE zstd::libzstd) + target_include_directories( + ktx + PRIVATE +--- a/tools/toktx/CMakeLists.txt ++++ b/tools/toktx/CMakeLists.txt +@@ -28,6 +28,8 @@ PRIVATE + target_link_libraries( + toktx + ktx ++ lodepng::lodepng ++ zstd::libzstd + ) + + target_compile_definitions( +--- a/tools/toktx/pngimage.cc ++++ b/tools/toktx/pngimage.cc +@@ -21,7 +21,7 @@ + #include + + #include "image.hpp" +-#include "encoder/lodepng.h" ++#include + #include + #include "dfd.h" + diff --git a/recipes/ktx/all/patches/4.3.2/0001-objutil-cxx-std.patch b/recipes/ktx/all/patches/4.3.2/0001-objutil-cxx-std.patch new file mode 100644 index 0000000000000..fee67e7e70f54 --- /dev/null +++ b/recipes/ktx/all/patches/4.3.2/0001-objutil-cxx-std.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -972,6 +972,6 @@ + PUBLIC + utils + ) +- ++target_compile_features(objUtil PUBLIC cxx_std_11) + # In C++ apps that use statically linked Libraries all compilatiom units must + # be compiled with matching symbol visibility settings to avoid warnings from diff --git a/recipes/ktx/all/patches/4.3.2/0004-unvendor-dependencies.patch b/recipes/ktx/all/patches/4.3.2/0004-unvendor-dependencies.patch new file mode 100644 index 0000000000000..5fb6ef588fa4e --- /dev/null +++ b/recipes/ktx/all/patches/4.3.2/0004-unvendor-dependencies.patch @@ -0,0 +1,21 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -355,7 +355,6 @@ + lib/basisu/transcoder/basisu_transcoder.cpp + lib/basisu/transcoder/basisu_transcoder.h + lib/basisu/transcoder/basisu.h +- lib/basisu/zstd/zstd.c + lib/checkheader.c + lib/dfdutils/createdfd.c + lib/dfdutils/colourspaces.c +@@ -765,6 +764,10 @@ + BASISD_SUPPORT_KTX2=0 + ) + ++find_package(zstd REQUIRED CONFIG) ++target_link_libraries(ktx PUBLIC zstd::libzstd) ++target_link_libraries(ktx_read PUBLIC zstd::libzstd) ++ + # Turn off these warnings until Rich fixes the occurences. + # It it not clear to me if generator expressions can be used here + # hence the long-winded way. diff --git a/recipes/ktx/all/test_package/conanfile.py b/recipes/ktx/all/test_package/conanfile.py index 5ec8993308c18..98ab55852ad56 100644 --- a/recipes/ktx/all/test_package/conanfile.py +++ b/recipes/ktx/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - ktx_path = os.path.join(self.source_folder, "etc1.ktx") - self.run(f"{bin_path} {ktx_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/ktx/all/test_package/etc1.ktx b/recipes/ktx/all/test_package/etc1.ktx deleted file mode 100644 index ff6f8186fd1db..0000000000000 Binary files a/recipes/ktx/all/test_package/etc1.ktx and /dev/null differ diff --git a/recipes/ktx/all/test_package/test_package.c b/recipes/ktx/all/test_package/test_package.c index f877690cdb0d6..ebd19452339ab 100644 --- a/recipes/ktx/all/test_package/test_package.c +++ b/recipes/ktx/all/test_package/test_package.c @@ -4,16 +4,12 @@ int main(int argc, char **argv) { - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return 1; - } - ktxTexture* texture; KTX_error_code result; - result = ktxTexture_CreateFromNamedFile(argv[1], + result = ktxTexture_CreateFromNamedFile("fake-file.ktx", KTX_TEXTURE_CREATE_LOAD_IMAGE_DATA_BIT, &texture); + printf("Test: %s\n", ktxErrorString(result)); return 0; } diff --git a/recipes/ktx/all/test_v1_package/conanfile.py b/recipes/ktx/all/test_v1_package/conanfile.py index d6484909910f3..38f4483872d47 100644 --- a/recipes/ktx/all/test_v1_package/conanfile.py +++ b/recipes/ktx/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - ktx_path = os.path.join(self.source_folder, os.pardir, "test_package", "etc1.ktx") - self.run(f"{bin_path} {ktx_path}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/ktx/config.yml b/recipes/ktx/config.yml index d2be8f453d7c0..6d8c546915dba 100644 --- a/recipes/ktx/config.yml +++ b/recipes/ktx/config.yml @@ -1,3 +1,5 @@ versions: + "4.3.2": + folder: all "4.0.0": folder: all diff --git a/recipes/kuba-zip/all/conandata.yml b/recipes/kuba-zip/all/conandata.yml index 707848aa88e1e..2c9419a46ca41 100644 --- a/recipes/kuba-zip/all/conandata.yml +++ b/recipes/kuba-zip/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.3.2": + url: "https://github.com/kuba--/zip/archive/v0.3.2.tar.gz" + sha256: "0c33740aec7a3913bca07df360420c19cac5e794e0f602f14f798cb2e6f710e5" "0.3.1": url: "https://github.com/kuba--/zip/archive/v0.3.1.tar.gz" sha256: "775b8a44b53e72a55c13839bf507219c2cf30b26f62e70f1a20bb727db54438f" diff --git a/recipes/kuba-zip/config.yml b/recipes/kuba-zip/config.yml index ab67eaba39ebb..b1201b1eaf043 100644 --- a/recipes/kuba-zip/config.yml +++ b/recipes/kuba-zip/config.yml @@ -1,4 +1,6 @@ versions: + "0.3.2": + folder: "all" "0.3.1": folder: "all" "0.3.0": diff --git a/recipes/kuliya/all/conandata.yml b/recipes/kuliya/all/conandata.yml new file mode 100644 index 0000000000000..06675980fd094 --- /dev/null +++ b/recipes/kuliya/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.0": + release: + url: "https://github.com/dzcode-io/kuliya/releases/download/c-v1.0.0/c-release.tar.gz" + sha256: "a0e064d29358e40245dc8b7b35160a6b15e10059e4bd42d9dc4f0af76d031e5f" + # Old versions don't have the license embed in the release tar, download it separatedly for now + # from the commit of the upstream tag + license: + url: "https://raw.githubusercontent.com/dzcode-io/kuliya/c-v1.0.0/LICENSE" + sha256: "70884fb7eff4f91c8d776f8cf7bd93cce0c93213f57153956189b488cfd911be" diff --git a/recipes/kuliya/all/conanfile.py b/recipes/kuliya/all/conanfile.py new file mode 100644 index 0000000000000..ad769bd5235f6 --- /dev/null +++ b/recipes/kuliya/all/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.files import copy, get, download +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class JsmnConan(ConanFile): + name = "kuliya" + description = "Algeria's college hierarchy dataset as a C library." + license = "MIT" + topics = ("dataset", "api", "dz", "header-only") + homepage = "https://github.com/dzcode-io/kuliya" + url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version]["release"], strip_root=True) + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE") + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "kuliya.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "data.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/kuliya/all/test_package/CMakeLists.txt b/recipes/kuliya/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6ca62a693d64a --- /dev/null +++ b/recipes/kuliya/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(kuliya REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE kuliya::kuliya) diff --git a/recipes/xz_utils/cmake/test_package/conanfile.py b/recipes/kuliya/all/test_package/conanfile.py similarity index 100% rename from recipes/xz_utils/cmake/test_package/conanfile.py rename to recipes/kuliya/all/test_package/conanfile.py diff --git a/recipes/kuliya/all/test_package/test_package.c b/recipes/kuliya/all/test_package/test_package.c new file mode 100644 index 0000000000000..5e3b275cf2747 --- /dev/null +++ b/recipes/kuliya/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#undef NDEBUG + +#include +#include +#include + +int main() +{ + kuliya_init(); + kuliya_schema *res = get_node_by_path("umkb/fst"); + assert(strcmp(res->name.en, "Faculty of Science and Technology") == 0); + kuliya_deinit(); +} diff --git a/recipes/kuliya/config.yml b/recipes/kuliya/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/kuliya/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/laslib/all/test_package/CMakeLists.txt b/recipes/laslib/all/test_package/CMakeLists.txt index befc74c6fea6a..37bb2bb665c3c 100644 --- a/recipes/laslib/all/test_package/CMakeLists.txt +++ b/recipes/laslib/all/test_package/CMakeLists.txt @@ -5,11 +5,5 @@ find_package(laslib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -add_custom_command( - TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/test.laz - ${CMAKE_BINARY_DIR}/test.laz) - target_link_libraries(${PROJECT_NAME} PRIVATE laslib::laslib) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/laslib/all/test_package/test.laz b/recipes/laslib/all/test_package/test.laz deleted file mode 100644 index 0fc46a30c39b6..0000000000000 Binary files a/recipes/laslib/all/test_package/test.laz and /dev/null differ diff --git a/recipes/laslib/all/test_package/test_package.cpp b/recipes/laslib/all/test_package/test_package.cpp index d25d430326ff1..39f06f0b590d3 100644 --- a/recipes/laslib/all/test_package/test_package.cpp +++ b/recipes/laslib/all/test_package/test_package.cpp @@ -4,10 +4,9 @@ int main(void) { LASreadOpener readOpener; - readOpener.set_file_name("test.laz"); - LASreader* lasreader = readOpener.open(); + readOpener.set_file_name("test_package.cpp"); - std::cout << "test.laz number of points : " << lasreader->header.number_of_point_records << std::endl; + std::cout << "Test: " << readOpener.active() << std::endl; return EXIT_SUCCESS; } diff --git a/recipes/laszip/all/conandata.yml b/recipes/laszip/all/conandata.yml index ec975a7f08b7b..8adc75c9b51ce 100644 --- a/recipes/laszip/all/conandata.yml +++ b/recipes/laszip/all/conandata.yml @@ -2,7 +2,16 @@ sources: "3.4.3": url: "https://github.com/LASzip/LASzip/releases/download/3.4.3/laszip-src-3.4.3.tar.bz2" sha256: "5775eb0b97de1b77514d47534cc65c6cfb5bebdd8aed0e47a23af8e75b7ea887" + "3.4.4": + url: "https://github.com/LASzip/LASzip/archive/refs/tags/3.4.4.tar.gz" + sha256: "6d034bf3a400f81317a5dbad59d1b7ce82d971e887ca22d15813b914f0a5c281" patches: "3.4.3": - patch_file: "patches/0001-no-build-laszip-api.patch" - patch_file: "patches/0002-no-rpath-and-relocatable-macos.patch" + "3.4.4": + - patch_file: "patches/0001-3.4.4-no-build-laszip-api.patch" + - patch_file: "patches/0002-3.4.4-no-rpath-and-relocatable-macos.patch" + - patch_file: "patches/0003-3.4.4-remove-cppstd-hardcode.patch" + patch_type: "conan" + patch_description: "Let Conan set the cppstd, instead of forcing it (In this version it's incorreclty set to C++17 instead of the supported C++14)" diff --git a/recipes/laszip/all/conanfile.py b/recipes/laszip/all/conanfile.py index a88e4d8aa5712..30e72169c7cd5 100644 --- a/recipes/laszip/all/conanfile.py +++ b/recipes/laszip/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import stdcpp_library +from conan.tools.build import stdcpp_library, check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get from conan.tools.scm import Version @@ -27,6 +27,10 @@ class LaszipConan(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return 14 + def export_sources(self): export_conandata_patches(self) @@ -35,8 +39,14 @@ def config_options(self): del self.options.fPIC def configure(self): + if Version(self.version) >= "3.4.4": + self.license = "Apache-2.0" if self.options.shared: self.options.rm_safe("fPIC") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/laszip/all/patches/0001-3.4.4-no-build-laszip-api.patch b/recipes/laszip/all/patches/0001-3.4.4-no-build-laszip-api.patch new file mode 100644 index 0000000000000..8e99797f7ecb7 --- /dev/null +++ b/recipes/laszip/all/patches/0001-3.4.4-no-build-laszip-api.patch @@ -0,0 +1,8 @@ +--- a/dll/CMakeLists.txt ++++ b/dll/CMakeLists.txt +@@ -2,5 +2,4 @@ set(LASZIP_API_SOURCES + laszip_api.c + ) + +-LASZIP_ADD_LIBRARY(${LASZIP_API_LIB_NAME} ${LASZIP_API_SOURCES}) + LASZIP_ADD_INCLUDES("laszip" "${CMAKE_CURRENT_SOURCE_DIR}/laszip_api.h" ${LASZIP_API_VERSION_H}) diff --git a/recipes/laszip/all/patches/0002-3.4.4-no-rpath-and-relocatable-macos.patch b/recipes/laszip/all/patches/0002-3.4.4-no-rpath-and-relocatable-macos.patch new file mode 100644 index 0000000000000..5aa1f83f0fd18 --- /dev/null +++ b/recipes/laszip/all/patches/0002-3.4.4-no-rpath-and-relocatable-macos.patch @@ -0,0 +1,29 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -81,15 +81,11 @@ file(MAKE_DIRECTORY "${LASZIP_OUTPUT_BIN_DIR}") + # per http://www.cmake.org/Wiki/CMake_RPATH_handling + SET(CMAKE_SKIP_BUILD_RPATH FALSE) + SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) +-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + IF (APPLE) + SET(MACOSX_RPATH ON) + endif() + LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/${LASZIP_LIB_INSTALL_DIR}" isSystemDir) +-IF("${isSystemDir}" STREQUAL "-1") +- SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LASZIP_LIB_INSTALL_DIR}") +-ENDIF("${isSystemDir}" STREQUAL "-1") + + # wipe lib/ drectory on clean. It will have plugins that could be out of date + # in the next build +--- a/cmake/macros.cmake ++++ b/cmake/macros.cmake +@@ -71,8 +71,6 @@ macro(LASZIP_ADD_LIBRARY _name) + LIBRARY DESTINATION ${LASZIP_LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LASZIP_LIB_INSTALL_DIR}) + if (APPLE) +- set_target_properties(${_name} PROPERTIES INSTALL_NAME_DIR +- "@executable_path/../lib") + endif() + endmacro(LASZIP_ADD_LIBRARY) + diff --git a/recipes/laszip/all/patches/0003-3.4.4-remove-cppstd-hardcode.patch b/recipes/laszip/all/patches/0003-3.4.4-remove-cppstd-hardcode.patch new file mode 100644 index 0000000000000..1dbe071adbbce --- /dev/null +++ b/recipes/laszip/all/patches/0003-3.4.4-remove-cppstd-hardcode.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4b0a02b..a9cc6b5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,6 @@ + cmake_minimum_required(VERSION 3.10) + + project(LASZIP CXX C) +-set(CMAKE_CXX_STANDARD 17) + string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) + + set(ROOT_DIR "${PROJECT_SOURCE_DIR}") diff --git a/recipes/laszip/config.yml b/recipes/laszip/config.yml index 0d0a2f21c9983..a2d2267e94e46 100644 --- a/recipes/laszip/config.yml +++ b/recipes/laszip/config.yml @@ -1,3 +1,5 @@ versions: + "3.4.4": + folder: all "3.4.3": folder: all diff --git a/recipes/lely-core/all/conandata.yml b/recipes/lely-core/all/conandata.yml index 365fdf916f614..a02c4e51288f2 100644 --- a/recipes/lely-core/all/conandata.yml +++ b/recipes/lely-core/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.4": + url: "https://gitlab.com/lely_industries/lely-core/-/archive/v2.3.4/lely-core-v2.3.4.tar.gz" + sha256: "6f31b4fd7ea6aafb1a62b9d956a12a900386564859099e97af1c6bd1d10bdaf2" "2.3.3": url: "https://gitlab.com/lely_industries/lely-core/-/archive/v2.3.3/lely-core-v2.3.3.tar.gz" sha256: "6d0810f9e835543f0aeb5f86dcdc7a24578041f5d0a714bf5a14db2cb24ce373" diff --git a/recipes/lely-core/all/conanfile.py b/recipes/lely-core/all/conanfile.py index 9ed8f191a0a19..7e88aacc94143 100644 --- a/recipes/lely-core/all/conanfile.py +++ b/recipes/lely-core/all/conanfile.py @@ -12,13 +12,18 @@ class LelyConan(ConanFile): name = "lely-core" + description = ( + "The Lely core libraries are a collection of C and C++ libraries and tools, " + "providing high-performance I/O and sensor/actuator control for robotics and IoT applications. " + "The libraries are cross-platform and have few dependencies. " + "They can be even be used on bare-metal microcontrollers with as little as 32 kB RAM." + ) license = "Apache-2.0" - homepage = "https://gitlab.com/lely_industries/lely-core/" url = "https://github.com/conan-io/conan-center-index" - description = "The Lely core libraries are a collection of C and C++ libraries and tools, providing high-performance I/O and sensor/actuator control for robotics and IoT applications. The libraries are cross-platform and have few dependencies. They can be even be used on bare-metal microcontrollers with as little as 32 kB RAM." + homepage = "https://gitlab.com/lely_industries/lely-core/" topics = ("canopen",) package_type = "library" - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], diff --git a/recipes/lely-core/all/test_package/CMakeLists.txt b/recipes/lely-core/all/test_package/CMakeLists.txt index c8be0aec2f07e..f6bd04d2f5aad 100644 --- a/recipes/lely-core/all/test_package/CMakeLists.txt +++ b/recipes/lely-core/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.2) -project(test_package) +project(test_package LANGUAGES CXX) find_package(lely-core REQUIRED) diff --git a/recipes/lely-core/config.yml b/recipes/lely-core/config.yml index 5ca4acfdc4f7b..e8d99700ff1a0 100644 --- a/recipes/lely-core/config.yml +++ b/recipes/lely-core/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.4": + folder: all "2.3.3": folder: all "2.3.2": diff --git a/recipes/leopard/all/conandata.yml b/recipes/leopard/all/conandata.yml new file mode 100644 index 0000000000000..293257cff4fed --- /dev/null +++ b/recipes/leopard/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.1.0": + url: "https://github.com/hosseinmoein/Leopard/archive/refs/tags/2.1.0.tar.gz" + sha256: "26b57fdea4cd94ddbc34a478e978632637cde2fc263bdf2d6bdfd3e9ddd0b1d5" + "2.0.0": + url: "https://github.com/hosseinmoein/Leopard/archive/refs/tags/2.0.0.tar.gz" + sha256: "c24ac5d2555c4496f26662925061a52ae1b2265ae9fc91b0cce19d1647d62699" diff --git a/recipes/leopard/all/conanfile.py b/recipes/leopard/all/conanfile.py new file mode 100644 index 0000000000000..f2a3c9d555477 --- /dev/null +++ b/recipes/leopard/all/conanfile.py @@ -0,0 +1,80 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.52.0" + + +class LeopardConan(ConanFile): + name = "leopard" + description = "C++ light-weight Thread Pool library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hosseinmoein/Leopard" + topics = ("async", "concurrency", "multithreading", "threadpool", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "apple-clang": "14", + "Visual Studio": "16", + "msvc": "192", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, pattern="License", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + copy( + self, + pattern="*.tcc", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "ThreadPool") + self.cpp_info.set_property("cmake_target_name", "ThreadPool::ThreadPool") + self.cpp_info.set_property("pkg_config_name", "ThreadPool") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "dl", "m"]) diff --git a/recipes/leopard/all/test_package/CMakeLists.txt b/recipes/leopard/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ea0b1b09a817d --- /dev/null +++ b/recipes/leopard/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ThreadPool REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ThreadPool::ThreadPool) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) + +if(ThreadPool_VERSION VERSION_LESS 2.1.0) + target_compile_definitions(${PROJECT_NAME} PRIVATE "THREADPOOL_LESS_2_1_0") +endif() diff --git a/recipes/leopard/all/test_package/conanfile.py b/recipes/leopard/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/leopard/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/leopard/all/test_package/test_package.cpp b/recipes/leopard/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..abf2d43498e45 --- /dev/null +++ b/recipes/leopard/all/test_package/test_package.cpp @@ -0,0 +1,69 @@ +#ifdef THREADPOOL_LESS_2_1_0 +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace hmthrp; + +// ---------------------------------------------------------------------------- + +static constexpr std::size_t THREAD_COUNT = 5; + +// ---------------------------------------------------------------------------- + +static void parallel_accumulate() { + + std::cout << "Running parallel_accumulate() ..." << std::endl; + + constexpr std::size_t n { 10003 }; + constexpr std::size_t the_sum { (n * (n + 1)) / 2 }; + std::vector vec (n); + + std::iota(vec.begin(), vec.end(), 1); + + constexpr std::size_t block_size { n / THREAD_COUNT }; + std::vector> futs; + auto block_start = vec.begin(); + ThreadPool thr_pool { THREAD_COUNT }; + + futs.reserve(THREAD_COUNT - 1); + for (std::size_t i = 0; i < (THREAD_COUNT - 1); ++i) { + const auto block_end { block_start + block_size }; + + futs.push_back( + thr_pool.dispatch( + false, + std::accumulate, + block_start, block_end, 0)); + block_start = block_end; + } + + // Last result + // + std::size_t result { std::accumulate(block_start, vec.end(), 0UL) }; + + for (std::size_t i = 0; i < futs.size(); ++i) + result += futs[i].get(); + + assert(result == the_sum); + return; +} + +// ---------------------------------------------------------------------------- + +int main (int, char *[]) { + + parallel_accumulate(); + + return (EXIT_SUCCESS); +} diff --git a/recipes/leopard/config.yml b/recipes/leopard/config.yml new file mode 100644 index 0000000000000..2d136f3fe768d --- /dev/null +++ b/recipes/leopard/config.yml @@ -0,0 +1,5 @@ +versions: + "2.1.0": + folder: all + "2.0.0": + folder: all diff --git a/recipes/leptonica/all/conandata.yml b/recipes/leptonica/all/conandata.yml index 49782e81d8fcd..7c713eeaa4311 100644 --- a/recipes/leptonica/all/conandata.yml +++ b/recipes/leptonica/all/conandata.yml @@ -2,27 +2,9 @@ sources: "1.83.1": url: "https://github.com/DanBloomberg/leptonica/archive/1.83.1.tar.gz" sha256: "4289d0a4224b614010072253531c0455a33a4d7c7a0017fe7825ed382290c0da" - "1.83.0": - url: "https://github.com/DanBloomberg/leptonica/archive/1.83.0.tar.gz" - sha256: "14cf531c2219a1414e8e3c51a3caa5cf021a52e782c4a6561bf64d0ef2119282" "1.82.0": url: "https://github.com/DanBloomberg/leptonica/archive/1.82.0.tar.gz" sha256: "40fa9ac1e815b91e0fa73f0737e60c9eec433a95fa123f95f2573dd3127dd669" "1.81.0": url: "https://github.com/DanBloomberg/leptonica/archive/1.81.0.tar.gz" sha256: "70ebc04ff8b9684205bd1d01843c635a8521255b74813bf7cce9a33368f7952c" - "1.80.0": - url: "https://github.com/DanBloomberg/leptonica/archive/1.80.0.tar.gz" - sha256: "3952b974ec057d24267aae48c54bca68ead8275604bf084a73a4b953ff79196e" - "1.79.0": - url: "https://github.com/DanBloomberg/leptonica/archive/1.79.0.tar.gz" - sha256: "bf9716f91a4844c2682a07ef21eaf68b6f1077af1f63f27c438394fd66218e17" - "1.78.0": - url: "https://github.com/DanBloomberg/leptonica/archive/1.78.0.tar.gz" - sha256: "f8ac4d93cc76b524c2c81d27850bfc342e68b91368aa7a1f7d69e34ce13adbb4" -patches: - "1.78.0": - - patch_file: "patches/fix-find-modules-variables.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "portability" - patch_source: "https://github.com/DanBloomberg/leptonica/pull/456" diff --git a/recipes/leptonica/all/conanfile.py b/recipes/leptonica/all/conanfile.py index 6bcb75d8840d6..a937905bbcab5 100644 --- a/recipes/leptonica/all/conanfile.py +++ b/recipes/leptonica/all/conanfile.py @@ -72,15 +72,15 @@ def requirements(self): if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/3.0.1") + self.requires("libjpeg-turbo/3.0.2") elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.5") if self.options.with_png: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_tiff: self.requires("libtiff/4.6.0") if self.options.with_openjpeg: - self.requires("openjpeg/2.5.0") + self.requires("openjpeg/2.5.2") if self.options.with_webp: self.requires("libwebp/1.3.2") @@ -94,8 +94,6 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - if Version(self.version) < "1.79.0": - tc.variables["STATIC"] = not self.options.shared tc.variables["BUILD_PROG"] = False tc.variables["SW_BUILD"] = False if Version(self.version) >= "1.83.0": @@ -128,44 +126,29 @@ def _patch_sources(self): replace_in_file(self, cmakelists_src, "${GIF_LIBRARIES}", "GIF::GIF") if not self.options.with_gif: replace_in_file(self, cmakelists_src, "if (GIF_LIBRARIES)", "if(0)") - if Version(self.version) >= "1.83.0": - replace_in_file(self, cmake_configure, "if(GIF_FOUND)", "if(0)") - else: - replace_in_file(self, cmake_configure, "if (GIF_FOUND)", "if(0)") + replace_in_file(self, cmake_configure, "if (GIF_FOUND)", "if(0)") ## libjpeg replace_in_file(self, cmakelists_src, "${JPEG_LIBRARIES}", "JPEG::JPEG") if not self.options.with_jpeg: replace_in_file(self, cmakelists_src, "if (JPEG_LIBRARIES)", "if(0)") - if Version(self.version) >= "1.83.0": - replace_in_file(self, cmake_configure, "if(JPEG_FOUND)", "if(0)") - else: - replace_in_file(self, cmake_configure, "if (JPEG_FOUND)", "if(0)") + replace_in_file(self, cmake_configure, "if (JPEG_FOUND)", "if(0)") ## libpng replace_in_file(self, cmakelists_src, "${PNG_LIBRARIES}", "PNG::PNG") if not self.options.with_png: replace_in_file(self, cmakelists_src, "if (PNG_LIBRARIES)", "if(0)") - if Version(self.version) >= "1.83.0": - replace_in_file(self, cmake_configure, "if(PNG_FOUND)", "if(0)") - else: - replace_in_file(self, cmake_configure, "if (PNG_FOUND)", "if(0)") + replace_in_file(self, cmake_configure, "if (PNG_FOUND)", "if(0)") ## libtiff replace_in_file(self, cmakelists_src, "${TIFF_LIBRARIES}", "TIFF::TIFF") if not self.options.with_tiff: replace_in_file(self, cmakelists_src, "if (TIFF_LIBRARIES)", "if(0)") - if Version(self.version) >= "1.83.0": - replace_in_file(self, cmake_configure, "if(TIFF_FOUND)", "if(0)") - else: - replace_in_file(self, cmake_configure, "if (TIFF_FOUND)", "if(0)") + replace_in_file(self, cmake_configure, "if (TIFF_FOUND)", "if(0)") ## We have to be more aggressive with dependencies found with pkgconfig ## Injection of libdirs is ensured by conan_basic_setup() ## openjpeg replace_in_file(self, cmakelists_src, "${JP2K_LIBRARIES}", "openjp2") if Version(self.version) < "1.83.0": # pkgconfig is prefered to CMake. Disable pkgconfig so only CMake is used - if Version(self.version) <= "1.78.0": - replace_in_file(self, cmakelists, "pkg_check_modules(JP2K libopenjp2)", "") - else: - replace_in_file(self, cmakelists, "pkg_check_modules(JP2K libopenjp2>=2.0 QUIET)", "") + replace_in_file(self, cmakelists, "pkg_check_modules(JP2K libopenjp2>=2.0 QUIET)", "") # versions below 1.83.0 do not have an option toggle replace_in_file(self, cmakelists, "if(NOT JP2K)", "if(0)") if not self.options.with_openjpeg: @@ -174,22 +157,22 @@ def _patch_sources(self): else: replace_in_file(self, cmakelists, "set(JP2K_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIRS})", "set(JP2K_INCLUDE_DIRS ${OpenJPEG_INCLUDE_DIRS})") if not self.options.with_openjpeg: - replace_in_file(self, cmake_configure, "if(JP2K_FOUND)", "if(0)") + replace_in_file(self, cmake_configure, "if (JP2K_FOUND)", "if(0)") ## libwebp if Version(self.version) < "1.83.0": # versions below 1.83.0 do not have an option toggle replace_in_file(self, cmakelists, "if(NOT WEBP)", "if(0)") - if Version(self.version) >= "1.79.0": - replace_in_file(self, cmakelists, "if(NOT WEBPMUX)", "if(0)") + replace_in_file(self, cmakelists, "if(NOT WEBPMUX)", "if(0)") if not self.options.with_webp: replace_in_file(self, cmakelists_src, "if (WEBP_FOUND)", "if(0)") replace_in_file(self, cmake_configure, "if (WEBP_FOUND)", "if(0)") - replace_in_file(self, cmakelists_src, - "if (WEBP_FOUND)", - "if (WEBP_FOUND)\n" - "target_link_directories(leptonica PRIVATE ${WEBP_LIBRARY_DIRS} ${WEBPMUX_LIBRARY_DIRS})\n" - "target_compile_definitions(leptonica PRIVATE ${WEBP_CFLAGS_OTHER} ${WEBPMUX_CFLAGS_OTHER})") + if Version(self.version) >= "1.83.0" or self.options.with_webp: + replace_in_file(self, cmakelists_src, + "if (WEBP_FOUND)", + "if (WEBP_FOUND)\n" + "target_link_directories(leptonica PRIVATE ${WEBP_LIBRARY_DIRS} ${WEBPMUX_LIBRARY_DIRS})\n" + "target_compile_definitions(leptonica PRIVATE ${WEBP_CFLAGS_OTHER} ${WEBPMUX_CFLAGS_OTHER})") replace_in_file(self, cmakelists_src, "${WEBP_LIBRARIES}", "${WEBP_LIBRARIES} ${WEBPMUX_LIBRARIES}") # Remove detection of fmemopen() on macOS < 10.13 diff --git a/recipes/leptonica/all/patches/fix-find-modules-variables.patch b/recipes/leptonica/all/patches/fix-find-modules-variables.patch deleted file mode 100644 index 3dc86df7e707e..0000000000000 --- a/recipes/leptonica/all/patches/fix-find-modules-variables.patch +++ /dev/null @@ -1,48 +0,0 @@ -see https://github.com/DanBloomberg/leptonica/pull/456 - ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -31,33 +31,33 @@ if (NOT STATIC) - target_compile_definitions (leptonica PRIVATE -DLIBLEPT_EXPORTS) - endif() - --if (GIF_LIBRARY) -+if (GIF_LIBRARIES) - target_include_directories (leptonica PUBLIC ${GIF_INCLUDE_DIR}) -- target_link_libraries (leptonica ${GIF_LIBRARY}) -+ target_link_libraries (leptonica ${GIF_LIBRARIES}) - endif() --if (JPEG_LIBRARY) -+if (JPEG_LIBRARIES) - target_include_directories (leptonica PUBLIC ${JPEG_INCLUDE_DIR}) -- target_link_libraries (leptonica ${JPEG_LIBRARY}) -+ target_link_libraries (leptonica ${JPEG_LIBRARIES}) - endif() - if (JP2K_FOUND) - target_include_directories (leptonica PUBLIC ${JP2K_INCLUDE_DIRS}) - target_link_libraries (leptonica ${JP2K_LIBRARIES}) - endif() --if (PNG_LIBRARY) -+if (PNG_LIBRARIES) - target_include_directories (leptonica PUBLIC ${PNG_INCLUDE_DIRS}) -- target_link_libraries (leptonica ${PNG_LIBRARY}) -+ target_link_libraries (leptonica ${PNG_LIBRARIES}) - endif() --if (TIFF_LIBRARY) -+if (TIFF_LIBRARIES) - target_include_directories (leptonica PUBLIC ${TIFF_INCLUDE_DIR}) -- target_link_libraries (leptonica ${TIFF_LIBRARY}) -+ target_link_libraries (leptonica ${TIFF_LIBRARIES}) - endif() - if (WEBP_FOUND) - target_include_directories (leptonica PUBLIC ${WEBP_INCLUDE_DIRS}) - target_link_libraries (leptonica ${WEBP_LIBRARIES}) - endif() --if (ZLIB_LIBRARY) -+if (ZLIB_LIBRARIES) - target_include_directories (leptonica PUBLIC ${ZLIB_INCLUDE_DIR}) -- target_link_libraries (leptonica ${ZLIB_LIBRARY}) -+ target_link_libraries (leptonica ${ZLIB_LIBRARIES}) - endif() - - if (UNIX) diff --git a/recipes/leptonica/config.yml b/recipes/leptonica/config.yml index 7de53a77a3916..38d6d07fba4c6 100644 --- a/recipes/leptonica/config.yml +++ b/recipes/leptonica/config.yml @@ -1,15 +1,7 @@ versions: "1.83.1": folder: all - "1.83.0": - folder: all "1.82.0": folder: all "1.81.0": folder: all - "1.80.0": - folder: all - "1.79.0": - folder: all - "1.78.0": - folder: all diff --git a/recipes/lest/all/conandata.yml b/recipes/lest/all/conandata.yml index 0c06b134376db..e910aac388249 100644 --- a/recipes/lest/all/conandata.yml +++ b/recipes/lest/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.35.2": + url: "https://github.com/martinmoene/lest/archive/v1.35.2.tar.gz" + sha256: "570031345d703587c4984b1fa918e611693735beeb37a6d889d234599b73c670" "1.35.1": url: "https://github.com/martinmoene/lest/archive/v1.35.1.tar.gz" sha256: "ca715833563f983c81d86623c2d1911d7a2aa04ce00459b0f3794a8e441265e0" diff --git a/recipes/lest/all/test_package/CMakeLists.txt b/recipes/lest/all/test_package/CMakeLists.txt index 5d9ebbc9ca6a1..7c83263783aaf 100644 --- a/recipes/lest/all/test_package/CMakeLists.txt +++ b/recipes/lest/all/test_package/CMakeLists.txt @@ -5,4 +5,3 @@ find_package(lest REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) 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/test_package.cpp b/recipes/lest/all/test_package/test_package.cpp index 7b3f62f3908f8..e161263ae0bc7 100644 --- a/recipes/lest/all/test_package/test_package.cpp +++ b/recipes/lest/all/test_package/test_package.cpp @@ -1,14 +1,16 @@ -#include "lest/lest.hpp" +#include "lest/lest_cpp03.hpp" +#define CASE( name ) lest_CASE( specification, name ) -const lest::test specification[] = +using namespace lest; + +test_specification specification; + +CASE( "Comment converted to bool indicates absence or presence of comment" ) { - CASE( "Empty string has length zero (succeed)" ) - { - EXPECT( 0 == std::string( ).length() ); - EXPECT( 0 == std::string("").length() ); - }, -}; + EXPECT( false == bool( comment( "") ) ); + EXPECT( true == bool( comment("x") ) ); +} int main( int argc, char * argv[] ) { diff --git a/recipes/lest/config.yml b/recipes/lest/config.yml index 1e86bc3f93bdf..d5f65df0bf534 100644 --- a/recipes/lest/config.yml +++ b/recipes/lest/config.yml @@ -1,3 +1,5 @@ versions: + "1.35.2": + folder: all "1.35.1": folder: all diff --git a/recipes/libarchive/all/conandata.yml b/recipes/libarchive/all/conandata.yml index b08c943036aa4..452c9bd049c22 100644 --- a/recipes/libarchive/all/conandata.yml +++ b/recipes/libarchive/all/conandata.yml @@ -1,123 +1,70 @@ sources: + "3.7.4": + url: "https://github.com/libarchive/libarchive/releases/download/v3.7.4/libarchive-3.7.4.tar.xz" + sha256: "f887755c434a736a609cbd28d87ddbfbe9d6a3bb5b703c22c02f6af80a802735" + "3.7.3": + url: "https://github.com/libarchive/libarchive/releases/download/v3.7.3/libarchive-3.7.3.tar.xz" + sha256: "63e7a7174638fc7d6b79b4c8b0ad954e0f4f45abe7239c1ecb200232aa9a43d2" "3.7.2": url: "https://github.com/libarchive/libarchive/releases/download/v3.7.2/libarchive-3.7.2.tar.xz" sha256: "04357661e6717b6941682cde02ad741ae4819c67a260593dfb2431861b251acb" "3.7.1": url: "https://github.com/libarchive/libarchive/releases/download/v3.7.1/libarchive-3.7.1.tar.xz" sha256: "b17403ce670ff18d8e06fea05a9ea9accf70678c88f1b9392a2e29b51127895f" - "3.6.2": - url: "https://github.com/libarchive/libarchive/releases/download/v3.6.2/libarchive-3.6.2.tar.xz" - sha256: "9e2c1b80d5fbe59b61308fdfab6c79b5021d7ff4ff2489fb12daf0a96a83551d" - "3.6.1": - url: "https://github.com/libarchive/libarchive/releases/download/v3.6.1/libarchive-3.6.1.tar.xz" - sha256: "5a411aceb978f43e626f0c2d1812ddd8807b645ed892453acabd532376c148e6" - "3.6.0": - url: "https://github.com/libarchive/libarchive/releases/download/v3.6.0/libarchive-3.6.0.tar.xz" - sha256: "df283917799cb88659a5b33c0a598f04352d61936abcd8a48fe7b64e74950de7" - "3.5.2": - url: "https://github.com/libarchive/libarchive/releases/download/v3.5.2/libarchive-3.5.2.tar.xz" - sha256: "f0b19ff39c3c9a5898a219497ababbadab99d8178acc980155c7e1271089b5a0" - "3.5.1": - url: "https://github.com/libarchive/libarchive/releases/download/v3.5.1/libarchive-3.5.1.tar.xz" - sha256: "0e17d3a8d0b206018693b27f08029b598f6ef03600c2b5d10c94ce58692e299b" - "3.4.3": - url: "https://github.com/libarchive/libarchive/releases/download/v3.4.3/libarchive-3.4.3.tar.xz" - sha256: "0bfc3fd40491768a88af8d9b86bf04a9e95b6d41a94f9292dbc0ec342288c05f" - "3.4.0": - url: "https://github.com/libarchive/libarchive/releases/download/v3.4.0/libarchive-3.4.0.tar.gz" - sha256: "8643d50ed40c759f5412a3af4e353cffbce4fdf3b5cf321cb72cacf06b2d825e" patches: - "3.7.2": - - patch_file: "patches/0001-3.7.2-zlib-winapi.patch" + "3.7.4": + - patch_file: "patches/0001-3.7.4-zlib-winapi.patch" patch_description: "Remove broken ZLIB WINAPI check" patch_type: "portability" - - patch_file: "patches/0003-3.7.1-cmake.patch" + - patch_file: "patches/0003-3.7.4-cmake.patch" patch_description: "Make CMake build-system compatible with Conan" patch_type: "conan" - - patch_file: "patches/0005-3.7.1-try-compile-cmakedeps.patch" + - patch_file: "patches/0005-3.7.4-try-compile-cmakedeps.patch" patch_description: "Patch try_compile check to work with imported CMake targets from Conan packages" patch_type: "conan" - - patch_file: "patches/0006-3.7.1-fix-msvc-build.patch" + - patch_file: "patches/0006-3.7.4-fix-msvc-build.patch" patch_description: "Fix MSVC build" patch_type: "conan" - "3.7.1": - - patch_file: "patches/0007-3.7.1-include-getopt.patch" - patch_description: "include getopt.h if HAVE_GETOPT_OPTRESET is defined" - patch_type: "portability" - patch_source: "https://github.com/libarchive/libarchive/pull/2007" - - patch_file: "patches/0001-3.7.1-zlib-winapi.patch" + "3.7.3": + - patch_file: "patches/0001-3.7.3-zlib-winapi.patch" patch_description: "Remove broken ZLIB WINAPI check" patch_type: "portability" - - patch_file: "patches/0003-3.7.1-cmake.patch" + - patch_file: "patches/0003-3.7.3-cmake.patch" patch_description: "Make CMake build-system compatible with Conan" patch_type: "conan" - - patch_file: "patches/0005-3.7.1-try-compile-cmakedeps.patch" + - patch_file: "patches/0005-3.7.3-try-compile-cmakedeps.patch" patch_description: "Patch try_compile check to work with imported CMake targets from Conan packages" patch_type: "conan" - - patch_file: "patches/0006-3.7.1-fix-msvc-build.patch" + - patch_file: "patches/0006-3.7.3-fix-msvc-build.patch" patch_description: "Fix MSVC build" patch_type: "conan" - "3.6.2": - - patch_file: "patches/0001-3.6.2-zlib-winapi.patch" + "3.7.2": + - patch_file: "patches/0001-3.7.2-zlib-winapi.patch" patch_description: "Remove broken ZLIB WINAPI check" patch_type: "portability" - - patch_file: "patches/0003-3.6.2-cmake.patch" + - patch_file: "patches/0003-3.7.1-cmake.patch" patch_description: "Make CMake build-system compatible with Conan" patch_type: "conan" - - patch_file: "patches/0005-3.6.2-try-compile-cmakedeps.patch" + - patch_file: "patches/0005-3.7.1-try-compile-cmakedeps.patch" patch_description: "Patch try_compile check to work with imported CMake targets from Conan packages" patch_type: "conan" - - patch_file: "patches/0006-3.6.2-fix-msvc-build.patch" + - patch_file: "patches/0006-3.7.1-fix-msvc-build.patch" patch_description: "Fix MSVC build" patch_type: "conan" - "3.6.1": - - patch_file: "patches/0001-3.6.0-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" - patch_type: "portability" - - patch_file: "patches/0003-3.6.0-cmake.patch" - patch_description: "Make CMake build-system compatible with Conan" - patch_type: "conan" - - patch_file: "patches/0004-3.6.0-android.patch" - patch_description: "Add missing include directory for Android" - patch_type: "portability" - "3.6.0": - - patch_file: "patches/0001-3.6.0-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" - patch_type: "portability" - - patch_file: "patches/0003-3.6.0-cmake.patch" - patch_description: "Make CMake cooperate with Conan" - patch_type: "conan" - - patch_file: "patches/0004-3.6.0-android.patch" - patch_description: "Add missing include directory for Android" - patch_type: "portability" - "3.5.2": - - patch_file: "patches/0001-3.4.3-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" + "3.7.1": + - patch_file: "patches/0007-3.7.1-include-getopt.patch" + patch_description: "include getopt.h if HAVE_GETOPT_OPTRESET is defined" patch_type: "portability" - - patch_file: "patches/0003-3.5.2-cmake.patch" - patch_description: "Make CMake cooperate with Conan" - patch_type: "conan" - "3.5.1": - - patch_file: "patches/0001-3.4.3-zlib-winapi.patch" + patch_source: "https://github.com/libarchive/libarchive/pull/2007" + - patch_file: "patches/0001-3.7.1-zlib-winapi.patch" patch_description: "Remove broken ZLIB WINAPI check" patch_type: "portability" - - patch_file: "patches/0003-3.5.1-cmake.patch" - patch_description: "Make CMake cooperate with Conan" + - patch_file: "patches/0003-3.7.1-cmake.patch" + patch_description: "Make CMake build-system compatible with Conan" patch_type: "conan" - "3.4.3": - - patch_file: "patches/0001-3.4.3-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" - patch_type: "portability" - - patch_file: "patches/0003-3.4.3-cmake.patch" - patch_description: "Make CMake cooperate with Conan" + - patch_file: "patches/0005-3.7.1-try-compile-cmakedeps.patch" + patch_description: "Patch try_compile check to work with imported CMake targets from Conan packages" patch_type: "conan" - "3.4.0": - - patch_file: "patches/0001-3.4.0-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" - patch_type: "portability" - - patch_file: "patches/0002-3.4.0-msvc-no-we4061.patch" - patch_description: "Remove MSVC compiler warning e4061" - patch_type: "portability" - - patch_file: "patches/0003-3.4.0-cmake.patch" - patch_description: "Make CMake cooperate with Conan" + - patch_file: "patches/0006-3.7.1-fix-msvc-build.patch" + patch_description: "Fix MSVC build" patch_type: "conan" diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index 2f2b32fea9625..c68aabe657d31 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -38,6 +38,7 @@ class LibarchiveConan(ConanFile): "with_zstd": [True, False], "with_mbedtls": [True, False], "with_xattr": [True, False], + "with_pcre2": [True, False], } default_options = { "shared": False, @@ -59,6 +60,7 @@ class LibarchiveConan(ConanFile): "with_zstd": False, "with_mbedtls": False, "with_xattr": False, + "with_pcre2": False, } def export_sources(self): @@ -67,8 +69,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if Version(self.version) < "3.4.2": - del self.options.with_mbedtls + if Version(self.version) < "3.7.3": + del self.options.with_pcre2 def configure(self): if self.options.shared: @@ -85,9 +87,9 @@ def requirements(self): if self.options.with_bzip2: self.requires("bzip2/1.0.8") if self.options.with_libxml2: - self.requires("libxml2/2.12.3") + self.requires("libxml2/[>=2.12.5 <3]") if self.options.with_expat: - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.with_iconv: self.requires("libiconv/1.17") if self.options.with_pcreposix: @@ -108,6 +110,8 @@ def requirements(self): self.requires("zstd/1.5.5") if self.options.get_safe("with_mbedtls"): self.requires("mbedtls/3.5.1") + if self.options.get_safe("with_pcre2"): + self.requires("pcre2/10.43") def validate(self): if self.settings.os != "Windows" and self.options.with_cng: @@ -152,8 +156,9 @@ def generate(self): tc.variables["ENABLE_UNZIP"] = False # too strict check tc.variables["ENABLE_WERROR"] = False - if Version(self.version) >= "3.4.2": - tc.variables["ENABLE_MBEDTLS"] = self.options.with_mbedtls + tc.variables["ENABLE_MBEDTLS"] = self.options.with_mbedtls + if Version(self.version) >= "3.7.3": + tc.variables["ENABLE_PCRE2POSIX"] = self.options.with_pcre2 tc.variables["ENABLE_XATTR"] = self.options.with_xattr # TODO: Remove after fixing https://github.com/conan-io/conan/issues/12012 if is_msvc(self): diff --git a/recipes/libarchive/all/patches/0001-3.4.0-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.4.0-zlib-winapi.patch deleted file mode 100644 index 5acce6e86c2cd..0000000000000 --- a/recipes/libarchive/all/patches/0001-3.4.0-zlib-winapi.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4fd93d04..922efd15 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -415,14 +415,7 @@ IF(ZLIB_FOUND) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) - LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) - IF(WIN32 AND NOT CYGWIN) -- # -- # Test if ZLIB_WINAPI macro is needed to use. -- # -- TRY_MACRO_FOR_LIBRARY( -- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" -- RUNS -- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" -- ZLIB_WINAPI) -+ set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) - ADD_DEFINITIONS(-DZLIB_WINAPI) - ELSE(ZLIB_WINAPI) diff --git a/recipes/libarchive/all/patches/0001-3.4.3-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.4.3-zlib-winapi.patch deleted file mode 100644 index b0d70de9dec3b..0000000000000 --- a/recipes/libarchive/all/patches/0001-3.4.3-zlib-winapi.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6b00410c..e0359b51 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -420,14 +420,7 @@ IF(ZLIB_FOUND) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) - LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) - IF(WIN32 AND NOT CYGWIN) -- # -- # Test if ZLIB_WINAPI macro is needed to use. -- # -- TRY_MACRO_FOR_LIBRARY( -- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" -- RUNS -- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" -- ZLIB_WINAPI) -+ set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) - ADD_DEFINITIONS(-DZLIB_WINAPI) - ELSE(ZLIB_WINAPI) diff --git a/recipes/libarchive/all/patches/0001-3.6.0-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.6.0-zlib-winapi.patch deleted file mode 100644 index dceed2848f701..0000000000000 --- a/recipes/libarchive/all/patches/0001-3.6.0-zlib-winapi.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7a0d300a..646e5ce7 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -426,14 +426,7 @@ IF(ZLIB_FOUND) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) - LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) - IF(WIN32 AND NOT CYGWIN) -- # -- # Test if ZLIB_WINAPI macro is needed to use. -- # -- TRY_MACRO_FOR_LIBRARY( -- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" -- RUNS -- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" -- ZLIB_WINAPI) -+ set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) - ADD_DEFINITIONS(-DZLIB_WINAPI) - ELSE(ZLIB_WINAPI) diff --git a/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch deleted file mode 100644 index 9e88323972df9..0000000000000 --- a/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 713e3bc..2315da5 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -430,14 +430,14 @@ IF(ZLIB_FOUND) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) - LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) - IF(WIN32 AND NOT CYGWIN) -- # -- # Test if ZLIB_WINAPI macro is needed to use. -- # -- TRY_MACRO_FOR_LIBRARY( -- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" -- RUNS -- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" -- ZLIB_WINAPI) -+ -+ -+ -+ -+ -+ -+ -+ set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) - ADD_DEFINITIONS(-DZLIB_WINAPI) - ELSE(ZLIB_WINAPI) diff --git a/recipes/libarchive/all/patches/0001-3.7.3-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.7.3-zlib-winapi.patch new file mode 100644 index 0000000000000..ca141ca403e55 --- /dev/null +++ b/recipes/libarchive/all/patches/0001-3.7.3-zlib-winapi.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c0fbd70..44ca23d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -454,12 +454,12 @@ IF(ZLIB_FOUND) + # + # Test if ZLIB_WINAPI macro is needed to use. + # +- TRY_MACRO_FOR_LIBRARY( +- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" +- RUNS +- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" +- ZLIB_WINAPI) +- IF(ZLIB_WINAPI) ++ # TRY_MACRO_FOR_LIBRARY( ++ # "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" ++ # RUNS ++ # "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" ++ # ZLIB_WINAPI) ++ IF(TRUE) + ADD_DEFINITIONS(-DZLIB_WINAPI) + ELSE(ZLIB_WINAPI) + # Test if a macro is needed for the library. diff --git a/recipes/libarchive/all/patches/0001-3.7.4-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.7.4-zlib-winapi.patch new file mode 100644 index 0000000000000..11d72518d4c9d --- /dev/null +++ b/recipes/libarchive/all/patches/0001-3.7.4-zlib-winapi.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ec97e4c..7e87e07 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -456,12 +456,12 @@ IF(ZLIB_FOUND) + # + # Test if ZLIB_WINAPI macro is needed to use. + # +- TRY_MACRO_FOR_LIBRARY( +- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" +- RUNS +- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" +- ZLIB_WINAPI) +- IF(ZLIB_WINAPI) ++ # TRY_MACRO_FOR_LIBRARY( ++ # "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" ++ # RUNS ++ # "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" ++ # ZLIB_WINAPI) ++ IF(TRUE) + ADD_DEFINITIONS(-DZLIB_WINAPI) + ELSE(ZLIB_WINAPI) + # Test if a macro is needed for the library. diff --git a/recipes/libarchive/all/patches/0002-3.4.0-msvc-no-we4061.patch b/recipes/libarchive/all/patches/0002-3.4.0-msvc-no-we4061.patch deleted file mode 100644 index ff6f218ef3e36..0000000000000 --- a/recipes/libarchive/all/patches/0002-3.4.0-msvc-no-we4061.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 922efd15..4ffd0930 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -157,7 +157,6 @@ IF (MSVC) - # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" - # Enable level 4 C4061: The enumerate has no associated handler in a switch - # statement. -- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4061") - # Enable level 4 C4254: A larger bit field was assigned to a smaller bit - # field. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254") diff --git a/recipes/libarchive/all/patches/0003-3.4.0-cmake.patch b/recipes/libarchive/all/patches/0003-3.4.0-cmake.patch deleted file mode 100644 index 7b34085f1a3a2..0000000000000 --- a/recipes/libarchive/all/patches/0003-3.4.0-cmake.patch +++ /dev/null @@ -1,142 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4ffd0930..01e8592c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,7 +6,7 @@ endif() - # - PROJECT(libarchive C) - # --SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") - if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) - endif() -@@ -412,7 +412,7 @@ IF(ZLIB_FOUND) - SET(HAVE_LIBZ 1) - SET(HAVE_ZLIB_H 1) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) -- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) -+ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) - IF(WIN32 AND NOT CYGWIN) - set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) -@@ -474,7 +474,7 @@ IF(LIBLZMA_FOUND) - SET(HAVE_LIBLZMA 1) - SET(HAVE_LZMA_H 1) - CMAKE_PUSH_CHECK_STATE() -- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) -+ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) - LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) -@@ -491,7 +491,7 @@ IF(LIBLZMA_FOUND) - ELSE(LIBLZMA_FOUND) - # LZMA not found and will not be used. - ENDIF(LIBLZMA_FOUND) --MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) -+MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) - MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) - - # -@@ -561,7 +561,7 @@ IF(ENABLE_LZ4) - ENDIF (LZ4_INCLUDE_DIR) - - FIND_PATH(LZ4_INCLUDE_DIR lz4.h) -- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) -+ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) - ELSE(ENABLE_LZ4) -@@ -757,7 +757,7 @@ ENDIF(ENABLE_NETTLE) - # Find OpenSSL - # (Except on Mac, where OpenSSL is deprecated.) - # --IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") -+IF(ENABLE_OPENSSL) - FIND_PACKAGE(OpenSSL) - IF(OPENSSL_FOUND) - SET(HAVE_LIBCRYPTO 1) -@@ -1316,7 +1316,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) - CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) - CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) --CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) -+set(HAVE_MEMMOVE 1) - CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) - CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) - CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) -@@ -1348,11 +1348,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) - CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) - CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) --CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) --CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) --CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) --CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) --CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -+set(HAVE_WCRTOMB 1) -+set(HAVE_WCSCMP 1) -+set(HAVE_WCSCPY 1) -+set(HAVE_WCSLEN 1) -+set(HAVE_WCTOMB 1) - CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) - CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) - CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) -@@ -1364,10 +1364,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) - CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) - CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) - CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) --CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) --CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) --CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) --CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) -+set(HAVE_VPRINTF 1) -+set(HAVE_WMEMCMP 1) -+set(HAVE_WMEMCPY 1) -+set(HAVE_WMEMMOVE 1) - - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index ec775bb4..8ef2d620 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -235,11 +235,15 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - ENDIF() - - # Libarchive is a shared library -+if (BUILD_SHARED_LIBS) -+ - ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) - TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) - -+else() -+ - # archive_static is a static library - ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) -@@ -249,13 +253,21 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS - IF(NOT WIN32 OR CYGWIN) - SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) - ENDIF(NOT WIN32 OR CYGWIN) -+endif() - - IF(ENABLE_INSTALL) - # How to install the libraries -- INSTALL(TARGETS archive archive_static -+ if (BUILD_SHARED_LIBS) -+ INSTALL(TARGETS archive -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) -+ else() -+ INSTALL(TARGETS archive_static - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -+ endif() - INSTALL_MAN(${libarchive_MANS}) - INSTALL(FILES ${include_HEADERS} DESTINATION include) - ENDIF() diff --git a/recipes/libarchive/all/patches/0003-3.4.3-cmake.patch b/recipes/libarchive/all/patches/0003-3.4.3-cmake.patch deleted file mode 100644 index 45a9561474f8e..0000000000000 --- a/recipes/libarchive/all/patches/0003-3.4.3-cmake.patch +++ /dev/null @@ -1,150 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6013d9e6..125b1cb3 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,7 +6,7 @@ endif() - # - PROJECT(libarchive C) - # --SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") - if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) - endif() -@@ -418,7 +418,7 @@ IF(ZLIB_FOUND) - SET(HAVE_LIBZ 1) - SET(HAVE_ZLIB_H 1) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) -- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) -+ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) - IF(WIN32 AND NOT CYGWIN) - set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) -@@ -480,7 +480,7 @@ IF(LIBLZMA_FOUND) - SET(HAVE_LIBLZMA 1) - SET(HAVE_LZMA_H 1) - CMAKE_PUSH_CHECK_STATE() -- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) -+ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) - LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) -@@ -497,7 +497,7 @@ IF(LIBLZMA_FOUND) - ELSE(LIBLZMA_FOUND) - # LZMA not found and will not be used. - ENDIF(LIBLZMA_FOUND) --MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) -+MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) - MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) - - # -@@ -567,7 +567,7 @@ IF(ENABLE_LZ4) - ENDIF (LZ4_INCLUDE_DIR) - - FIND_PATH(LZ4_INCLUDE_DIR lz4.h) -- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) -+ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) - ELSE(ENABLE_LZ4) -@@ -783,7 +783,7 @@ ENDIF(ENABLE_NETTLE) - # Find OpenSSL - # (Except on Mac, where OpenSSL is deprecated.) - # --IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") -+IF(ENABLE_OPENSSL) - FIND_PACKAGE(OpenSSL) - IF(OPENSSL_FOUND) - SET(HAVE_LIBCRYPTO 1) -@@ -1349,7 +1349,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) - CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) - CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) --CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) -+set(HAVE_MEMMOVE 1) - CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) - CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) - CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) -@@ -1371,6 +1371,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(strchr HAVE_STRCHR) - CHECK_FUNCTION_EXISTS_GLIBC(strdup HAVE_STRDUP) - CHECK_FUNCTION_EXISTS_GLIBC(strerror HAVE_STRERROR) - CHECK_FUNCTION_EXISTS_GLIBC(strncpy_s HAVE_STRNCPY_S) -+CHECK_FUNCTION_EXISTS_GLIBC(strnlen HAVE_STRNLEN) - CHECK_FUNCTION_EXISTS_GLIBC(strrchr HAVE_STRRCHR) - CHECK_FUNCTION_EXISTS_GLIBC(symlink HAVE_SYMLINK) - CHECK_FUNCTION_EXISTS_GLIBC(timegm HAVE_TIMEGM) -@@ -1381,11 +1382,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) - CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) - CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) --CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) --CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) --CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) --CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) --CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -+set(HAVE_WCRTOMB 1) -+set(HAVE_WCSCMP 1) -+set(HAVE_WCSCPY 1) -+set(HAVE_WCSLEN 1) -+set(HAVE_WCTOMB 1) - CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) - CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) - CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) -@@ -1398,10 +1399,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) - CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) - CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) - CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) --CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) --CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) --CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) --CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) -+set(HAVE_VPRINTF 1) -+set(HAVE_WMEMCMP 1) -+set(HAVE_WMEMCPY 1) -+set(HAVE_WMEMMOVE 1) - - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index 9389bbc9..76e0b5c7 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -236,11 +236,15 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - ENDIF() - - # Libarchive is a shared library -+if (BUILD_SHARED_LIBS) -+ - ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) - TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) - -+else() -+ - # archive_static is a static library - ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) -@@ -250,13 +254,21 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS - IF(NOT WIN32 OR CYGWIN) - SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) - ENDIF(NOT WIN32 OR CYGWIN) -+endif() - - IF(ENABLE_INSTALL) - # How to install the libraries -- INSTALL(TARGETS archive archive_static -+ if (BUILD_SHARED_LIBS) -+ INSTALL(TARGETS archive -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) -+ else() -+ INSTALL(TARGETS archive_static - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -+ endif() - INSTALL_MAN(${libarchive_MANS}) - INSTALL(FILES ${include_HEADERS} DESTINATION include) - ENDIF() diff --git a/recipes/libarchive/all/patches/0003-3.5.1-cmake.patch b/recipes/libarchive/all/patches/0003-3.5.1-cmake.patch deleted file mode 100644 index 181a183093fc3..0000000000000 --- a/recipes/libarchive/all/patches/0003-3.5.1-cmake.patch +++ /dev/null @@ -1,142 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 256b966e..30c42967 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,7 +6,7 @@ endif() - # - PROJECT(libarchive C) - # --SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") - if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) - endif() -@@ -418,7 +418,7 @@ IF(ZLIB_FOUND) - SET(HAVE_LIBZ 1) - SET(HAVE_ZLIB_H 1) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) -- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) -+ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) - IF(WIN32 AND NOT CYGWIN) - set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) -@@ -480,7 +480,7 @@ IF(LIBLZMA_FOUND) - SET(HAVE_LIBLZMA 1) - SET(HAVE_LZMA_H 1) - CMAKE_PUSH_CHECK_STATE() -- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) -+ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) - LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) -@@ -497,7 +497,7 @@ IF(LIBLZMA_FOUND) - ELSE(LIBLZMA_FOUND) - # LZMA not found and will not be used. - ENDIF(LIBLZMA_FOUND) --MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) -+MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) - MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) - - # -@@ -567,7 +567,7 @@ IF(ENABLE_LZ4) - ENDIF (LZ4_INCLUDE_DIR) - - FIND_PATH(LZ4_INCLUDE_DIR lz4.h) -- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) -+ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) - ELSE(ENABLE_LZ4) -@@ -783,7 +783,7 @@ ENDIF(ENABLE_NETTLE) - # Find OpenSSL - # (Except on Mac, where OpenSSL is deprecated.) - # --IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") -+IF(ENABLE_OPENSSL) - FIND_PACKAGE(OpenSSL) - IF(OPENSSL_FOUND) - SET(HAVE_LIBCRYPTO 1) -@@ -1349,7 +1349,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) - CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) - CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) --CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) -+set(HAVE_MEMMOVE 1) - CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) - CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) - CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) -@@ -1382,11 +1382,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) - CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) - CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) --CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) --CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) --CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) --CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) --CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -+set(HAVE_WCRTOMB 1) -+set(HAVE_WCSCMP 1) -+set(HAVE_WCSCPY 1) -+set(HAVE_WCSLEN 1) -+set(HAVE_WCTOMB 1) - CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) - CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) - CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) -@@ -1399,10 +1399,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) - CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) - CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) - CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) --CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) --CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) --CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) --CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) -+set(HAVE_VPRINTF 1) -+set(HAVE_WMEMCMP 1) -+set(HAVE_WMEMCPY 1) -+set(HAVE_WMEMMOVE 1) - - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index 9389bbc9..76e0b5c7 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -236,11 +236,15 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - ENDIF() - - # Libarchive is a shared library -+if (BUILD_SHARED_LIBS) -+ - ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) - TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) - -+else() -+ - # archive_static is a static library - ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) -@@ -250,13 +254,21 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS - IF(NOT WIN32 OR CYGWIN) - SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) - ENDIF(NOT WIN32 OR CYGWIN) -+endif() - - IF(ENABLE_INSTALL) - # How to install the libraries -- INSTALL(TARGETS archive archive_static -+ if (BUILD_SHARED_LIBS) -+ INSTALL(TARGETS archive -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) -+ else() -+ INSTALL(TARGETS archive_static - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -+ endif() - INSTALL_MAN(${libarchive_MANS}) - INSTALL(FILES ${include_HEADERS} DESTINATION include) - ENDIF() diff --git a/recipes/libarchive/all/patches/0003-3.5.2-cmake.patch b/recipes/libarchive/all/patches/0003-3.5.2-cmake.patch deleted file mode 100644 index 46955b7f8f7ce..0000000000000 --- a/recipes/libarchive/all/patches/0003-3.5.2-cmake.patch +++ /dev/null @@ -1,142 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e0359b51..3927a742 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,7 +6,7 @@ endif() - # - PROJECT(libarchive C) - # --SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") - if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) - endif() -@@ -418,7 +418,7 @@ IF(ZLIB_FOUND) - SET(HAVE_LIBZ 1) - SET(HAVE_ZLIB_H 1) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) -- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) -+ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) - IF(WIN32 AND NOT CYGWIN) - set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) -@@ -480,7 +480,7 @@ IF(LIBLZMA_FOUND) - SET(HAVE_LIBLZMA 1) - SET(HAVE_LZMA_H 1) - CMAKE_PUSH_CHECK_STATE() -- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) -+ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) - LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) -@@ -497,7 +497,7 @@ IF(LIBLZMA_FOUND) - ELSE(LIBLZMA_FOUND) - # LZMA not found and will not be used. - ENDIF(LIBLZMA_FOUND) --MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) -+MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) - MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) - - # -@@ -567,7 +567,7 @@ IF(ENABLE_LZ4) - ENDIF (LZ4_INCLUDE_DIR) - - FIND_PATH(LZ4_INCLUDE_DIR lz4.h) -- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) -+ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) - ELSE(ENABLE_LZ4) -@@ -783,7 +783,7 @@ ENDIF(ENABLE_NETTLE) - # Find OpenSSL - # (Except on Mac, where OpenSSL is deprecated.) - # --IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") -+IF(ENABLE_OPENSSL) - FIND_PACKAGE(OpenSSL) - IF(OPENSSL_FOUND) - SET(HAVE_LIBCRYPTO 1) -@@ -1350,7 +1350,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) - CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) - CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) --CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) -+set(HAVE_MEMMOVE 1) - CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) - CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) - CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) -@@ -1383,11 +1383,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) - CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) - CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) --CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) --CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) --CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) --CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) --CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -+set(HAVE_WCRTOMB 1) -+set(HAVE_WCSCMP 1) -+set(HAVE_WCSCPY 1) -+set(HAVE_WCSLEN 1) -+set(HAVE_WCTOMB 1) - CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) - CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) - CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) -@@ -1400,10 +1400,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) - CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) - CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) - CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) --CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) --CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) --CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) --CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) -+set(HAVE_VPRINTF 1) -+set(HAVE_WMEMCMP 1) -+set(HAVE_WMEMCPY 1) -+set(HAVE_WMEMMOVE 1) - - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index e1d76a51..792b26b3 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -238,11 +238,15 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - ENDIF() - - # Libarchive is a shared library -+if (BUILD_SHARED_LIBS) -+ - ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) - TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) - -+else() -+ - # archive_static is a static library - ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) -@@ -252,13 +256,21 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS - IF(NOT WIN32 OR CYGWIN) - SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) - ENDIF(NOT WIN32 OR CYGWIN) -+endif() - - IF(ENABLE_INSTALL) - # How to install the libraries -- INSTALL(TARGETS archive archive_static -+ if (BUILD_SHARED_LIBS) -+ INSTALL(TARGETS archive -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) -+ else() -+ INSTALL(TARGETS archive_static - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -+ endif() - INSTALL_MAN(${libarchive_MANS}) - INSTALL(FILES ${include_HEADERS} DESTINATION include) - ENDIF() diff --git a/recipes/libarchive/all/patches/0003-3.6.0-cmake.patch b/recipes/libarchive/all/patches/0003-3.6.0-cmake.patch deleted file mode 100644 index 3c89010df2aba..0000000000000 --- a/recipes/libarchive/all/patches/0003-3.6.0-cmake.patch +++ /dev/null @@ -1,153 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 646e5ce7..9bca273f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -9,7 +9,7 @@ endif() - # - PROJECT(libarchive C) - # --SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") - if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) - endif() -@@ -424,7 +424,7 @@ IF(ZLIB_FOUND) - SET(HAVE_LIBZ 1) - SET(HAVE_ZLIB_H 1) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) -- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) -+ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) - IF(WIN32 AND NOT CYGWIN) - set(ZLIB_WINAPI yes) - IF(ZLIB_WINAPI) -@@ -486,7 +486,7 @@ IF(LIBLZMA_FOUND) - SET(HAVE_LIBLZMA 1) - SET(HAVE_LZMA_H 1) - CMAKE_PUSH_CHECK_STATE() -- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) -+ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) - LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) -@@ -503,7 +503,7 @@ IF(LIBLZMA_FOUND) - ELSE(LIBLZMA_FOUND) - # LZMA not found and will not be used. - ENDIF(LIBLZMA_FOUND) --MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) -+MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) - MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) - - # -@@ -573,7 +573,7 @@ IF(ENABLE_LZ4) - ENDIF (LZ4_INCLUDE_DIR) - - FIND_PATH(LZ4_INCLUDE_DIR lz4.h) -- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) -+ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) - ELSE(ENABLE_LZ4) -@@ -790,7 +790,7 @@ ENDIF(ENABLE_NETTLE) - # Find OpenSSL - # (Except on Mac, where OpenSSL is deprecated.) - # --IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") -+IF(ENABLE_OPENSSL) - FIND_PACKAGE(OpenSSL) - IF(OPENSSL_FOUND) - SET(HAVE_LIBCRYPTO 1) -@@ -1357,7 +1357,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) - CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) - CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) --CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) -+set(HAVE_MEMMOVE 1) - CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) - CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) - CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) -@@ -1390,11 +1390,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) - CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) - CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) --CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) --CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) --CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) --CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) --CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -+set(HAVE_WCRTOMB 1) -+set(HAVE_WCSCMP 1) -+set(HAVE_WCSCPY 1) -+set(HAVE_WCSLEN 1) -+set(HAVE_WCTOMB 1) - CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) - CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) - CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) -@@ -1407,10 +1407,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) - CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) - CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) - CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) --CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) --CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) --CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) --CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) -+set(HAVE_VPRINTF 1) -+set(HAVE_WMEMCMP 1) -+set(HAVE_WMEMCPY 1) -+set(HAVE_WMEMMOVE 1) - - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index e1d76a51..713c6496 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -5,6 +5,10 @@ - # - ############################################ - -+if (ANDROID) -+ include_directories(${PROJECT_SOURCE_DIR}/contrib/android/include) -+endif() -+ - # Public headers - SET(include_HEADERS - archive.h -@@ -238,11 +242,15 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - ENDIF() - - # Libarchive is a shared library -+if (BUILD_SHARED_LIBS) -+ - ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) - TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) - -+else() -+ - # archive_static is a static library - ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) -@@ -252,13 +260,21 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS - IF(NOT WIN32 OR CYGWIN) - SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) - ENDIF(NOT WIN32 OR CYGWIN) -+endif() - - IF(ENABLE_INSTALL) - # How to install the libraries -- INSTALL(TARGETS archive archive_static -+ if (BUILD_SHARED_LIBS) -+ INSTALL(TARGETS archive -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) -+ else() -+ INSTALL(TARGETS archive_static - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -+ endif() - INSTALL_MAN(${libarchive_MANS}) - INSTALL(FILES ${include_HEADERS} DESTINATION include) - ENDIF() diff --git a/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch b/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch deleted file mode 100644 index aca2961950d2d..0000000000000 --- a/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch +++ /dev/null @@ -1,98 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a4a9284a..f5dbccac 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -9,7 +9,7 @@ endif() - # - PROJECT(libarchive C) - # --SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") - if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) - endif() -@@ -428,7 +428,7 @@ IF(ZLIB_FOUND) - SET(HAVE_LIBZ 1) - SET(HAVE_ZLIB_H 1) - INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) -- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) -+ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) - IF(WIN32 AND NOT CYGWIN) - - -@@ -497,7 +497,7 @@ IF(LIBLZMA_FOUND) - SET(HAVE_LIBLZMA 1) - SET(HAVE_LZMA_H 1) - CMAKE_PUSH_CHECK_STATE() -- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) -+ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) - SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) - LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) -@@ -514,7 +514,7 @@ IF(LIBLZMA_FOUND) - ELSE(LIBLZMA_FOUND) - # LZMA not found and will not be used. - ENDIF(LIBLZMA_FOUND) --MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) -+MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) - MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) - - # -@@ -584,7 +584,7 @@ IF(ENABLE_LZ4) - ENDIF (LZ4_INCLUDE_DIR) - - FIND_PATH(LZ4_INCLUDE_DIR lz4.h) -- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) -+ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) - ELSE(ENABLE_LZ4) -@@ -806,7 +806,7 @@ ENDIF(ENABLE_NETTLE) - # Find OpenSSL - # (Except on Mac, where OpenSSL is deprecated.) - # --IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") -+IF(ENABLE_OPENSSL) - FIND_PACKAGE(OpenSSL) - IF(OPENSSL_FOUND) - SET(HAVE_LIBCRYPTO 1) -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index ff7ade00..8c867130 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -242,13 +242,13 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - LIST(APPEND libarchive_SOURCES archive_disk_acl_sunos.c) - ENDIF() - --# Libarchive is a shared library -+if (BUILD_SHARED_LIBS) - ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .) - TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) - --# archive_static is a static library -+else() - ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS -@@ -257,13 +257,13 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS - IF(NOT WIN32 OR CYGWIN) - SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) - ENDIF(NOT WIN32 OR CYGWIN) -- -+endif() - IF(ENABLE_INSTALL) -- # How to install the libraries -- INSTALL(TARGETS archive archive_static -- RUNTIME DESTINATION bin -- LIBRARY DESTINATION lib -- ARCHIVE DESTINATION lib) -+ if (BUILD_SHARED_LIBS) -+ INSTALL(TARGETS archive RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -+ else() -+ INSTALL(TARGETS archive_static RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -+ endif() - INSTALL_MAN(${libarchive_MANS}) - INSTALL(FILES ${include_HEADERS} DESTINATION include) - ENDIF() diff --git a/recipes/libarchive/all/patches/0003-3.7.3-cmake.patch b/recipes/libarchive/all/patches/0003-3.7.3-cmake.patch new file mode 100644 index 0000000000000..a4c5151bebe08 --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.7.3-cmake.patch @@ -0,0 +1,92 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 44ca23d..40439ca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,7 @@ endif() + # + PROJECT(libarchive C) + # +-SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") ++LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") + if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) + endif() +@@ -449,7 +449,7 @@ IF(ZLIB_FOUND) + SET(HAVE_LIBZ 1) + SET(HAVE_ZLIB_H 1) + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) +- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) ++ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) + IF(WIN32 AND NOT CYGWIN) + # + # Test if ZLIB_WINAPI macro is needed to use. +@@ -518,7 +518,7 @@ IF(LIBLZMA_FOUND) + SET(HAVE_LIBLZMA 1) + SET(HAVE_LZMA_H 1) + CMAKE_PUSH_CHECK_STATE() +- SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) ++ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIRS}) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) + INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) + LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) +@@ -539,7 +539,7 @@ ELSE(LIBLZMA_FOUND) + # LZMA not found and will not be used. + SET(HAVE_LZMA_STREAM_ENCODER_MT 0) + ENDIF(LIBLZMA_FOUND) +-MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) ++MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) + MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) + + # +@@ -610,7 +610,7 @@ IF(ENABLE_LZ4) + ENDIF (LZ4_INCLUDE_DIR) + + FIND_PATH(LZ4_INCLUDE_DIR lz4.h) +- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) ++ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) + INCLUDE(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) + ELSE(ENABLE_LZ4) +@@ -834,7 +834,7 @@ ENDIF(ENABLE_NETTLE) + # Find OpenSSL + # (Except on Mac, where OpenSSL is deprecated.) + # +-IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") ++IF(ENABLE_OPENSSL) + FIND_PACKAGE(OpenSSL) + IF(OPENSSL_FOUND) + SET(HAVE_LIBCRYPTO 1) +diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt +index b79091c..bd9e980 100644 +--- a/libarchive/CMakeLists.txt ++++ b/libarchive/CMakeLists.txt +@@ -251,6 +251,7 @@ IF(BUILD_SHARED_LIBS) + ENDIF(BUILD_SHARED_LIBS) + + # archive_static is a static library ++if(NOT BUILD_SHARED_LIBS) + ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) + TARGET_INCLUDE_DIRECTORIES(archive_static PUBLIC .) + TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) +@@ -260,7 +261,7 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS + IF(NOT WIN32 OR CYGWIN OR NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) + ENDIF(NOT WIN32 OR CYGWIN OR NOT BUILD_SHARED_LIBS) +- ++endif() + IF(ENABLE_INSTALL) + # How to install the libraries + IF(BUILD_SHARED_LIBS) +@@ -269,10 +270,12 @@ IF(ENABLE_INSTALL) + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + ENDIF(BUILD_SHARED_LIBS) ++ if(NOT BUILD_SHARED_LIBS) + INSTALL(TARGETS archive_static + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) ++ endif() + INSTALL_MAN(${libarchive_MANS}) + INSTALL(FILES ${include_HEADERS} DESTINATION include) + ENDIF() diff --git a/recipes/libarchive/all/patches/0003-3.7.4-cmake.patch b/recipes/libarchive/all/patches/0003-3.7.4-cmake.patch new file mode 100644 index 0000000000000..1cd38344e5586 --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.7.4-cmake.patch @@ -0,0 +1,83 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7e87e07..2c9a5f8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,7 @@ endif() + # + PROJECT(libarchive C) + # +-SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") ++LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") + if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) + endif() +@@ -451,7 +451,7 @@ IF(ZLIB_FOUND) + SET(HAVE_LIBZ 1) + SET(HAVE_ZLIB_H 1) + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) +- LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) ++ LIST(APPEND ADDITIONAL_LIBS ZLIB::ZLIB) + IF(WIN32 AND NOT CYGWIN) + # + # Test if ZLIB_WINAPI macro is needed to use. +@@ -541,7 +541,7 @@ ELSE(LIBLZMA_FOUND) + # LZMA not found and will not be used. + SET(HAVE_LZMA_STREAM_ENCODER_MT 0) + ENDIF(LIBLZMA_FOUND) +-MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR) ++MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIRS) + MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY) + + # +@@ -612,7 +612,7 @@ IF(ENABLE_LZ4) + ENDIF (LZ4_INCLUDE_DIR) + + FIND_PATH(LZ4_INCLUDE_DIR lz4.h) +- FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) ++ FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4 lz4_static liblz4_static) + INCLUDE(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) + ELSE(ENABLE_LZ4) +@@ -836,7 +836,7 @@ ENDIF(ENABLE_NETTLE) + # Find OpenSSL + # (Except on Mac, where OpenSSL is deprecated.) + # +-IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") ++IF(ENABLE_OPENSSL) + FIND_PACKAGE(OpenSSL) + IF(OPENSSL_FOUND) + SET(HAVE_LIBCRYPTO 1) +diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt +index b79091c..bd9e980 100644 +--- a/libarchive/CMakeLists.txt ++++ b/libarchive/CMakeLists.txt +@@ -251,6 +251,7 @@ IF(BUILD_SHARED_LIBS) + ENDIF(BUILD_SHARED_LIBS) + + # archive_static is a static library ++if(NOT BUILD_SHARED_LIBS) + ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) + TARGET_INCLUDE_DIRECTORIES(archive_static PUBLIC .) + TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) +@@ -260,7 +261,7 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS + IF(NOT WIN32 OR CYGWIN OR NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) + ENDIF(NOT WIN32 OR CYGWIN OR NOT BUILD_SHARED_LIBS) +- ++endif() + IF(ENABLE_INSTALL) + # How to install the libraries + IF(BUILD_SHARED_LIBS) +@@ -269,10 +270,12 @@ IF(ENABLE_INSTALL) + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + ENDIF(BUILD_SHARED_LIBS) ++ if(NOT BUILD_SHARED_LIBS) + INSTALL(TARGETS archive_static + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) ++ endif() + INSTALL_MAN(${libarchive_MANS}) + INSTALL(FILES ${include_HEADERS} DESTINATION include) + ENDIF() diff --git a/recipes/libarchive/all/patches/0004-3.6.0-android.patch b/recipes/libarchive/all/patches/0004-3.6.0-android.patch deleted file mode 100644 index c4c91d3ecb18a..0000000000000 --- a/recipes/libarchive/all/patches/0004-3.6.0-android.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index 792b26b3..713c6496 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -5,6 +5,10 @@ - # - ############################################ - -+if (ANDROID) -+ include_directories(${PROJECT_SOURCE_DIR}/contrib/android/include) -+endif() -+ - # Public headers - SET(include_HEADERS - archive.h diff --git a/recipes/libarchive/all/patches/0005-3.6.2-try-compile-cmakedeps.patch b/recipes/libarchive/all/patches/0005-3.6.2-try-compile-cmakedeps.patch deleted file mode 100644 index 69e42f1f5678b..0000000000000 --- a/recipes/libarchive/all/patches/0005-3.6.2-try-compile-cmakedeps.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f5dbccac..ea7ff16a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -830,12 +830,11 @@ IF(NOT OPENSSL_FOUND) - ENDIF(NOT OPENSSL_FOUND) - - # --# How to prove that CRYPTO functions, which have several names on various --# platforms, just see if archive_digest.c can compile and link against --# required libraries. - # - MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) -- FOREACH(ALGORITHM ${ALGORITHMS}) -+ FOREACH(ALGORITHM ${ALGORITHMS}) -+ include(CMakePushCheckState) -+ cmake_push_check_state() - IF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) - STRING(TOLOWER "${ALGORITHM}" lower_algorithm) - STRING(TOUPPER "${ALGORITHM}" algorithm) -@@ -856,8 +855,8 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) - IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) - SET(TRY_CRYPTO_REQUIRED_INCLUDES - "${TRY_CRYPTO_REQUIRED_INCLUDES};${OPENSSL_INCLUDE_DIR}") -- SET(TRY_CRYPTO_REQUIRED_LIBS -- "-DLINK_LIBRARIES:STRING=${OPENSSL_LIBRARIES}") -+ set(CMAKE_REQUIRED_LIBRARIES -+ ${OPENSSL_LIBRARIES}) - ELSEIF("${IMPLEMENTATION}" MATCHES "^MBEDTLS$" AND MBEDTLS_FOUND) - SET(TRY_CRYPTO_REQUIRED_INCLUDES - "${TRY_CRYPTO_REQUIRED_INCLUDES};${MBEDTLS_INCLUDE_DIRS}") -@@ -934,6 +933,7 @@ main(int argc, char **argv) - ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) - ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) - ENDIF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) -+ cmake_pop_check_state() - ENDFOREACH(ALGORITHM ${ALGORITHMS}) - ENDMACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) - diff --git a/recipes/libarchive/all/patches/0005-3.7.3-try-compile-cmakedeps.patch b/recipes/libarchive/all/patches/0005-3.7.3-try-compile-cmakedeps.patch new file mode 100644 index 0000000000000..a55e8c8709b68 --- /dev/null +++ b/recipes/libarchive/all/patches/0005-3.7.3-try-compile-cmakedeps.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 40439ca..6845238 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -867,8 +867,10 @@ ENDIF(NOT OPENSSL_FOUND) + # required libraries. + # + MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) ++ include(CMakePushCheckState) + FOREACH(ALGORITHM ${ALGORITHMS}) + IF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) ++ cmake_push_check_state() + STRING(TOLOWER "${ALGORITHM}" lower_algorithm) + STRING(TOUPPER "${ALGORITHM}" algorithm) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND NOT OPENSSL_FOUND) +@@ -901,8 +903,7 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${NETTLE_LIBRARY}") + ELSEIF("${IMPLEMENTATION}" MATCHES "^LIBMD$" AND LIBMD_FOUND) +- SET(TRY_CRYPTO_REQUIRED_LIBS +- "-DLINK_LIBRARIES:STRING=${LIBMD_LIBRARY}") ++ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in diff --git a/recipes/libarchive/all/patches/0005-3.7.4-try-compile-cmakedeps.patch b/recipes/libarchive/all/patches/0005-3.7.4-try-compile-cmakedeps.patch new file mode 100644 index 0000000000000..a6c90a0205df0 --- /dev/null +++ b/recipes/libarchive/all/patches/0005-3.7.4-try-compile-cmakedeps.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2c9a5f8..91d0f49 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -869,8 +869,10 @@ ENDIF(NOT OPENSSL_FOUND) + # required libraries. + # + MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) ++ include(CMakePushCheckState) + FOREACH(ALGORITHM ${ALGORITHMS}) + IF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) ++ cmake_push_check_state() + STRING(TOLOWER "${ALGORITHM}" lower_algorithm) + STRING(TOUPPER "${ALGORITHM}" algorithm) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND NOT OPENSSL_FOUND) +@@ -903,8 +905,7 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${NETTLE_LIBRARY}") + ELSEIF("${IMPLEMENTATION}" MATCHES "^LIBMD$" AND LIBMD_FOUND) +- SET(TRY_CRYPTO_REQUIRED_LIBS +- "-DLINK_LIBRARIES:STRING=${LIBMD_LIBRARY}") ++ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in diff --git a/recipes/libarchive/all/patches/0006-3.6.2-fix-msvc-build.patch b/recipes/libarchive/all/patches/0006-3.6.2-fix-msvc-build.patch deleted file mode 100644 index c0903cf80cf94..0000000000000 --- a/recipes/libarchive/all/patches/0006-3.6.2-fix-msvc-build.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 713e3bc5..9bc36214 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1374,7 +1374,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) - CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) - CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) --CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) -+set(HAVE_MEMMOVE 1) - CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) - CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) - CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) -@@ -1407,11 +1407,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) - CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) - CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) - CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) --CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) --CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) --CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) --CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) --CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -+set(HAVE_WCRTOMB 1) -+set(HAVE_WCSCMP 1) -+set(HAVE_WCSCPY 1) -+set(HAVE_WCSLEN 1) -+set(HAVE_WCTOMB 1) - CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) - CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) - CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) -@@ -1424,10 +1424,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) - CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) - CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) - CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) --CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) --CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) --CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) --CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) -+set(HAVE_VPRINTF 1) -+set(HAVE_WMEMCMP 1) -+set(HAVE_WMEMCPY 1) -+set(HAVE_WMEMMOVE 1) - - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - --- -2.33.0.windows.1 - diff --git a/recipes/libarchive/all/patches/0006-3.7.3-fix-msvc-build.patch b/recipes/libarchive/all/patches/0006-3.7.3-fix-msvc-build.patch new file mode 100644 index 0000000000000..d25d36378b560 --- /dev/null +++ b/recipes/libarchive/all/patches/0006-3.7.3-fix-msvc-build.patch @@ -0,0 +1,45 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6845238..489936a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1471,7 +1471,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +-CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++SET(HAVE_MEMMOVE 1) + CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) + CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) + CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +@@ -1504,11 +1504,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) + CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) + CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) +-CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) +-CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +-CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++SET(HAVE_WCRTOMB 1) ++SET(HAVE_WCSCMP 1) ++SET(HAVE_WCSCPY 1) ++SET(HAVE_WCSLEN 1) ++SET(HAVE_WCTOMB 1) + CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) + CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) + CHECK_SYMBOL_EXISTS(ctime_s "time.h" HAVE_CTIME_S) +@@ -1521,10 +1521,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) + CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +-CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +-CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +-CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +-CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++SET(HAVE_VPRINTF 1) ++SET(HAVE_WMEMCMP 1) ++SET(HAVE_WMEMCPY 1) ++SET(HAVE_WMEMMOVE 1) + + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + diff --git a/recipes/libarchive/all/patches/0006-3.7.4-fix-msvc-build.patch b/recipes/libarchive/all/patches/0006-3.7.4-fix-msvc-build.patch new file mode 100644 index 0000000000000..754faa44c171c --- /dev/null +++ b/recipes/libarchive/all/patches/0006-3.7.4-fix-msvc-build.patch @@ -0,0 +1,45 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 91d0f49..4041b9b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1473,7 +1473,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +-CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++SET(HAVE_MEMMOVE 1) + CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) + CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) + CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +@@ -1507,11 +1507,11 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) + CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) + CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) +-CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) +-CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +-CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++SET(HAVE_WCRTOMB 1) ++SET(HAVE_WCSCMP 1) ++SET(HAVE_WCSCPY 1) ++SET(HAVE_WCSLEN 1) ++SET(HAVE_WCTOMB 1) + CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) + CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) + CHECK_SYMBOL_EXISTS(ctime_s "time.h" HAVE_CTIME_S) +@@ -1524,10 +1524,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) + CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +-CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +-CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +-CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +-CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++SET(HAVE_VPRINTF 1) ++SET(HAVE_WMEMCMP 1) ++SET(HAVE_WMEMCPY 1) ++SET(HAVE_WMEMMOVE 1) + + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + diff --git a/recipes/libarchive/config.yml b/recipes/libarchive/config.yml index 0331875919146..444f54652ac92 100644 --- a/recipes/libarchive/config.yml +++ b/recipes/libarchive/config.yml @@ -1,19 +1,9 @@ versions: - "3.7.2": - folder: all - "3.7.1": - folder: all - "3.6.2": - folder: all - "3.6.1": + "3.7.4": folder: all - "3.6.0": + "3.7.3": folder: all - "3.5.2": - folder: all - "3.5.1": - folder: all - "3.4.3": + "3.7.2": folder: all - "3.4.0": + "3.7.1": folder: all diff --git a/recipes/libassert/all/conanfile.py b/recipes/libassert/all/conanfile.py deleted file mode 100644 index c596be696aeb2..0000000000000 --- a/recipes/libassert/all/conanfile.py +++ /dev/null @@ -1,145 +0,0 @@ -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, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.files import apply_conandata_patches, export_conandata_patches -import os - -required_conan_version = ">=1.53.0" - -class LibassertConan(ConanFile): - name = "libassert" - description = "The most over-engineered and overpowered C++ assertion library." - license = "MIT" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/jeremy-rifkin/libassert" - package_type = "library" - - topics = ("assert", "library", "assertions", "stacktrace") - settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - } - default_options = { - "shared": False, - "fPIC": True, - } - - @property - def _min_cppstd(self): - return 17 - - @property - def _compilers_minimum_version(self): - return { - "gcc": "8", - "clang": "9" - } - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - - def layout(self): - cmake_layout(self, src_folder="src") - - def requirements(self): - if Version(self.version) >= Version("1.2.2"): - self.requires("cpptrace/0.3.1") - elif Version(self.version) >= Version("1.2.1"): - self.requires("cpptrace/0.2.1") - - def validate(self): - if self.settings.compiler == "apple-clang": - raise ConanInvalidConfiguration("apple-clang not supported") - - if self.settings.compiler.cppstd: - check_min_cppstd(self, self._min_cppstd) - - check_min_vs(self, 192) - if not is_msvc(self): - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version and Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") - - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) - - def export_sources(self): - export_conandata_patches(self) - - def generate(self): - tc = CMakeToolchain(self) - - if is_msvc(self): - tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) - - if Version(self.version) >= Version("1.2.1"): - if not self.options.shared: - tc.variables["ASSERT_STATIC"] = True - tc.variables["ASSERT_USE_EXTERNAL_CPPTRACE"] = True - deps = CMakeDeps(self) - deps.generate() - - tc.generate() - - def build(self): - apply_conandata_patches(self) - - cmake = CMake(self) - cmake.configure() - cmake.build() - - def package(self): - copy(self, pattern="LICENSE", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder) - cmake = CMake(self) - cmake.install() - - if self.settings.os == "Windows" and self.options.shared: - copy( - self, - "*.dll", - src=self.build_folder, - dst=os.path.join(self.package_folder, "bin"), - keep_path=False - ) - - rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - rmdir(self, os.path.join(self.package_folder, "share")) - rm(self, "*.la", os.path.join(self.package_folder, "lib")) - rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) - rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - - def package_info(self): - self.cpp_info.libs = ["assert"] - - self.cpp_info.set_property("cmake_file_name", "assert") - self.cpp_info.set_property("cmake_target_name", "assert::assert") - - # the first version of this library used assert/assert as include folder - # appending this one but not removing the default to not break consumers - self.cpp_info.includedirs.append(os.path.join("include", "assert")) - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "assert" - self.cpp_info.filenames["cmake_find_package_multi"] = "assert" - self.cpp_info.names["cmake_find_package"] = "assert" - self.cpp_info.names["cmake_find_package_multi"] = "assert" - - if Version(self.version) < Version("1.2.1"): - # pre-cpptrace - if self.settings.os == "Linux": - self.cpp_info.system_libs.append("dl") - if self.settings.os == "Windows": - self.cpp_info.system_libs.append("dbghelp") diff --git a/recipes/libassert/all/test_package/CMakeLists.txt b/recipes/libassert/all/test_package/CMakeLists.txt deleted file mode 100644 index 97d2bfbc982a3..0000000000000 --- a/recipes/libassert/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) - -find_package(assert REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) -# don't link to ${CONAN_LIBS} or CONAN_PKG::package -target_link_libraries(${PROJECT_NAME} PRIVATE assert::assert) -# In case the target project need a specific C++ standard -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libassert/all/test_v1_package/conanfile.py b/recipes/libassert/all/test_v1_package/conanfile.py deleted file mode 100644 index 7e264aad8e8ec..0000000000000 --- a/recipes/libassert/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/libassert/config.yml b/recipes/libassert/config.yml index 8ade508384535..6dd1f18fc901d 100644 --- a/recipes/libassert/config.yml +++ b/recipes/libassert/config.yml @@ -1,10 +1,18 @@ versions: # Newer versions at the top + "2.1.0": + folder: v2 + "2.0.2": + folder: v2 + "2.0.1": + folder: v2 + "2.0.0": + folder: v2 "1.2.2": - folder: all + folder: v1 "1.2.1": - folder: all + folder: v1 "1.1": - folder: all + folder: v1 "1.0": - folder: all + folder: v1 diff --git a/recipes/libassert/all/conandata.yml b/recipes/libassert/v1/conandata.yml similarity index 100% rename from recipes/libassert/all/conandata.yml rename to recipes/libassert/v1/conandata.yml diff --git a/recipes/libassert/v1/conanfile.py b/recipes/libassert/v1/conanfile.py new file mode 100644 index 0000000000000..8ccc475577fbc --- /dev/null +++ b/recipes/libassert/v1/conanfile.py @@ -0,0 +1,148 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc +from conan.tools.apple import is_apple_os +from conan.tools.files import get, copy, rm, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches +import os + +required_conan_version = ">=1.53.0" + +class LibassertConan(ConanFile): + name = "libassert" + description = "The most over-engineered and overpowered C++ assertion library." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jeremy-rifkin/libassert" + package_type = "library" + + topics = ("assert", "library", "assertions", "stacktrace") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "9" + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) >= "1.2.2": + self.requires("cpptrace/0.3.1") + elif Version(self.version) >= "1.2.1": + self.requires("cpptrace/0.2.1") + + def validate(self): + if is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Mac. Please, update to version >=2.0.0") + + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def export_sources(self): + export_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + + if not self.options.shared: + tc.variables["ASSERT_STATIC"] = True + tc.variables["ASSERT_USE_EXTERNAL_CPPTRACE"] = True + deps = CMakeDeps(self) + deps.generate() + + tc.generate() + + def build(self): + apply_conandata_patches(self) + + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) + cmake.install() + + if self.settings.os == "Windows" and self.options.shared: + copy( + self, + "*.dll", + src=self.build_folder, + dst=os.path.join(self.package_folder, "bin"), + keep_path=False + ) + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.libs = ["assert"] + + self.cpp_info.set_property("cmake_file_name", "assert") + self.cpp_info.set_property("cmake_target_name", "assert::assert") + + # the first version of this library used assert/assert as include folder + # appending this one but not removing the default to not break consumers + self.cpp_info.includedirs.append(os.path.join("include", "assert")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "assert" + self.cpp_info.filenames["cmake_find_package_multi"] = "assert" + self.cpp_info.names["cmake_find_package"] = "assert" + self.cpp_info.names["cmake_find_package_multi"] = "assert" + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + if Version(self.version) < "1.2.1": + # pre-cpptrace + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("dl") + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("dbghelp") diff --git a/recipes/libassert/all/patches/1.0/0001-add-cstring-include.patch b/recipes/libassert/v1/patches/1.0/0001-add-cstring-include.patch similarity index 100% rename from recipes/libassert/all/patches/1.0/0001-add-cstring-include.patch rename to recipes/libassert/v1/patches/1.0/0001-add-cstring-include.patch diff --git a/recipes/libassert/all/patches/1.0/0002-cmake-backport.patch b/recipes/libassert/v1/patches/1.0/0002-cmake-backport.patch similarity index 100% rename from recipes/libassert/all/patches/1.0/0002-cmake-backport.patch rename to recipes/libassert/v1/patches/1.0/0002-cmake-backport.patch diff --git a/recipes/libassert/all/patches/1.0/0003-fix-max_line_number_width-miscalculation.patch b/recipes/libassert/v1/patches/1.0/0003-fix-max_line_number_width-miscalculation.patch similarity index 100% rename from recipes/libassert/all/patches/1.0/0003-fix-max_line_number_width-miscalculation.patch rename to recipes/libassert/v1/patches/1.0/0003-fix-max_line_number_width-miscalculation.patch diff --git a/recipes/libassert/all/patches/1.1/0001-fix-max_line_number_width-miscalculation.patch b/recipes/libassert/v1/patches/1.1/0001-fix-max_line_number_width-miscalculation.patch similarity index 100% rename from recipes/libassert/all/patches/1.1/0001-fix-max_line_number_width-miscalculation.patch rename to recipes/libassert/v1/patches/1.1/0001-fix-max_line_number_width-miscalculation.patch diff --git a/recipes/libassert/all/patches/1.1/0002-binary_diagnostics_descriptor-noexcept.patch b/recipes/libassert/v1/patches/1.1/0002-binary_diagnostics_descriptor-noexcept.patch similarity index 100% rename from recipes/libassert/all/patches/1.1/0002-binary_diagnostics_descriptor-noexcept.patch rename to recipes/libassert/v1/patches/1.1/0002-binary_diagnostics_descriptor-noexcept.patch diff --git a/recipes/libassert/all/patches/1.1/0003-cmake-windows.patch b/recipes/libassert/v1/patches/1.1/0003-cmake-windows.patch similarity index 100% rename from recipes/libassert/all/patches/1.1/0003-cmake-windows.patch rename to recipes/libassert/v1/patches/1.1/0003-cmake-windows.patch diff --git a/recipes/libassert/all/patches/1.2.1/0001-cpptrace-dll-copy.patch b/recipes/libassert/v1/patches/1.2.1/0001-cpptrace-dll-copy.patch similarity index 100% rename from recipes/libassert/all/patches/1.2.1/0001-cpptrace-dll-copy.patch rename to recipes/libassert/v1/patches/1.2.1/0001-cpptrace-dll-copy.patch diff --git a/recipes/libassert/all/patches/1.2.2/0001-cpptrace-dll-copy.patch b/recipes/libassert/v1/patches/1.2.2/0001-cpptrace-dll-copy.patch similarity index 100% rename from recipes/libassert/all/patches/1.2.2/0001-cpptrace-dll-copy.patch rename to recipes/libassert/v1/patches/1.2.2/0001-cpptrace-dll-copy.patch diff --git a/recipes/libassert/v1/test_package/CMakeLists.txt b/recipes/libassert/v1/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7e6204817489c --- /dev/null +++ b/recipes/libassert/v1/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + + +add_executable(${PROJECT_NAME} test_package.cpp) + +find_package(assert REQUIRED CONFIG) +target_link_libraries(${PROJECT_NAME} PRIVATE assert::assert) + + +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libassert/v1/test_package/conanfile.py b/recipes/libassert/v1/test_package/conanfile.py new file mode 100644 index 0000000000000..a804618d0f86f --- /dev/null +++ b/recipes/libassert/v1/test_package/conanfile.py @@ -0,0 +1,30 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libassert/all/test_package/test_package.cpp b/recipes/libassert/v1/test_package/test_package.cpp similarity index 100% rename from recipes/libassert/all/test_package/test_package.cpp rename to recipes/libassert/v1/test_package/test_package.cpp diff --git a/recipes/libassert/v1/test_v1_package/CMakeLists.txt b/recipes/libassert/v1/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/libassert/v1/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/libassert/v1/test_v1_package/conanfile.py b/recipes/libassert/v1/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..c492184eec19c --- /dev/null +++ b/recipes/libassert/v1/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/libassert/v2/conandata.yml b/recipes/libassert/v2/conandata.yml new file mode 100644 index 0000000000000..d82d9bdfc202f --- /dev/null +++ b/recipes/libassert/v2/conandata.yml @@ -0,0 +1,35 @@ +sources: + # Newer versions at the top + "2.1.0": + url: + - "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v2.1.0.tar.gz" + sha256: "e42405b49cde017c44c78aacac35c6e03564532838709031e73d10ab71f5363d" + "2.0.2": + url: + - "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v2.0.2.tar.gz" + sha256: "4a0b52e6523bdde0116231a67583131ea1a84bb574076fad939fc13fc7490443" + "2.0.1": + url: + - "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v2.0.1.tar.gz" + sha256: "405a44c14c5e40de5b81b01538ba12ef9d7c1f57e2c29f81b929e7e179847d4c" + "2.0.0": + url: + - "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v2.0.0.tar.gz" + sha256: "d4b2da2179a94637b34d18813a814531a1eceb0ddc6dd6db6098050dd638f4a1" + +patches: + "2.1.0": + - patch_file: "patches/2.1.0/0001-msvc-ice.patch" + patch_type: "portability" + patch_source: https://github.com/jeremy-rifkin/libassert/commit/aff047da702316b10219a967f78da352f847b8d0 + patch_description: "Handle an ICE in old MSVC" + "2.0.1": + - patch_file: "patches/2.0.1/0001-fix-string_view-detection.patch" + patch_type: "portability" + patch_source: https://github.com/jeremy-rifkin/libassert/commit/1825976ebc7ccb34687d75aaaaf2a961dafc5450 + patch_description: "Update #if checks for string_view support" + "2.0.0": + - patch_file: "patches/2.0.0/0001-fix-export-and-include.patch" + patch_type: "bugfix" + patch_source: https://github.com/jeremy-rifkin/libassert/commit/25c1f3e43737ab18490a0d9430cb1c70f976a662 + patch_description: "Fix export header and an incorrect #include" diff --git a/recipes/libassert/v2/conanfile.py b/recipes/libassert/v2/conanfile.py new file mode 100644 index 0000000000000..090d2f2ae8a10 --- /dev/null +++ b/recipes/libassert/v2/conanfile.py @@ -0,0 +1,141 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc +from conan.tools.apple import is_apple_os +from conan.tools.files import get, copy, rm, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches +import os + +required_conan_version = ">=1.53.0" + +class LibassertConan(ConanFile): + name = "libassert" + description = "The most over-engineered C++ assertion library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jeremy-rifkin/libassert" + package_type = "library" + + topics = ("assert", "library", "assertions", "stacktrace", "diagnostics", "defensive programming", "testing") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "9" + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("cpptrace/0.6.0", transitive_headers=True, transitive_libs=True) + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def export_sources(self): + export_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + + tc.variables["LIBASSERT_USE_EXTERNAL_CPPTRACE"] = True + deps = CMakeDeps(self) + deps.generate() + + tc.generate() + + def build(self): + apply_conandata_patches(self) + + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) + cmake.install() + + if self.settings.os == "Windows" and self.options.shared: + copy( + self, + "*.dll", + src=self.build_folder, + dst=os.path.join(self.package_folder, "bin"), + keep_path=False + ) + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.libs = ["assert"] + + self.cpp_info.set_property("cmake_file_name", "libassert") + self.cpp_info.set_property("cmake_target_name", "libassert::assert") + + # the first version of this library used assert/assert as include folder + # appending this one but not removing the default to not break consumers + self.cpp_info.includedirs.append(os.path.join("include", "libassert")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "libassert" + self.cpp_info.filenames["cmake_find_package_multi"] = "libassert" + self.cpp_info.names["cmake_find_package"] = "libassert" + self.cpp_info.names["cmake_find_package_multi"] = "libassert" + + self.cpp_info.components["assert"].names["cmake_find_package"] = "assert" + self.cpp_info.components["assert"].names["cmake_find_package_multi"] = "assert" + self.cpp_info.components["assert"].requires = ["cpptrace::cpptrace"] + self.cpp_info.components["assert"].libs = ["assert"] + if not self.options.shared: + self.cpp_info.components["assert"].defines.append("LIBASSERT_STATIC_DEFINE") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.requires = ["cpptrace::cpptrace"] diff --git a/recipes/libassert/v2/patches/2.0.0/0001-fix-export-and-include.patch b/recipes/libassert/v2/patches/2.0.0/0001-fix-export-and-include.patch new file mode 100644 index 0000000000000..199fdd0350b42 --- /dev/null +++ b/recipes/libassert/v2/patches/2.0.0/0001-fix-export-and-include.patch @@ -0,0 +1,13 @@ +diff --git a/include/libassert/assert-gtest.hpp b/include/libassert/assert-gtest.hpp +index 912da40..57dbc91 100644 +--- a/include/libassert/assert-gtest.hpp ++++ b/include/libassert/assert-gtest.hpp +@@ -6,8 +6,6 @@ + #define LIBASSERT_PREFIX_ASSERTIONS + #include + +-#include "tokenizer.hpp" +- + #if defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL != 0 + #error "Libassert integration does not work with MSVC's non-conformant preprocessor. /Zc:preprocessor must be used." + #endif diff --git a/recipes/libassert/v2/patches/2.0.1/0001-fix-string_view-detection.patch b/recipes/libassert/v2/patches/2.0.1/0001-fix-string_view-detection.patch new file mode 100644 index 0000000000000..ca09e305589b6 --- /dev/null +++ b/recipes/libassert/v2/patches/2.0.1/0001-fix-string_view-detection.patch @@ -0,0 +1,58 @@ +diff --git a/src/microfmt.hpp b/src/microfmt.hpp +index 0f750c3..59f5eea 100644 +--- a/src/microfmt.hpp ++++ b/src/microfmt.hpp +@@ -10,7 +10,7 @@ + #include + #include + #include +-#if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #include + #endif + #ifdef _MSC_VER +@@ -118,7 +118,7 @@ namespace microfmt { + int64_value, + uint64_value, + string_value, +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + string_view_value, + #endif + c_string_value, +@@ -128,7 +128,7 @@ namespace microfmt { + std::int64_t int64_value; + std::uint64_t uint64_value; + const std::string* string_value; +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + std::string_view string_view_value; + #endif + const char* c_string_value; +@@ -147,7 +147,7 @@ namespace microfmt { + format_value(unsigned long int_val) : uint64_value(int_val), value(value_type::uint64_value) {} + format_value(unsigned long long int_val) : uint64_value(int_val), value(value_type::uint64_value) {} + format_value(const std::string& string) : string_value(&string), value(value_type::string_value) {} +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + format_value(std::string_view sv) : string_view_value(sv), value(value_type::string_view_value) {} + #endif + format_value(const char* c_string) : c_string_value(c_string), value(value_type::c_string_value) {} +@@ -187,7 +187,7 @@ namespace microfmt { + case value_type::string_value: + do_write(out, string_value->begin(), string_value->end(), options); + break; +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + case value_type::string_view_value: + do_write(out, string_view_value.begin(), string_view_value.end(), options); + break; +@@ -302,7 +302,7 @@ namespace microfmt { + } + } + +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + template + std::string format(std::string_view fmt, Args&&... args) { + return detail::format(fmt.begin(), fmt.end(), {detail::format_value(args)...}); diff --git a/recipes/libassert/v2/patches/2.1.0/0001-msvc-ice.patch b/recipes/libassert/v2/patches/2.1.0/0001-msvc-ice.patch new file mode 100644 index 0000000000000..5e0ad013faca0 --- /dev/null +++ b/recipes/libassert/v2/patches/2.1.0/0001-msvc-ice.patch @@ -0,0 +1,32 @@ +diff --git a/src/utils.hpp b/src/utils.hpp +index 80b7ca4..18b90e5 100644 +--- a/src/utils.hpp ++++ b/src/utils.hpp +@@ -97,7 +97,8 @@ namespace libassert::detail { + } + }; + +- // note: the use of U here is mainly to workaround a gcc 8 issue https://godbolt.org/z/bdsWhdGj3 ++ #if LIBASSERT_IS_GCC && LIBASSERT_GCC_VERSION < 900 ++ // note: the use of U here is to workaround a gcc 8 issue https://godbolt.org/z/bdsWhdGj3 + template + constexpr std::array, N> to_array_impl(U(&&a)[N], std::index_sequence) { + return {{std::move(a[I])...}}; +@@ -106,6 +107,17 @@ namespace libassert::detail { + constexpr std::array, N> to_array(U(&&a)[N]) { + return to_array_impl(std::move(a), std::make_index_sequence{}); + } ++ #else ++ // unfortunately the above workaround ICEs MSVC https://godbolt.org/z/bjMEcY9fM ++ template ++ constexpr std::array, N> to_array_impl(T(&&a)[N], std::index_sequence) { ++ return {{std::move(a[I])...}}; ++ } ++ template ++ constexpr std::array, N> to_array(T(&&a)[N]) { ++ return to_array_impl(std::move(a), std::make_index_sequence{}); ++ } ++ #endif + + template + constexpr void constexpr_swap(A& a, B& b) { diff --git a/recipes/libassert/v2/test_package/CMakeLists.txt b/recipes/libassert/v2/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..af9ab923ee8f6 --- /dev/null +++ b/recipes/libassert/v2/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + + +add_executable(${PROJECT_NAME} test_package.cpp) + +find_package(libassert REQUIRED CONFIG) +target_link_libraries(${PROJECT_NAME} PRIVATE libassert::assert) + +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libassert/v2/test_package/conanfile.py b/recipes/libassert/v2/test_package/conanfile.py new file mode 100644 index 0000000000000..a804618d0f86f --- /dev/null +++ b/recipes/libassert/v2/test_package/conanfile.py @@ -0,0 +1,30 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libassert/v2/test_package/test_package.cpp b/recipes/libassert/v2/test_package/test_package.cpp new file mode 100644 index 0000000000000..2b1f1ea26d9ee --- /dev/null +++ b/recipes/libassert/v2/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include +#include +#include + +int main(void) { + std::cout << "Testing libassert\n"; + + libassert::set_failure_handler([](const libassert::assertion_info& info) { + std::cerr< + +#include + +int main() { + boxes::RingBuffer buf; + buf.push_back(123); + + if (buf.size() == 1 && buf.front() == 123) { + std::cout << "libboxes::RingBuffer works!" << std::endl; + } else { + std::cout << "libboxes::RingBuffer is broken!" << std::endl; + } + + return 0; +} diff --git a/recipes/libboxes/config.yml b/recipes/libboxes/config.yml new file mode 100644 index 0000000000000..b893ff21f7c23 --- /dev/null +++ b/recipes/libboxes/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.1": + folder: all diff --git a/recipes/libbsd/all/conandata.yml b/recipes/libbsd/all/conandata.yml index 5c7d8675d858e..fe3e56bc2a2d1 100644 --- a/recipes/libbsd/all/conandata.yml +++ b/recipes/libbsd/all/conandata.yml @@ -8,3 +8,7 @@ patches: patch_description: "Enables building on MacOS" patch_type: "portability" patch_source: "https://github.com/NixOS/nixpkgs/blob/1016bfcff1df163aff75d908df1e00f897a29b9b/pkgs/development/libraries/libbsd/darwin.patch" + - patch_file: "patches/0002-fix-getentropy-conditional.patch" + patch_description: "Fix check if getentropy needs building" + patch_type: "backport" + patch_source: "https://gitlab.freedesktop.org/libbsd/libbsd/-/commit/5cfa39e5cde6b64ccf3d1335cee4d4744d4ce242.patch" diff --git a/recipes/libbsd/all/patches/0002-fix-getentropy-conditional.patch b/recipes/libbsd/all/patches/0002-fix-getentropy-conditional.patch new file mode 100644 index 0000000000000..4c7cb9a8e5cf7 --- /dev/null +++ b/recipes/libbsd/all/patches/0002-fix-getentropy-conditional.patch @@ -0,0 +1,31 @@ +From 5cfa39e5cde6b64ccf3d1335cee4d4744d4ce242 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 23 Nov 2022 23:42:49 +0100 +Subject: [PATCH] =?UTF-8?q?build:=20Use=20=C2=AByes=C2=BB=20instead=20of?= + =?UTF-8?q?=20=C2=ABtrue=C2=BB=20for=20AC=5FCHECK=5FFUNCS=20cache=20value?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This autoconf macro sets the ac_cv_func_ cached variable to «yes» not +«true» so we were checking for an impossible condition. +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 17d113c..842f5d6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -173,7 +173,7 @@ AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \ + getauxval getentropy getexecname getline \ + pstat_getproc sysconf \ + strlcpy strlcat strnstr strmode fpurge]) +-AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xtrue"]) ++AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xyes"]) + + AC_CONFIG_FILES([ + Makefile +-- +GitLab + diff --git a/recipes/libcoro/all/conandata.yml b/recipes/libcoro/all/conandata.yml index 1587140b431f7..4568b8acd6407 100644 --- a/recipes/libcoro/all/conandata.yml +++ b/recipes/libcoro/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.12": + url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.12.tar.gz" + sha256: "9a89f329e12fda7d6425523fb2cbd1ebaf41e0e1d41e210d93ad4f3a196333a2" "0.11.1": url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.11.1.tar.gz" sha256: "c7eb1bf133519ec0e0bc2e3e018ac4d1447a143e5e7385dab19204277d7c7671" diff --git a/recipes/libcoro/all/conanfile.py b/recipes/libcoro/all/conanfile.py index 60b120e4f9dc5..0e6a519c86124 100644 --- a/recipes/libcoro/all/conanfile.py +++ b/recipes/libcoro/all/conanfile.py @@ -13,10 +13,10 @@ class LibcoroConan(ConanFile): name = "libcoro" description = "C++20 coroutine library" - 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" + topics = ("coroutines", "concurrency", "tasks", "executors", "networking") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { diff --git a/recipes/libcoro/config.yml b/recipes/libcoro/config.yml index a682e35c6d452..2dd41938c3d09 100644 --- a/recipes/libcoro/config.yml +++ b/recipes/libcoro/config.yml @@ -1,4 +1,6 @@ versions: + "0.12": + folder: all "0.11.1": folder: all "0.10": diff --git a/recipes/libcurl/all/conandata.yml b/recipes/libcurl/all/conandata.yml index 1d6933bdf0eb3..612b8f0180798 100644 --- a/recipes/libcurl/all/conandata.yml +++ b/recipes/libcurl/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "8.8.0": + url: + - "https://curl.se/download/curl-8.8.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_8_0/curl-8.8.0.tar.xz" + sha256: "0f58bb95fc330c8a46eeb3df5701b0d90c9d9bfcc42bd1cd08791d12551d4400" "8.6.0": url: - "https://curl.se/download/curl-8.6.0.tar.xz" @@ -19,21 +24,11 @@ sources: - "https://curl.se/download/curl-8.2.1.tar.xz" - "https://github.com/curl/curl/releases/download/curl-8_2_1/curl-8.2.1.tar.xz" sha256: "dd322f6bd0a20e6cebdfd388f69e98c3d183bed792cf4713c8a7ef498cba4894" - "8.2.0": - url: - - "https://curl.se/download/curl-8.2.0.tar.xz" - - "https://github.com/curl/curl/releases/download/curl-8_2_0/curl-8.2.0.tar.xz" - sha256: "2859ec79e2cd96e976a99493547359b8001af1d1e21f3a3a3b846544ef54500f" "8.1.2": url: - "https://curl.se/download/curl-8.1.2.tar.xz" - "https://github.com/curl/curl/releases/download/curl-8_1_2/curl-8.1.2.tar.xz" sha256: "31b1118eb8bfd43cd95d9a3f146f814ff874f6ed3999b29d94f4d1e7dbac5ef6" - "8.1.1": - url: - - "https://curl.se/download/curl-8.1.1.tar.xz" - - "https://github.com/curl/curl/releases/download/curl-8_1_1/curl-8.1.1.tar.xz" - sha256: "08a948e061929645597c1ef7194e07b308b22084ff03fa7400b465e6c05149e5" "8.0.1": url: - "https://curl.se/download/curl-8.0.1.tar.xz" @@ -44,48 +39,3 @@ sources: - "https://curl.se/download/curl-7.88.1.tar.xz" - "https://github.com/curl/curl/releases/download/curl-7_88_1/curl-7.88.1.tar.xz" sha256: "1dae31b2a7c1fe269de99c0c31bb488346aab3459b5ffca909d6938249ae415f" - "7.87.0": - url: - - "https://curl.se/download/curl-7.87.0.tar.xz" - - "https://github.com/curl/curl/releases/download/curl-7_87_0/curl-7.87.0.tar.xz" - sha256: "ee5f1a1955b0ed413435ef79db28b834ea5f0fb7c8cfb1ce47175cc3bee08fff" - "7.86.0": - url: - - "https://curl.se/download/curl-7.86.0.tar.xz" - - "https://github.com/curl/curl/releases/download/curl-7_86_0/curl-7.86.0.tar.xz" - sha256: "2d61116e5f485581f6d59865377df4463f2e788677ac43222b496d4e49fb627b" - "7.85.0": - url: - - "https://curl.se/download/curl-7.85.0.tar.xz" - - "https://github.com/curl/curl/releases/download/curl-7_85_0/curl-7.85.0.tar.xz" - sha256: "88b54a6d4b9a48cb4d873c7056dcba997ddd5b7be5a2d537a4acb55c20b04be6" - "7.84.0": - url: - - "https://curl.se/download/curl-7.84.0.tar.xz" - - "https://github.com/curl/curl/releases/download/curl-7_84_0/curl-7.84.0.tar.xz" - sha256: "2d118b43f547bfe5bae806d8d47b4e596ea5b25a6c1f080aef49fbcd817c5db8" - "7.83.1": - url: - - "https://curl.se/download/curl-7.83.1.tar.xz" - - "https://github.com/curl/curl/releases/download/curl-7_83_1/curl-7.83.1.tar.xz" - sha256: "2cb9c2356e7263a1272fd1435ef7cdebf2cd21400ec287b068396deb705c22c4" - "7.82.0": - url: - - "https://curl.se/download/curl-7.82.0.tar.xz" - - "https://github.com/curl/curl/releases/download/curl-7_82_0/curl-7.82.0.tar.xz" - sha256: "0aaa12d7bd04b0966254f2703ce80dd5c38dbbd76af0297d3d690cdce58a583c" - "7.80.0": - url: - - "https://curl.se/download/curl-7.80.0.tar.xz" - - "https://github.com/curl/curl/releases/download/curl-7_80_0/curl-7.80.0.tar.xz" - sha256: "a132bd93188b938771135ac7c1f3ac1d3ce507c1fcbef8c471397639214ae2ab" - "7.79.1": - url: - - "https://curl.se/download/curl-7.79.1.tar.xz" - - "https://github.com/curl/curl/releases/download/curl-7_79_1/curl-7.79.1.tar.xz" - sha256: "0606f74b1182ab732a17c11613cbbaf7084f2e6cca432642d0e3ad7c224c3689" - "7.78.0": - url: - - "https://curl.se/download/curl-7.78.0.tar.xz" - - "https://github.com/curl/curl/releases/download/curl-7_78_0/curl-7.78.0.tar.xz" - sha256: "be42766d5664a739c3974ee3dfbbcbe978a4ccb1fe628bb1d9b59ac79e445fb5" diff --git a/recipes/libcurl/all/conanfile.py b/recipes/libcurl/all/conanfile.py index 41ce8fa327a98..81baf51c83f26 100644 --- a/recipes/libcurl/all/conanfile.py +++ b/recipes/libcurl/all/conanfile.py @@ -64,6 +64,7 @@ class LibcurlConan(ConanFile): "with_cookies": [True, False], "with_ipv6": [True, False], "with_docs": [True, False], + "with_misc_docs": [True, False], "with_verbose_debug": [True, False], "with_symbol_hiding": [True, False], "with_unix_sockets": [True, False], @@ -109,6 +110,7 @@ class LibcurlConan(ConanFile): "with_cookies": True, "with_ipv6": True, "with_docs": False, + "with_misc_docs": False, "with_verbose_debug": True, "with_symbol_hiding": False, "with_unix_sockets": True, @@ -134,10 +136,6 @@ def _is_win_x_android(self): def _is_using_cmake_build(self): return is_msvc(self) or self._is_win_x_android - @property - def _has_with_libpsl_option(self): - return not (self._is_using_cmake_build and Version(self.version) < "7.84.0") - def export_sources(self): copy(self, "lib_Makefile_add.am", self.recipe_folder, self.export_sources_folder) export_conandata_patches(self) @@ -145,15 +143,11 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if not self._has_with_libpsl_option: - del self.options.with_libpsl if self._is_using_cmake_build: del self.options.with_libgsasl - # Before 7.86.0, enabling unix sockets configure option would fail on windows - # It was fixed with this PR: https://github.com/curl/curl/pull/9688 - if self._is_mingw and Version(self.version) < "7.86.0": - del self.options.with_unix_sockets + if Version(self.version) < "8.7.0": + del self.options.with_misc_docs # Default options self.options.with_ssl = "darwinssl" if is_apple_os(self) else "openssl" @@ -188,7 +182,7 @@ def requirements(self): if self.options.with_zstd: self.requires("zstd/1.5.5") if self.options.with_c_ares: - self.requires("c-ares/1.25.0") + self.requires("c-ares/[>=1.27 <2]") if self.options.get_safe("with_libpsl"): self.requires("libpsl/0.21.1") @@ -287,7 +281,10 @@ def _patch_autotools(self): # - link errors if mingw shared or iOS/tvOS/watchOS # - it makes recipe consistent with CMake build where we don't build curl tool top_makefile = os.path.join(self.source_folder, "Makefile.am") - replace_in_file(self, top_makefile, "SUBDIRS = lib src", "SUBDIRS = lib") + if Version(self.version) < "8.8.0": + replace_in_file(self, top_makefile, "SUBDIRS = lib src", "SUBDIRS = lib") + else: + replace_in_file(self, top_makefile, "SUBDIRS = lib docs src scripts", "SUBDIRS = lib") replace_in_file(self, top_makefile, "include src/Makefile.inc", "") # zlib naming is not always very consistent @@ -349,11 +346,10 @@ def _patch_cmake(self): replace_in_file(self, cmakelists, "${CARES_LIBRARY}", "c-ares::cares") # libpsl - if self._has_with_libpsl_option: - replace_in_file(self, cmakelists, "find_package(LibPSL)", "find_package(libpsl REQUIRED CONFIG)") - replace_in_file(self, cmakelists, "if(LIBPSL_FOUND)", "if(libpsl_FOUND)") - replace_in_file(self, cmakelists, "${LIBPSL_LIBRARY}", "libpsl::libpsl") - replace_in_file(self, cmakelists, "${LIBPSL_INCLUDE_DIR}", "${libpsl_INCLUDE_DIRS}") + replace_in_file(self, cmakelists, "find_package(LibPSL)", "find_package(libpsl REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "if(LIBPSL_FOUND)", "if(libpsl_FOUND)") + replace_in_file(self, cmakelists, "${LIBPSL_LIBRARY}", "libpsl::libpsl") + replace_in_file(self, cmakelists, "${LIBPSL_INCLUDE_DIR}", "${libpsl_INCLUDE_DIRS}") # libssh2 replace_in_file(self, cmakelists, "find_package(LibSSH2)", "find_package(Libssh2 REQUIRED CONFIG)") @@ -373,17 +369,17 @@ def _patch_cmake(self): # INTERFACE_LIBRARY (generated by the cmake_find_package generator) targets doesn't have the LOCATION property. # So skipp the LOCATION check in the CMakeLists.txt - if Version(self.version) >= "7.80.0": - replace_in_file(self, - cmakelists, - 'get_target_property(_lib "${_libname}" LOCATION)', - """get_target_property(_type "${_libname}" TYPE) + replace_in_file( + self, + cmakelists, + 'get_target_property(_lib "${_libname}" LOCATION)', + """get_target_property(_type "${_libname}" TYPE) if(${_type} STREQUAL "INTERFACE_LIBRARY") # Reading the INTERFACE_LIBRARY property on non-imported target will error out. continue() endif() get_target_property(_lib "${_libname}" LOCATION)""", - ) + ) def _yes_no(self, value): return "yes" if value else "no" @@ -445,7 +441,7 @@ def _generate_with_autotools(self): tc.configure_args.append(f"--with-wolfssl={path}") else: tc.configure_args.append("--without-wolfssl") - + if self.options.with_ssl == "mbedtls": path = unix_path(self, self.dependencies["mbedtls"].package_folder) tc.configure_args.append(f"--with-mbedtls={path}") @@ -498,6 +494,12 @@ def _generate_with_autotools(self): tc.configure_args.append(f"--with-ca-fallback={self._yes_no(self.options.with_ca_fallback)}") + if "with_misc_docs" in self.options: + if self.options.with_misc_docs: + tc.configure_args.append("--enable-docs") + else: + tc.configure_args.append("--disable-docs") + # Cross building flags if cross_building(self): if self.settings.os == "Linux" and "arm" in self.settings.arch: @@ -523,7 +525,6 @@ def _generate_with_autotools(self): if self.settings.os != "Windows": tc.fpic = self.options.get_safe("fPIC", True) - if cross_building(self) and is_apple_os(self): tc.extra_defines.extend(['HAVE_SOCKET', 'HAVE_FCNTL_O_NONBLOCK']) @@ -567,32 +568,16 @@ def _generate_with_cmake(self): tc.variables["BUILD_SHARED_LIBS"] = self.options.shared tc.variables["CURL_STATICLIB"] = not self.options.shared tc.variables["CMAKE_DEBUG_POSTFIX"] = "" - if Version(self.version) >= "7.81.0": - tc.variables["CURL_USE_SCHANNEL"] = self.options.with_ssl == "schannel" - else: - tc.variables["CMAKE_USE_SCHANNEL"] = self.options.with_ssl == "schannel" - if Version(self.version) >= "7.81.0": - tc.variables["CURL_USE_OPENSSL"] = self.options.with_ssl == "openssl" - else: - tc.variables["CMAKE_USE_OPENSSL"] = self.options.with_ssl == "openssl" - if Version(self.version) >= "7.81.0": - tc.variables["CURL_USE_WOLFSSL"] = self.options.with_ssl == "wolfssl" - else: - tc.variables["CMAKE_USE_WOLFSSL"] = self.options.with_ssl == "wolfssl" - if Version(self.version) >= "7.81.0": - tc.variables["CURL_USE_MBEDTLS"] = self.options.with_ssl == "mbedtls" - else: - tc.variables["CMAKE_USE_MBEDTLS"] = self.options.with_ssl == "mbedtls" + tc.variables["CURL_USE_SCHANNEL"] = self.options.with_ssl == "schannel" + tc.variables["CURL_USE_OPENSSL"] = self.options.with_ssl == "openssl" + tc.variables["CURL_USE_WOLFSSL"] = self.options.with_ssl == "wolfssl" + tc.variables["CURL_USE_MBEDTLS"] = self.options.with_ssl == "mbedtls" tc.variables["USE_NGHTTP2"] = self.options.with_nghttp2 tc.variables["CURL_ZLIB"] = self.options.with_zlib tc.variables["CURL_BROTLI"] = self.options.with_brotli tc.variables["CURL_ZSTD"] = self.options.with_zstd - if self._has_with_libpsl_option: - tc.variables["CURL_USE_LIBPSL"] = self.options.with_libpsl - if Version(self.version) >= "7.81.0": - tc.variables["CURL_USE_LIBSSH2"] = self.options.with_libssh2 - else: - tc.variables["CMAKE_USE_LIBSSH2"] = self.options.with_libssh2 + tc.variables["CURL_USE_LIBPSL"] = self.options.with_libpsl + tc.variables["CURL_USE_LIBSSH2"] = self.options.with_libssh2 tc.variables["ENABLE_ARES"] = self.options.with_c_ares if not self.options.with_c_ares: tc.variables["ENABLE_THREADED_RESOLVER"] = self.options.with_threaded_resolver @@ -680,6 +665,7 @@ def package_info(self): self.cpp_info.components["curl"].system_libs.append("crypt32") elif is_apple_os(self): self.cpp_info.components["curl"].frameworks.append("CoreFoundation") + self.cpp_info.components["curl"].frameworks.append("CoreServices") self.cpp_info.components["curl"].frameworks.append("SystemConfiguration") if self.options.with_ldap: self.cpp_info.components["curl"].system_libs.append("ldap") diff --git a/recipes/libcurl/config.yml b/recipes/libcurl/config.yml index ba6c695e81b4c..74fce7bdf4ef1 100644 --- a/recipes/libcurl/config.yml +++ b/recipes/libcurl/config.yml @@ -1,4 +1,6 @@ versions: + "8.8.0": + folder: all "8.6.0": folder: all "8.5.0": @@ -7,31 +9,9 @@ versions: folder: all "8.2.1": folder: all - "8.2.0": - folder: all "8.1.2": folder: all - "8.1.1": - folder: all "8.0.1": folder: all "7.88.1": folder: all - "7.87.0": - folder: all - "7.86.0": - folder: all - "7.85.0": - folder: all - "7.84.0": - folder: all - "7.83.1": - folder: all - "7.82.0": - folder: all - "7.80.0": - folder: all - "7.79.1": - folder: all - "7.78.0": - folder: all diff --git a/recipes/libcvd/all/conandata.yml b/recipes/libcvd/all/conandata.yml new file mode 100644 index 0000000000000..8c0de4fe10731 --- /dev/null +++ b/recipes/libcvd/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.5.1": + url: "https://github.com/edrosten/libcvd/archive/refs/tags/RELEASE_2_5_1.tar.gz" + sha256: "c077e426e1bd6e6c7af3b9330ec1496a59789f2d0c529dc18049fc653947dd6e" diff --git a/recipes/libcvd/all/conanfile.py b/recipes/libcvd/all/conanfile.py new file mode 100644 index 0000000000000..da62d0fad1d30 --- /dev/null +++ b/recipes/libcvd/all/conanfile.py @@ -0,0 +1,171 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, save, rmdir, replace_in_file +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class LibCVDConan(ConanFile): + name = "libcvd" + description = "libCVD - efficient and easy-to-use C++ computer vision library" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/edrosten/libcvd" + topics = ("computer-vision",) + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libjpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], + "with_libpng": [True, False], + "with_libtiff": [True, False], + "with_ffmpeg": [True, False], + "with_libdc1394": [True, False], + "with_opengl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libjpeg": "libjpeg", + "with_libpng": True, + "with_libtiff": True, + # Build without video support by default + "with_ffmpeg": False, + "with_libdc1394": False, + "with_opengl": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "5", + "apple-clang": "10", + "msvc": "191", + "Visual Studio": "15", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + # OpenGL is always used on Windows + del self.options.with_opengl + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # https://github.com/edrosten/libcvd/blob/main/cmake/CVDFindAllDeps.cmake + # Used in a public header https://github.com/edrosten/libcvd/blob/RELEASE_2_5_0/cvd/canny.h#L4 + self.requires("toon/3.2", transitive_headers=True, transitive_libs=True) + if self.options.with_ffmpeg: + # FFMPEG v5.x+ are not supported + self.requires("ffmpeg/4.4.4", transitive_libs=True) + if self.options.with_libdc1394: + # FIXME: libidc1394 seems to be missing raw1394 dependency + # test_package fails with "undefined reference to `raw1394_new_handle'" etc + self.requires("libdc1394/2.2.7") + if self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/3.0.2") + elif self.options.with_libjpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_libjpeg == "mozjpeg": + self.requires("mozjpeg/4.1.5") + if self.options.with_libpng: + self.requires("libpng/[>=1.6 <2]") + if self.options.with_libtiff: + self.requires("libtiff/4.6.0") + if self.options.get_safe("with_opengl", True): + # https://github.com/edrosten/libcvd/blob/RELEASE_2_5_0/cvd/videodisplay.h#L18-L20 + self.requires("opengl/system", transitive_headers=True, transitive_libs=True) + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CVD_ENABLE_TESTS"] = False + tc.variables["CVD_ENABLE_PROGS"] = False + tc.variables["CVD_ENABLE_EXAMPLES"] = False + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_ffmpeg"] = not self.options.with_ffmpeg + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_libdc1394"] = not self.options.with_libdc1394 + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_JPEG"] = not self.options.with_libjpeg + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_PNG"] = not self.options.with_libpng + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_TIFF"] = not self.options.with_libtiff + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_OpenGL"] = not self.options.get_safe("with_opengl", True) + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_X11"] = not self.options.get_safe("with_opengl", True) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("ffmpeg", "cmake_file_name", "CVD_FFMPEG") + deps.set_property("libdc1394", "cmake_file_name", "CVD_dc1394v2") + deps.set_property("toon", "cmake_file_name", "CVD_TooN") + deps.generate() + + def _patch_sources(self): + # Use deps from Conan + save(self, os.path.join(self.source_folder, "cmake", "CVDFindFFMPEG.cmake"), + "find_package(CVD_FFMPEG REQUIRED)\n" if self.options.with_ffmpeg else "") + save(self, os.path.join(self.source_folder, "cmake", "CVDFinddc1394v2.cmake"), + "find_package(CVD_dc1394v2 REQUIRED)\n" if self.options.with_libdc1394 else "") + save(self, os.path.join(self.source_folder, "cmake", "CVDFindTooN.cmake"), + "set(CVD_TooN_FOUND FALSE)\n") + + # For debugging + save(self, os.path.join(self.source_folder, "cmake", "CVDFindAllDeps.cmake"), + '\nmessage(INFO "CVD_DEP_LIBS: ${CVD_DEP_LIBS}")\n', append=True) + + # Install DLL + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)", + "install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin)") + + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CVD") + self.cpp_info.set_property("cmake_target_name", "cvd") + self.cpp_info.set_property("cmake_find_mode", "both") + + postfix = "_debug" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = ["cvd" + postfix] + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/libcvd/all/test_package/CMakeLists.txt b/recipes/libcvd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..22605b8561ab7 --- /dev/null +++ b/recipes/libcvd/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(CVD REQUIRED MODULE) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ${CVD_LIBRARIES}) +target_include_directories(${PROJECT_NAME} PRIVATE ${CVD_INCLUDE_DIRS}) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libcvd/all/test_package/conanfile.py b/recipes/libcvd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/libcvd/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libcvd/all/test_package/test_package.cpp b/recipes/libcvd/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4e0988c93bbd2 --- /dev/null +++ b/recipes/libcvd/all/test_package/test_package.cpp @@ -0,0 +1,85 @@ +// https://github.com/edrosten/libcvd/blob/RELEASE_2_5_0/examples/distance_transform.cc + +// Copyright (c) 2005--2013, The Authors +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +#include +#include + +using CVD::byte; +using CVD::euclidean_distance_transform_sq; +using CVD::Image; +using CVD::ImageRef; +using CVD::img_save; +using CVD::Rgb; +using std::max_element; +using std::mt19937; +using std::uniform_int_distribution; + +int main() +{ + //Create a blank image. + Image im(ImageRef(128, 128), 0); + + mt19937 engine; + uniform_int_distribution rand_x(0, im.size().x - 1); + uniform_int_distribution rand_y(0, im.size().y - 1); + + //Scatter down 7 points at random. + for(int i = 1; i < 8; i++) + im[rand_y(engine)][rand_x(engine)] = i; + + Image dt(im.size()); + Image inverse_dt(im.size()); + + //Perform the distance transform + euclidean_distance_transform_sq(im, dt, inverse_dt); + + //Create an output which is the distance transfom of the input, + //but coloured according to which pixel is closest. + int largest_distance = *max_element(dt.begin(), dt.end()); + + Image> out(im.size()); + + for(int y = 0; y < im.size().y; y++) + for(int x = 0; x < im.size().x; x++) + { + int c = floor(sqrt(dt[y][x] * 1.0 / largest_distance) * 255 + .5); + + Rgb r(0, 0, 0); + if(im[inverse_dt[y][x]] & 1) + r.red = c; + if(im[inverse_dt[y][x]] & 2) + r.green = c; + if(im[inverse_dt[y][x]] & 4) + r.blue = c; + + out[y][x] = r; + } + + img_save(out, "distance_transform_result.png"); +} diff --git a/recipes/libcvd/config.yml b/recipes/libcvd/config.yml new file mode 100644 index 0000000000000..eab83a303df52 --- /dev/null +++ b/recipes/libcvd/config.yml @@ -0,0 +1,3 @@ +versions: + "2.5.1": + folder: all diff --git a/recipes/libdeflate/all/conandata.yml b/recipes/libdeflate/all/conandata.yml index 720157d82ac2b..96cfe2bce2928 100644 --- a/recipes/libdeflate/all/conandata.yml +++ b/recipes/libdeflate/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.20": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.20.tar.gz" + sha256: "ed1454166ced78913ff3809870a4005b7170a6fd30767dc478a09b96847b9c2a" "1.19": url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.19.tar.gz" sha256: "27bf62d71cd64728ff43a9feb92f2ac2f2bf748986d856133cc1e51992428c25" diff --git a/recipes/libdeflate/config.yml b/recipes/libdeflate/config.yml index fe3db2bc74050..1214fb379a2c9 100644 --- a/recipes/libdeflate/config.yml +++ b/recipes/libdeflate/config.yml @@ -1,4 +1,6 @@ versions: + "1.20": + folder: "all" "1.19": folder: "all" "1.18": diff --git a/recipes/libdisplay-info/all/conandata.yml b/recipes/libdisplay-info/all/conandata.yml index 916fa487be227..8019b0f27fc6e 100644 --- a/recipes/libdisplay-info/all/conandata.yml +++ b/recipes/libdisplay-info/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.0": + url: "https://gitlab.freedesktop.org/emersion/libdisplay-info/-/archive/0.2.0/libdisplay-info-0.2.0.tar.bz2" + sha256: "f6cf2ddbba3753ae38de5113d1fcb8fab977dfaf5fb07b38cd68d8482765e208" "0.1.1": url: "https://gitlab.freedesktop.org/emersion/libdisplay-info/-/archive/0.1.1/libdisplay-info-0.1.1.tar.bz2" sha256: "51cdb0362882ca2af62532ab4d95e60d81e9890b339264719fd55f8e3945d695" diff --git a/recipes/libdisplay-info/config.yml b/recipes/libdisplay-info/config.yml index b893ff21f7c23..cc2bbccb73a1b 100644 --- a/recipes/libdisplay-info/config.yml +++ b/recipes/libdisplay-info/config.yml @@ -1,3 +1,5 @@ versions: + "0.2.0": + folder: all "0.1.1": folder: all diff --git a/recipes/libdrm/all/conanfile.py b/recipes/libdrm/all/conanfile.py index af355e6b5b875..be977e2be8299 100644 --- a/recipes/libdrm/all/conanfile.py +++ b/recipes/libdrm/all/conanfile.py @@ -9,7 +9,7 @@ from conan.tools.meson import MesonToolchain, Meson from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class LibdrmConan(ConanFile): @@ -80,7 +80,7 @@ def layout(self): def requirements(self): if self.options.intel: self.requires("libpciaccess/0.17") - if self.settings.os in ["Linux", "FreeBSD"]: + if self.settings.os == "Linux": self.requires("linux-headers-generic/6.5.9") def validate(self): @@ -88,9 +88,9 @@ def validate(self): raise ConanInvalidConfiguration("libdrm supports only Linux or FreeBSD") def build_requirements(self): - self.tool_requires("meson/1.3.0") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.1.0") + self.tool_requires("pkgconf/2.2.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -116,8 +116,9 @@ def generate(self): else: tc.project_options[o] = "true" if getattr(self.options, o) else "false" - tc.project_options["datadir"] = os.path.join(self.package_folder, "res") - tc.project_options["mandir"] = os.path.join(self.package_folder, "res", "man") + tc.project_options["datadir"] = "res" + tc.project_options["mandir"] = os.path.join("res", "man") + tc.project_options["man-pages"] = "disabled" if Version(self.version) >= "2.4.113" else "false" tc.generate() def build(self): @@ -139,7 +140,7 @@ def package_info(self): self.cpp_info.components["libdrm_libdrm"].libs = ["drm"] self.cpp_info.components["libdrm_libdrm"].includedirs.append(os.path.join("include", "libdrm")) self.cpp_info.components["libdrm_libdrm"].set_property("pkg_config_name", "libdrm") - if self.settings.os in ["Linux", "FreeBSD"]: + if self.settings.os == "Linux": self.cpp_info.components["libdrm_libdrm"].requires = ["linux-headers-generic::linux-headers-generic"] if Version(self.version) < "2.4.111": diff --git a/recipes/libelfin/all/test_package/Makefile b/recipes/libelfin/all/test_package/Makefile deleted file mode 100644 index ccf962b53e8bc..0000000000000 --- a/recipes/libelfin/all/test_package/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# From http://timelessname.com/elfbin/ - -hello: hello.asm - nasm -f elf hello.asm - gcc -m32 -s -o hello hello.o -nostartfiles -nostdlib -nodefaultlibs diff --git a/recipes/libelfin/all/test_package/conanfile.py b/recipes/libelfin/all/test_package/conanfile.py index c2a19b9121acf..d7de1f914ce42 100644 --- a/recipes/libelfin/all/test_package/conanfile.py +++ b/recipes/libelfin/all/test_package/conanfile.py @@ -24,5 +24,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindir, "test_package") - elf_path = os.path.join(self.source_folder, "hello") - self.run(f"{bin_path} {elf_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/libelfin/all/test_package/hello b/recipes/libelfin/all/test_package/hello deleted file mode 100644 index 7202f6f7d512e..0000000000000 Binary files a/recipes/libelfin/all/test_package/hello and /dev/null differ diff --git a/recipes/libelfin/all/test_package/hello.asm b/recipes/libelfin/all/test_package/hello.asm deleted file mode 100644 index 0cc26b9d3a4a8..0000000000000 --- a/recipes/libelfin/all/test_package/hello.asm +++ /dev/null @@ -1,16 +0,0 @@ - SECTION .data -msg: db "Hi World",10 -len: equ $-msg - - SECTION .text - global main -main: - mov edx,len - mov ecx,msg - mov ebx,1 - mov eax,4 - int 0x80 - mov ebx,0 - mov eax,1 - int 0x80 - diff --git a/recipes/libelfin/all/test_package/test_package.cpp b/recipes/libelfin/all/test_package/test_package.cpp index 41843df23299f..4cec1bba9e2d9 100644 --- a/recipes/libelfin/all/test_package/test_package.cpp +++ b/recipes/libelfin/all/test_package/test_package.cpp @@ -1,29 +1,8 @@ -#include +#include #include -#include -#include -#include - -int -main(int argc, char** argv) -{ - using elf::to_string; - - int fd = open(argv[1], O_RDONLY); - elf::elf f(elf::create_mmap_loader(fd)); - - auto& hdr = f.get_hdr(); - std::cout << "ELF Header:\n"; - std::cout << " Magic: " << std::hex; - for (auto c : hdr.ei_magic) - std::cout << ' ' << static_cast(c); - std::cout << '\n'; - std::cout << " Class: " << to_string(hdr.ei_class) << '\n'; - std::cout << " Data: " << to_string(hdr.ei_data) << '\n'; - std::cout << " Version: " << static_cast(hdr.ei_version) << '\n'; - std::cout << " OS/ABI: " << to_string(hdr.ei_osabi) << '\n'; - std::cout << " ABI Version: " << static_cast(hdr.ei_abiversion) << '\n'; - std::cout << " Type: " << to_string(hdr.type) << '\n'; +int main() { + elf::pt pt_obj = elf::pt::load; + std::cout << elf::to_string(pt_obj) << std::endl; return 0; } diff --git a/recipes/libenvpp/all/conandata.yml b/recipes/libenvpp/all/conandata.yml index 9ad4addaf724a..09cbdfc22a3d7 100644 --- a/recipes/libenvpp/all/conandata.yml +++ b/recipes/libenvpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.1": + url: "https://github.com/ph3at/libenvpp/archive/refs/tags/v1.4.1.tar.gz" + sha256: "1bcd0a1eb4eef32a53cbb410ae38d708ea662e491cc5536cb9b15d54cc8b5707" "1.4.0": url: "https://github.com/ph3at/libenvpp/archive/refs/tags/v1.4.0.tar.gz" sha256: "3f9a4a4b62abc06522de76e3a999cc3cd6b60299dc26b28ccc2183aa614f10cd" @@ -6,6 +9,10 @@ sources: url: "https://github.com/ph3at/libenvpp/archive/refs/tags/v1.3.0.tar.gz" sha256: "9201ae39dc67118ee46b4e60fe2e5d22b046faceae4a4b4eec6ab62bc48875dd" patches: + "1.4.1": + - patch_file: "patches/0001-use-cci-fmt.patch" + patch_description: "use cci fmt package, remove static flag from add_library" + patch_type: "conan" "1.4.0": - patch_file: "patches/0001-use-cci-fmt.patch" patch_description: "use cci fmt package, remove static flag from add_library" diff --git a/recipes/libenvpp/config.yml b/recipes/libenvpp/config.yml index 25c9b4921636c..023cefafab4f3 100644 --- a/recipes/libenvpp/config.yml +++ b/recipes/libenvpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.1": + folder: all "1.4.0": folder: all "1.3.0": diff --git a/recipes/libffi/all/conandata.yml b/recipes/libffi/all/conandata.yml index 5984134b2d8b9..4ae82714f72f8 100644 --- a/recipes/libffi/all/conandata.yml +++ b/recipes/libffi/all/conandata.yml @@ -1,17 +1,19 @@ sources: + "3.4.6": + url: "https://github.com/libffi/libffi/releases/download/v3.4.6/libffi-3.4.6.tar.gz" + sha256: "b0dea9df23c863a7a50e825440f3ebffabd65df1497108e5d437747843895a4e" "3.4.4": url: "https://github.com/libffi/libffi/releases/download/v3.4.4/libffi-3.4.4.tar.gz" sha256: "d66c56ad259a82cf2a9dfc408b32bf5da52371500b84745f7fb8b645712df676" - "3.4.3": - url: "https://github.com/libffi/libffi/releases/download/v3.4.3/libffi-3.4.3.tar.gz" - sha256: "4416dd92b6ae8fcb5b10421e711c4d3cb31203d77521a77d85d0102311e6c3b8" - "3.4.2": - url: "https://github.com/libffi/libffi/releases/download/v3.4.2/libffi-3.4.2.tar.gz" - sha256: "540fb721619a6aba3bdeef7d940d8e9e0e6d2c193595bc243241b77ff9e93620" "3.3": url: "https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz" sha256: "72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056" patches: + "3.4.6": + - patch_file: "patches/0002-3.4.6-fix-libtool-path.patch" + - patch_file: "patches/0004-3.4.6-fix-complex-type-msvc.patch" + - patch_file: "patches/0005-3.4.4-do-not-install-libraries-to-arch-dependent-directories.patch" + - patch_file: "patches/0006-3.4.6-library-no-version-suffix.patch" "3.4.4": - patch_file: "patches/0002-3.4.3-fix-libtool-path.patch" - patch_file: "patches/0004-3.3-fix-complex-type-msvc.patch" @@ -21,20 +23,6 @@ patches: patch_type: "portability" patch_source: "https://github.com/libffi/libffi/pull/764" patch_description: "Forward declare the open_temp_exec_file function which is required by the C99 standard" - "3.4.3": - - patch_file: "patches/0002-3.4.3-fix-libtool-path.patch" - - patch_file: "patches/0004-3.3-fix-complex-type-msvc.patch" - - patch_file: "patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch" - - patch_file: "patches/0006-3.4.3-library-no-version-suffix.patch" - - patch_file: "patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch" - patch_type: "portability" - patch_source: "https://github.com/libffi/libffi/pull/764" - patch_description: "Forward declare the open_temp_exec_file function which is required by the C99 standard" - "3.4.2": - - patch_file: "patches/0002-3.4.2-fix-libtool-path.patch" - - patch_file: "patches/0004-3.3-fix-complex-type-msvc.patch" - - patch_file: "patches/0005-3.4.2-do-not-install-libraries-to-arch-dependent-directories.patch" - - patch_file: "patches/0006-3.4.2-library-no-version-suffix.patch" "3.3": - patch_file: "patches/0002-3.3-fix-libtool-path.patch" - patch_file: "patches/0004-3.3-fix-complex-type-msvc.patch" diff --git a/recipes/libffi/all/conanfile.py b/recipes/libffi/all/conanfile.py index e46a94d1b4462..cc062fca08904 100644 --- a/recipes/libffi/all/conanfile.py +++ b/recipes/libffi/all/conanfile.py @@ -1,7 +1,8 @@ from conan import ConanFile -from conan.tools.apple import fix_apple_shared_install_name +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, replace_in_file, rm, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, 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, is_msvc_static_runtime, msvc_runtime_flag, unix_path @@ -42,6 +43,10 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + + def validate(self): + if is_apple_os(self) and self.settings.arch == "armv8" and Version(self.version) < "3.4.0": + raise ConanInvalidConfiguration(f"{self.ref} does not support Apple ARM CPUs") def configure(self): if self.options.shared: @@ -78,9 +83,12 @@ def generate(self): if self._settings_build.compiler == "apple-clang": tc.configure_args.append("--disable-multi-os-directory") - tc.extra_defines.append("FFI_BUILDING") if self.options.shared: tc.extra_defines.append("FFI_BUILDING_DLL") + if Version(self.version) < "3.4.6": + tc.extra_defines.append("FFI_BUILDING") + elif not self.options.shared: + tc.extra_defines.append("FFI_STATIC_BUILD") env = tc.environment() if self._settings_build.os == "Windows" and (is_msvc(self) or self.settings.compiler == "clang"): @@ -134,22 +142,9 @@ def generate(self): env.define("INSTALL", unix_path(self, os.path.join(self.source_folder, "install-sh"))) tc.generate(env=env) - def _patch_source(self): + def build(self): apply_conandata_patches(self) - if Version(self.version) < "3.3": - if self.settings.compiler == "clang" and Version(str(self.settings.compiler.version)) >= 7.0: - # https://android.googlesource.com/platform/external/libffi/+/ca22c3cb49a8cca299828c5ffad6fcfa76fdfa77 - sysv_s_src = os.path.join(self.source_folder, "src", "arm", "sysv.S") - replace_in_file(self, sysv_s_src, "fldmiad", "vldmia") - replace_in_file(self, sysv_s_src, "fstmiad", "vstmia") - replace_in_file(self, sysv_s_src, "fstmfdd\tsp!,", "vpush") - - # https://android.googlesource.com/platform/external/libffi/+/7748bd0e4a8f7d7c67b2867a3afdd92420e95a9f - replace_in_file(self, sysv_s_src, "stmeqia", "stmiaeq") - - def build(self): - self._patch_source() autotools = Autotools(self) autotools.configure() autotools.make() @@ -170,4 +165,5 @@ def package_info(self): self.cpp_info.libs = ["{}ffi".format("lib" if is_msvc(self) else "")] self.cpp_info.set_property("pkg_config_name", "libffi") if not self.options.shared: - self.cpp_info.defines = ["FFI_BUILDING"] + static_define = "FFI_STATIC_BUILD" if Version(self.version) >= "3.4.6" else "FFI_BUILDING" + self.cpp_info.defines = [static_define] diff --git a/recipes/libffi/all/patches/0002-3.4.2-fix-libtool-path.patch b/recipes/libffi/all/patches/0002-3.4.2-fix-libtool-path.patch deleted file mode 100644 index fad9e64adff17..0000000000000 --- a/recipes/libffi/all/patches/0002-3.4.2-fix-libtool-path.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- configure -+++ configure -@@ -8979,7 +8979,7 @@ - LIBTOOL_DEPS=$ltmain - - # Always use our own libtool. --LIBTOOL='$(SHELL) $(top_builddir)/libtool' -+LIBTOOL='$(SHELL) $(top_builddir)/libtool.sh' - - - -@@ -9072,7 +9072,7 @@ - esac - - # Global variables: --ofile=libtool -+ofile=libtool.sh - can_build_shared=yes - - # All known linkers require a '.a' archive for static linking (except MSVC, diff --git a/recipes/libffi/all/patches/0002-3.4.6-fix-libtool-path.patch b/recipes/libffi/all/patches/0002-3.4.6-fix-libtool-path.patch new file mode 100644 index 0000000000000..e557baacf2699 --- /dev/null +++ b/recipes/libffi/all/patches/0002-3.4.6-fix-libtool-path.patch @@ -0,0 +1,20 @@ +--- configure ++++ configure +@@ -9882,7 +9882,7 @@ + LIBTOOL_DEPS=$ltmain + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)/libtool.sh' + + + +@@ -9974,7 +9974,7 @@ + esac + + # Global variables: +-ofile=libtool ++ofile=libtool.sh + can_build_shared=yes + + # All known linkers require a '.a' archive for static linking (except MSVC and diff --git a/recipes/libffi/all/patches/0004-3.4.6-fix-complex-type-msvc.patch b/recipes/libffi/all/patches/0004-3.4.6-fix-complex-type-msvc.patch new file mode 100644 index 0000000000000..4779afe0a2e85 --- /dev/null +++ b/recipes/libffi/all/patches/0004-3.4.6-fix-complex-type-msvc.patch @@ -0,0 +1,56 @@ +diff --git a/src/types.c b/src/types.c +index c1c27f3..d5d52bb 100644 +--- a/src/types.c ++++ b/src/types.c +@@ -31,6 +31,8 @@ + #include + #include + ++#include ++ + /* Type definitions */ + + #define FFI_TYPEDEF(name, type, id, maybe_const)\ +@@ -45,17 +47,17 @@ maybe_const ffi_type ffi_type_##name = { \ + id, NULL \ + } + +-#define FFI_COMPLEX_TYPEDEF(name, type, maybe_const) \ ++#define FFI_COMPLEX_TYPEDEF(name, complex_type, maybe_const) \ + static ffi_type *ffi_elements_complex_##name [2] = { \ + (ffi_type *)(&ffi_type_##name), NULL \ + }; \ + struct struct_align_complex_##name { \ + char c; \ +- _Complex type x; \ ++ complex_type x; \ + }; \ + FFI_EXTERN \ + maybe_const ffi_type ffi_type_complex_##name = { \ +- sizeof(_Complex type), \ ++ sizeof(complex_type), \ + offsetof(struct struct_align_complex_##name, x), \ + FFI_TYPE_COMPLEX, \ + (ffi_type **)ffi_elements_complex_##name \ +@@ -99,8 +101,18 @@ const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL }; + FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE, FFI_LDBL_CONST); + #endif + ++#ifdef _MSC_VER ++# define FLOAT_COMPLEX _C_float_complex ++# define DOUBLE_COMPLEX _C_double_complex ++# define LDOUBLE_COMPLEX _C_ldouble_complex ++#else ++# define FLOAT_COMPLEX float _Complex ++# define DOUBLE_COMPLEX double _Complex ++# define LDOUBLE_COMPLEX long double _Complex ++#endif ++ + #ifdef FFI_TARGET_HAS_COMPLEX_TYPE +-FFI_COMPLEX_TYPEDEF(float, float, const); +-FFI_COMPLEX_TYPEDEF(double, double, const); +-FFI_COMPLEX_TYPEDEF(longdouble, long double, FFI_LDBL_CONST); ++FFI_COMPLEX_TYPEDEF(float, FLOAT_COMPLEX, const); ++FFI_COMPLEX_TYPEDEF(double, DOUBLE_COMPLEX, const); ++FFI_COMPLEX_TYPEDEF(longdouble, LDOUBLE_COMPLEX, FFI_LDBL_CONST); + #endif diff --git a/recipes/libffi/all/patches/0005-3.4.2-do-not-install-libraries-to-arch-dependent-directories.patch b/recipes/libffi/all/patches/0005-3.4.2-do-not-install-libraries-to-arch-dependent-directories.patch deleted file mode 100644 index 8e14796ab662a..0000000000000 --- a/recipes/libffi/all/patches/0005-3.4.2-do-not-install-libraries-to-arch-dependent-directories.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Makefile.in -+++ Makefile.in -@@ -517,7 +517,7 @@ - target_os = @target_os@ - target_vendor = @target_vendor@ - toolexecdir = @toolexecdir@ --toolexeclibdir = @toolexeclibdir@ -+toolexeclibdir = @libdir@ - top_build_prefix = @top_build_prefix@ - top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ diff --git a/recipes/libffi/all/patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch b/recipes/libffi/all/patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch deleted file mode 100644 index e82abf24a4fb1..0000000000000 --- a/recipes/libffi/all/patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Makefile.in -+++ Makefile.in -@@ -520,7 +520,7 @@ - target_vendor = @target_vendor@ - tmake_file = @tmake_file@ - toolexecdir = @toolexecdir@ --toolexeclibdir = @toolexeclibdir@ -+toolexeclibdir = @libdir@ - top_build_prefix = @top_build_prefix@ - top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ diff --git a/recipes/libffi/all/patches/0006-3.4.2-library-no-version-suffix.patch b/recipes/libffi/all/patches/0006-3.4.2-library-no-version-suffix.patch deleted file mode 100644 index 80c36df06441e..0000000000000 --- a/recipes/libffi/all/patches/0006-3.4.2-library-no-version-suffix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Makefile.in -+++ Makefile.in -@@ -610,7 +610,7 @@ - @LIBFFI_BUILD_VERSIONED_SHLIB_FALSE@libffi_version_dep = - @LIBFFI_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map - @LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map-sun --libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -+libffi_version_info = -avoid-version - libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) - libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) - AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src diff --git a/recipes/libffi/all/patches/0006-3.4.3-library-no-version-suffix.patch b/recipes/libffi/all/patches/0006-3.4.3-library-no-version-suffix.patch deleted file mode 100644 index 0ad4d29b1c4ce..0000000000000 --- a/recipes/libffi/all/patches/0006-3.4.3-library-no-version-suffix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Makefile.in -+++ Makefile.in -@@ -615,7 +615,7 @@ - @LIBFFI_BUILD_VERSIONED_SHLIB_FALSE@libffi_version_dep = - @LIBFFI_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map - @LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map-sun --libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -+libffi_version_info = -avoid-version - libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) - libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) - AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src diff --git a/recipes/libffi/all/patches/0006-3.4.6-library-no-version-suffix.patch b/recipes/libffi/all/patches/0006-3.4.6-library-no-version-suffix.patch new file mode 100644 index 0000000000000..726e8c1eb4a47 --- /dev/null +++ b/recipes/libffi/all/patches/0006-3.4.6-library-no-version-suffix.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index 450200a..abcee85 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -618,7 +618,7 @@ AM_CFLAGS = $(am__append_3) + @LIBFFI_BUILD_VERSIONED_SHLIB_FALSE@libffi_version_dep = + @LIBFFI_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map + @LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map-sun +-libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version` ++libffi_version_info = -avoid-version + libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) + libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) + AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src diff --git a/recipes/libffi/config.yml b/recipes/libffi/config.yml index af3a9af92b306..e6382ec734d6d 100644 --- a/recipes/libffi/config.yml +++ b/recipes/libffi/config.yml @@ -1,9 +1,7 @@ versions: - "3.4.4": - folder: "all" - "3.4.3": + "3.4.6": folder: "all" - "3.4.2": + "3.4.4": folder: "all" "3.3": folder: "all" diff --git a/recipes/libfork/all/conandata.yml b/recipes/libfork/all/conandata.yml index 29f8392061e5d..26ad554c10e51 100644 --- a/recipes/libfork/all/conandata.yml +++ b/recipes/libfork/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.8.0": + url: "https://github.com/conorwilliams/libfork/archive/v3.8.0.tar.gz" + sha256: "53f23f0d27bb0753c0b03132f3c17bf8099617f037a2389a04e85fdd6f2736e8" "3.7.2": url: "https://github.com/conorwilliams/libfork/archive/v3.7.2.tar.gz" sha256: "0c4fbb7a6000c0a93b219b385d9834bd07bc5f19d89aa41ba8e27b5723694b15" diff --git a/recipes/libfork/all/conanfile.py b/recipes/libfork/all/conanfile.py index 003c113741bce..f2a0617be709d 100644 --- a/recipes/libfork/all/conanfile.py +++ b/recipes/libfork/all/conanfile.py @@ -8,8 +8,7 @@ required_conan_version = ">=1.53.0" - -class PackageConan(ConanFile): +class LibforkConan(ConanFile): name = "libfork" description = "A bleeding-edge, lock-free, wait-free, continuation-stealing tasking library." license = "MPL-2.0" @@ -45,7 +44,6 @@ def _compilers_minimum_version(self): def layout(self): basic_layout(self, src_folder="src") - def package_id(self): self.info.clear() @@ -59,9 +57,6 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build(self): - pass - def package(self): copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) diff --git a/recipes/libfork/all/test_package/CMakeLists.txt b/recipes/libfork/all/test_package/CMakeLists.txt index 23f7d6ffa9876..01ecf1d73c686 100644 --- a/recipes/libfork/all/test_package/CMakeLists.txt +++ b/recipes/libfork/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.15) -project(test_package CXX) +project(test_package LANGUAGES CXX) -find_package(libfork REQUIRED) +find_package(libfork REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE libfork::libfork) diff --git a/recipes/libfork/all/test_package/conanfile.py b/recipes/libfork/all/test_package/conanfile.py index 502059e940b33..8a476e09ae305 100644 --- a/recipes/libfork/all/test_package/conanfile.py +++ b/recipes/libfork/all/test_package/conanfile.py @@ -5,17 +5,17 @@ from conan.tools.build import can_run -class LibforkPackageTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" - def requirements(self): - self.requires(self.tested_reference_str) - def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/libfork/config.yml b/recipes/libfork/config.yml index a47dcb81bcc23..ee862d73f6252 100644 --- a/recipes/libfork/config.yml +++ b/recipes/libfork/config.yml @@ -1,3 +1,5 @@ versions: + "3.8.0": + folder: all "3.7.2": folder: all diff --git a/recipes/libftp/all/conandata.yml b/recipes/libftp/all/conandata.yml new file mode 100644 index 0000000000000..fa57f13e90da7 --- /dev/null +++ b/recipes/libftp/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.5.1": + url: "https://github.com/deniskovalchuk/libftp/archive/refs/tags/v0.5.1.tar.gz" + sha256: "6cc6e80b50ba425b66175d3b0d22358db4ebeb4941edc33bba47d72442de5645" + "0.5.0": + url: "https://github.com/deniskovalchuk/libftp/archive/refs/tags/v0.5.0.tar.gz" + sha256: "566d4d176bf754571e01563c4c0182a9c54b90903cd958a609fa0d6bd4c2141e" + "0.4.1": + url: "https://github.com/deniskovalchuk/libftp/archive/refs/tags/v0.4.1.tar.gz" + sha256: "873dd7647234f72fecfe57150b0a4a60f4c16611d26ad7eb687e0561f54b9eec" diff --git a/recipes/libftp/all/conanfile.py b/recipes/libftp/all/conanfile.py new file mode 100644 index 0000000000000..144e760e21d70 --- /dev/null +++ b/recipes/libftp/all/conanfile.py @@ -0,0 +1,108 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class LibFTPConan(ConanFile): + name = "libftp" + description = "A cross-platform FTP/FTPS client library based on Boost.Asio" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/deniskovalchuk/libftp" + topics = ("ftp", "ftps", "boost", "ssl", "tls", "openssl") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.84.0", transitive_headers=True) + if Version(self.version) >= "0.5.0": + self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True) + + def validate(self): + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared builds with Visual Studio.") + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBFTP_BUILD_TEST"] = False + tc.variables["LIBFTP_BUILD_EXAMPLE"] = False + tc.variables["LIBFTP_BUILD_CMDLINE_CLIENT"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["ftp"] + + self.cpp_info.set_property("cmake_file_name", "ftp") + self.cpp_info.set_property("cmake_target_name", "ftp::ftp") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/libftp/all/test_package/CMakeLists.txt b/recipes/libftp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d4b87e9e23e3a --- /dev/null +++ b/recipes/libftp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ftp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ftp::ftp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libftp/all/test_package/conanfile.py b/recipes/libftp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/libftp/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libftp/all/test_package/test_package.cpp b/recipes/libftp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..78760fc11e2a1 --- /dev/null +++ b/recipes/libftp/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include "ftp/client.hpp" + +int main(void) { + try { + ftp::client client; + } + catch (const std::exception & ex) { + std::cerr << ex.what() << std::endl; + } + return 0; +} diff --git a/recipes/libftp/config.yml b/recipes/libftp/config.yml new file mode 100644 index 0000000000000..0c42204d47369 --- /dev/null +++ b/recipes/libftp/config.yml @@ -0,0 +1,7 @@ +versions: + "0.5.1": + folder: all + "0.5.0": + folder: all + "0.4.1": + folder: all diff --git a/recipes/libgd/all/conandata.yml b/recipes/libgd/all/conandata.yml index 235cf46164b0a..1c4db40fa14b0 100644 --- a/recipes/libgd/all/conandata.yml +++ b/recipes/libgd/all/conandata.yml @@ -48,9 +48,6 @@ patches: - patch_file: "patches/2.3.x-png-msvc.patch" patch_description: "support png on msvc" patch_type: "portability" - - patch_file: "patches/2.3.1-use-cci.patch" - patch_description: "use cci's package" - patch_type: "conan" "2.3.0": - patch_file: "patches/remove-unistd-h.patch" patch_description: "remove unistd.h to fix build error" @@ -61,9 +58,6 @@ patches: - patch_file: "patches/2.3.x-png-msvc.patch" patch_description: "support png on msvc" patch_type: "conan" - - patch_file: "patches/2.3.0-use-cci.patch" - patch_description: "use cci's package" - patch_type: "conan" "2.2.5": - patch_file: "patches/2.2.5-msvc-static-lib.patch" patch_description: "support static build on msvc" @@ -71,6 +65,3 @@ patches: - patch_file: "patches/2.2.5-qualify-nondll.patch" patch_description: "use BGD_NONDLL instead NONDLL" patch_type: "conan" - - patch_file: "patches/2.2.5-use-cci.patch" - patch_description: "use cci's package" - patch_type: "conan" diff --git a/recipes/libgd/all/conanfile.py b/recipes/libgd/all/conanfile.py index 0c18187731da2..ffc0a4e68966c 100644 --- a/recipes/libgd/all/conanfile.py +++ b/recipes/libgd/all/conanfile.py @@ -26,6 +26,8 @@ class LibgdConan(ConanFile): "with_freetype": [True, False], "with_xpm": [True, False], "with_webp": [True, False], + "with_heif": [True, False], + "with_avif": [True, False], } default_options = { "shared": False, @@ -36,6 +38,8 @@ class LibgdConan(ConanFile): "with_freetype": False, "with_xpm": False, "with_webp": False, + "with_heif": False, + "with_avif": False, } def export_sources(self): @@ -44,6 +48,9 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "2.3.2": + del self.options.with_heif + del self.options.with_avif def configure(self): if self.options.shared: @@ -70,6 +77,10 @@ def requirements(self): self.requires("libxpm/3.5.13") if self.options.with_webp: self.requires("libwebp/1.3.2") + if self.options.get_safe("with_heif"): + self.requires("libheif/1.16.2") + if self.options.get_safe("with_avif"): + self.requires("libavif/1.0.4") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -90,14 +101,18 @@ def generate(self): tc.variables["ENABLE_FONTCONFIG"] = False tc.variables["ENABLE_WEBP"] = self.options.with_webp if Version(self.version) >= "2.3.2": - tc.variables["ENABLE_HEIF"] = False - tc.variables["ENABLE_AVIF"] = False + tc.variables["ENABLE_HEIF"] = self.options.get_safe("with_heif", False) + tc.variables["ENABLE_AVIF"] = self.options.get_safe("with_avif", False) if Version(self.version) >= "2.3.0": tc.variables["ENABLE_RAQM"] = False tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) + deps.set_property("libheif", "cmake_file_name", "HEIF") + deps.set_property("webp", "cmake_file_name", "WEBP") + deps.set_property("libxpm", "cmake_file_name", "XPM") + deps.set_property("freetype", "cmake_file_name", "FREETYPE") deps.generate() def _patch(self): diff --git a/recipes/libgd/all/patches/2.2.5-use-cci.patch b/recipes/libgd/all/patches/2.2.5-use-cci.patch deleted file mode 100644 index 63805346e86b3..0000000000000 --- a/recipes/libgd/all/patches/2.2.5-use-cci.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8c99816..63775fd 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -97,7 +97,7 @@ else (USE_EXT_GD) - FIND_PACKAGE(ZLIB) - - IF (ENABLE_WEBP) -- FIND_PACKAGE(WEBP) -+ FIND_PACKAGE(WebP) - ENDIF (ENABLE_WEBP) - - IF (ENABLE_LIQ) -@@ -121,7 +121,7 @@ else (USE_EXT_GD) - endif (ENABLE_FREETYPE) - - if (ENABLE_XPM) -- FIND_PACKAGE(XPM) -+ FIND_PACKAGE(libxpm) - endif (ENABLE_XPM) - - if (ENABLE_FONTCONFIG) -@@ -140,7 +140,7 @@ else (USE_EXT_GD) - ENDIF(ZLIB_FOUND) - - IF(WEBP_FOUND) -- INCLUDE_DIRECTORIES(${WEBP_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${WebP_INCLUDE_DIR}) - SET(HAVE_LIBWEBP 1) - ENDIF(WEBP_FOUND) - -@@ -161,7 +161,7 @@ else (USE_EXT_GD) - ENDIF(LIQ_FOUND) - - IF(XPM_FOUND) -- INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${libxpm_INCLUDE_DIR}) - SET(HAVE_LIBXPM 1) - ENDIF(XPM_FOUND) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 5b764eb..11d3a46 100755 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -110,15 +110,15 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S - - SET(LIBGD_DEP_LIBS - ${ZLIB_LIBRARIES} -- ${FREETYPE_LIBRARIES} -+ ${freetype_LIBRARIES} - ${PNG_LIBRARIES} - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} - ${JPEG_LIBRARIES} - ${TIFF_LIBRARIES} -- ${XPM_LIBRARIES} -+ ${libxpm_LIBRARIES} - ${FONTCONFIG_LIBRARY} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ) - if (BUILD_SHARED_LIBS) - target_link_libraries(${GD_LIB} ${LIBGD_DEP_LIBS}) diff --git a/recipes/libgd/all/patches/2.3.0-use-cci.patch b/recipes/libgd/all/patches/2.3.0-use-cci.patch deleted file mode 100644 index 6083253b1e3db..0000000000000 --- a/recipes/libgd/all/patches/2.3.0-use-cci.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index fc76868..f503436 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -113,7 +113,7 @@ else (USE_EXT_GD) - FIND_PACKAGE(ZLIB) - - IF (ENABLE_WEBP) -- FIND_PACKAGE(WEBP) -+ FIND_PACKAGE(WebP) - ENDIF (ENABLE_WEBP) - - IF (ENABLE_LIQ) -@@ -137,7 +137,7 @@ else (USE_EXT_GD) - endif (ENABLE_FREETYPE) - - if (ENABLE_XPM) -- FIND_PACKAGE(XPM) -+ FIND_PACKAGE(libxpm) - endif (ENABLE_XPM) - - if (ENABLE_FONTCONFIG) -@@ -162,7 +162,7 @@ else (USE_EXT_GD) - ENDIF(ZLIB_FOUND) - - IF(WEBP_FOUND) -- INCLUDE_DIRECTORIES(${WEBP_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${WebP_INCLUDE_DIR}) - SET(HAVE_LIBWEBP 1) - ENDIF(WEBP_FOUND) - -@@ -183,7 +183,7 @@ else (USE_EXT_GD) - ENDIF(LIQ_FOUND) - - IF(XPM_FOUND) -- INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${libxpm_INCLUDE_DIR}) - SET(HAVE_LIBXPM 1) - ENDIF(XPM_FOUND) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 98b9e64..0d676ba 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -125,14 +125,14 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S - - SET(LIBGD_DEP_LIBS - ${ZLIB_LIBRARIES} -- ${FREETYPE_LIBRARIES} -+ ${freetype_LIBRARIES} - ${PNG_LIBRARIES} - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} - ${JPEG_LIBRARIES} - ${TIFF_LIBRARIES} -- ${XPM_LIBRARIES} -+ ${libxpm_LIBRARIES} - ${FONTCONFIG_LIBRARY} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ${RAQM_LIBRARIES} - ) - if (BUILD_SHARED_LIBS) diff --git a/recipes/libgd/all/patches/2.3.1-use-cci.patch b/recipes/libgd/all/patches/2.3.1-use-cci.patch deleted file mode 100644 index 540439b9bf43a..0000000000000 --- a/recipes/libgd/all/patches/2.3.1-use-cci.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bf7836f..c4995b0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -116,7 +116,7 @@ else (USE_EXT_GD) - endif (ENABLE_ICONV) - - IF (ENABLE_WEBP) -- FIND_PACKAGE(WEBP REQUIRED) -+ FIND_PACKAGE(WebP REQUIRED) - ENDIF (ENABLE_WEBP) - - IF (ENABLE_LIQ) -@@ -140,7 +140,7 @@ else (USE_EXT_GD) - endif (ENABLE_FREETYPE) - - if (ENABLE_XPM) -- FIND_PACKAGE(XPM REQUIRED) -+ FIND_PACKAGE(libxpm REQUIRED) - endif (ENABLE_XPM) - - if (ENABLE_FONTCONFIG) -@@ -167,7 +167,7 @@ else (USE_EXT_GD) - ENDIF(ZLIB_FOUND) - - IF(WEBP_FOUND) -- INCLUDE_DIRECTORIES(${WEBP_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${WebP_INCLUDE_DIR}) - SET(HAVE_LIBWEBP 1) - ENDIF(WEBP_FOUND) - -@@ -189,7 +189,7 @@ else (USE_EXT_GD) - ENDIF(LIQ_FOUND) - - IF(XPM_FOUND) -- INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${libxpm_INCLUDE_DIR}) - SET(HAVE_LIBXPM 1) - LIST(APPEND PKG_REQUIRES_PRIVATES xpm) - ENDIF(XPM_FOUND) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index e1f8eda..47b1ee8 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -125,15 +125,15 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S - - SET(LIBGD_DEP_LIBS - ${ZLIB_LIBRARIES} -- ${FREETYPE_LIBRARIES} -+ ${freetype_LIBRARIES} - ${PNG_LIBRARIES} - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} - ${JPEG_LIBRARIES} - ${TIFF_LIBRARIES} -- ${XPM_LIBRARIES} -+ ${libxpm_LIBRARIES} - ${FONTCONFIG_LIBRARY} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ${RAQM_LIBRARIES} - ) - if (BUILD_SHARED_LIBS) -@@ -146,7 +146,7 @@ endif() - SET(LIBS_PRIVATES - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ) - - set(GD_PROGRAMS gdcmpgif) diff --git a/recipes/libgd/all/patches/2.3.2-use-cci.patch b/recipes/libgd/all/patches/2.3.2-use-cci.patch index 758709ea2bdc7..57724df5d1cec 100644 --- a/recipes/libgd/all/patches/2.3.2-use-cci.patch +++ b/recipes/libgd/all/patches/2.3.2-use-cci.patch @@ -1,69 +1,27 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 57cd95d..11a8409 100644 +index 57cd95d..f7640c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -118,7 +118,7 @@ else (USE_EXT_GD) - endif (ENABLE_ICONV) - - IF (ENABLE_WEBP) -- FIND_PACKAGE(WEBP REQUIRED) -+ FIND_PACKAGE(WebP REQUIRED) - ENDIF (ENABLE_WEBP) - - IF (ENABLE_HEIF) -@@ -153,7 +153,7 @@ else (USE_EXT_GD) - endif (ENABLE_FREETYPE) - - if (ENABLE_XPM) -- FIND_PACKAGE(XPM REQUIRED) -+ FIND_PACKAGE(libxpm REQUIRED) - endif (ENABLE_XPM) - - if (ENABLE_FONTCONFIG) -@@ -180,7 +180,7 @@ else (USE_EXT_GD) - ENDIF(ZLIB_FOUND) - - IF(WEBP_FOUND) -- INCLUDE_DIRECTORIES(${WEBP_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${WebP_INCLUDE_DIR}) - SET(HAVE_LIBWEBP 1) - ENDIF(WEBP_FOUND) - -@@ -207,7 +207,7 @@ else (USE_EXT_GD) - ENDIF(LIQ_FOUND) - - IF(XPM_FOUND) -- INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${libxpm_INCLUDE_DIR}) - SET(HAVE_LIBXPM 1) +@@ -126,7 +126,7 @@ else (USE_EXT_GD) + ENDIF (ENABLE_HEIF) + + IF (ENABLE_AVIF) +- FIND_PACKAGE(libavif 0.8.2 REQUIRED CONFIG) ++ FIND_PACKAGE(libavif REQUIRED CONFIG) + SET(HAVE_LIBAVIF 1) + SET(AVIF_LIBRARIES avif) + SET(AVIF_FOUND 1) +@@ -212,11 +212,11 @@ else (USE_EXT_GD) LIST(APPEND PKG_REQUIRES_PRIVATES xpm) ENDIF(XPM_FOUND) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 1d1be42..2843193 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -122,13 +122,13 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S - SET(LIBGD_DEP_LIBS - ${ZLIB_LIBRARIES} -- ${FREETYPE_LIBRARIES} -+ ${freetype_LIBRARIES} - ${PNG_LIBRARIES} - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} - ${JPEG_LIBRARIES} - ${TIFF_LIBRARIES} -- ${XPM_LIBRARIES} -+ ${libxpm_LIBRARIES} - ${FONTCONFIG_LIBRARY} - ${WEBP_LIBRARIES} - ${AVIF_LIBRARIES} -@@ -145,7 +145,7 @@ endif() - SET(LIBS_PRIVATES - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ) +- IF(JPEG_FOUND) ++ IF(ENABLE_JPEG AND JPEG_FOUND) + INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR}) + SET(HAVE_LIBJPEG 1) + LIST(APPEND PKG_REQUIRES_PRIVATES libjpeg) +- ENDIF(JPEG_FOUND) ++ ENDIF() - set(GD_PROGRAMS gdcmpgif) + IF(TIFF_FOUND) + INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR}) diff --git a/recipes/libgd/all/patches/2.3.3-use-cci.patch b/recipes/libgd/all/patches/2.3.3-use-cci.patch index fb8b637380621..561c4e9f127a0 100644 --- a/recipes/libgd/all/patches/2.3.3-use-cci.patch +++ b/recipes/libgd/all/patches/2.3.3-use-cci.patch @@ -1,72 +1,27 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6b3e5b3..2536fc6 100644 +index 6b3e5b3..2b71c74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -134,7 +134,7 @@ else (USE_EXT_GD) - endif (ENABLE_ICONV) - - IF (ENABLE_WEBP) -- FIND_PACKAGE(WEBP REQUIRED) -+ FIND_PACKAGE(WebP REQUIRED) - ENDIF (ENABLE_WEBP) - - IF (ENABLE_HEIF) -@@ -169,7 +169,7 @@ else (USE_EXT_GD) - endif (ENABLE_FREETYPE) - - if (ENABLE_XPM) -- FIND_PACKAGE(XPM REQUIRED) -+ FIND_PACKAGE(libxpm REQUIRED) - endif (ENABLE_XPM) - - if (ENABLE_FONTCONFIG) -@@ -196,7 +196,7 @@ else (USE_EXT_GD) - ENDIF(ZLIB_FOUND) - - IF(WEBP_FOUND) -- INCLUDE_DIRECTORIES(${WEBP_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${WebP_INCLUDE_DIR}) - SET(HAVE_LIBWEBP 1) - ENDIF(WEBP_FOUND) - -@@ -223,7 +223,7 @@ else (USE_EXT_GD) - ENDIF(LIQ_FOUND) - - IF(XPM_FOUND) -- INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR}) -+ INCLUDE_DIRECTORIES(${libxpm_INCLUDE_DIR}) - SET(HAVE_LIBXPM 1) +@@ -142,7 +142,7 @@ else (USE_EXT_GD) + ENDIF (ENABLE_HEIF) + + IF (ENABLE_AVIF) +- FIND_PACKAGE(libavif 0.8.2 REQUIRED CONFIG) ++ FIND_PACKAGE(libavif REQUIRED CONFIG) + SET(HAVE_LIBAVIF 1) + SET(AVIF_LIBRARIES avif) + SET(AVIF_FOUND 1) +@@ -228,11 +228,11 @@ else (USE_EXT_GD) LIST(APPEND PKG_REQUIRES_PRIVATES xpm) ENDIF(XPM_FOUND) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 3b271a8..55a8095 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -102,15 +102,15 @@ INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_S - SET(LIBGD_DEP_LIBS - ${ZLIB_LIBRARIES} -- ${FREETYPE_LIBRARIES} -+ ${freetype_LIBRARIES} - ${PNG_LIBRARIES} - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} - ${JPEG_LIBRARIES} - ${TIFF_LIBRARIES} -- ${XPM_LIBRARIES} -+ ${libxpm_LIBRARIES} - ${FONTCONFIG_LIBRARY} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ${AVIF_LIBRARIES} - ${RAQM_LIBRARIES} - ${HEIF_LIBRARIES} -@@ -125,7 +125,7 @@ endif() - SET(LIBS_PRIVATES - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} -- ${WEBP_LIBRARIES} -+ ${WebP_LIBRARIES} - ) +- IF(JPEG_FOUND) ++ IF(ENABLE_JPEG AND JPEG_FOUND) + INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR}) + SET(HAVE_LIBJPEG 1) + LIST(APPEND PKG_REQUIRES_PRIVATES libjpeg) +- ENDIF(JPEG_FOUND) ++ ENDIF() - set(GD_PROGRAMS gdcmpgif) + IF(TIFF_FOUND) + INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR}) diff --git a/recipes/libgettext/all/conanfile.py b/recipes/libgettext/all/conanfile.py index a3d65fe027cb3..9532952752a09 100644 --- a/recipes/libgettext/all/conanfile.py +++ b/recipes/libgettext/all/conanfile.py @@ -124,6 +124,15 @@ def generate(self): if (str(self.settings.compiler) == "Visual Studio" and Version(self.settings.compiler.version) >= "12") or \ (str(self.settings.compiler) == "msvc" and Version(self.settings.compiler.version) >= "180"): tc.extra_cflags += ["-FS"] + + if self.settings.build_type == "Debug": + # Skip checking for the 'n' printf format directly + # in msvc, as it is known to not be available due to security concerns. + # Skipping it avoids a GUI prompt during ./configure for a debug build + # See https://github.com/conan-io/conan-center-index/issues/23698 + tc.configure_args.extend([ + 'gl_cv_func_printf_directive_n=no' + ]) tc.make_args += ["-C", "intl"] env = tc.environment() if is_msvc(self) or self._is_clang_cl: diff --git a/recipes/libgettext/all/test_package/conanfile.py b/recipes/libgettext/all/test_package/conanfile.py index b9667f823f2c1..50e1b261c1fd4 100644 --- a/recipes/libgettext/all/test_package/conanfile.py +++ b/recipes/libgettext/all/test_package/conanfile.py @@ -1,8 +1,6 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.env import Environment, VirtualRunEnv -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import copy, rename +from conan.tools.cmake import CMake, cmake_layout import os @@ -10,6 +8,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" test_type = "explicit" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" def requirements(self): self.requires(self.tested_reference_str) @@ -17,33 +16,12 @@ def requirements(self): def layout(self): cmake_layout(self) - def generate(self): - CMakeDeps(self).generate() - CMakeToolchain(self).generate() - for locale, lang in [("en", "en_US"), ("ru", "ru_RU"), ("es", "es_ES")]: - env = Environment() - env.define("LANG", lang) - env.vars(self, scope=f"run_{locale}").save_script(f"locale_{locale}") - - VirtualRunEnv(self).generate(scope=f"run_{locale}") - def build(self): cmake = CMake(self) cmake.configure() cmake.build() - for locale in ["en", "ru", "es"]: - directory = os.path.join(self.source_folder, locale, "LC_MESSAGES") - if not os.path.isdir(directory): - os.makedirs(directory) - po_folder = os.path.join(self.source_folder, "po", locale) - dest_folder = os.path.join(self.source_folder, locale, "LC_MESSAGES") - copy(self, "conan.mo.workaround_git_ignore", po_folder, dest_folder) - mo_file = os.path.join(dest_folder, "conan.mo") - if not os.path.exists(mo_file): - rename(self, os.path.join(dest_folder, "conan.mo.workaround_git_ignore"), mo_file) def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - for locale in ["en", "ru", "es"]: - self.run(f"{bin_path} {os.path.abspath(self.source_folder)}", env=f"conanrun_{locale}") + self.run(bin_path, env=f"conanrun") diff --git a/recipes/libgettext/all/test_package/po/en/conan.mo.workaround_git_ignore b/recipes/libgettext/all/test_package/po/en/conan.mo.workaround_git_ignore deleted file mode 100644 index f2f426b3ff66b..0000000000000 Binary files a/recipes/libgettext/all/test_package/po/en/conan.mo.workaround_git_ignore and /dev/null differ diff --git a/recipes/libgettext/all/test_package/po/en/conan.po b/recipes/libgettext/all/test_package/po/en/conan.po deleted file mode 100644 index 082414b2e22f6..0000000000000 --- a/recipes/libgettext/all/test_package/po/en/conan.po +++ /dev/null @@ -1,23 +0,0 @@ -# Conan 1.0. -# Copyright (C) Bincrafters -# This file is distributed under the same license as the Conan package. -# Bincrafters , 2019. -msgid "" -msgstr "" -"Project-Id-Version: conan 1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-11 03:48-0700\n" -"PO-Revision-Date: 2019-07-11 03:57-0700\n" -"Last-Translator: U-DESKTOP-HHN0EAP\\sse4 \n" -"Language-Team: English\n" -"Language: en\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. Example of i18n usage -#: hello.c:17 -#, c-format -msgid "hello" -msgstr "hello" diff --git a/recipes/libgettext/all/test_package/po/es/conan.mo.workaround_git_ignore b/recipes/libgettext/all/test_package/po/es/conan.mo.workaround_git_ignore deleted file mode 100644 index 941535abc76d2..0000000000000 Binary files a/recipes/libgettext/all/test_package/po/es/conan.mo.workaround_git_ignore and /dev/null differ diff --git a/recipes/libgettext/all/test_package/po/es/conan.po b/recipes/libgettext/all/test_package/po/es/conan.po deleted file mode 100644 index 29a2b6106de38..0000000000000 --- a/recipes/libgettext/all/test_package/po/es/conan.po +++ /dev/null @@ -1,23 +0,0 @@ -# Conan 1.0. -# Copyright (C) Bincrafters -# This file is distributed under the same license as the Conan package. -# Bincrafters , 2019. -msgid "" -msgstr "" -"Project-Id-Version: conan 1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-11 03:48-0700\n" -"PO-Revision-Date: 2019-07-11 03:58-0700\n" -"Last-Translator: U-DESKTOP-HHN0EAP\\sse4 \n" -"Language-Team: Spanish\n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. Example of i18n usage -#: hello.c:17 -#, c-format -msgid "hello" -msgstr "holla" diff --git a/recipes/libgettext/all/test_package/po/ru/conan.mo.workaround_git_ignore b/recipes/libgettext/all/test_package/po/ru/conan.mo.workaround_git_ignore deleted file mode 100644 index 8f1f836a04c91..0000000000000 Binary files a/recipes/libgettext/all/test_package/po/ru/conan.mo.workaround_git_ignore and /dev/null differ diff --git a/recipes/libgettext/all/test_package/po/ru/conan.po b/recipes/libgettext/all/test_package/po/ru/conan.po deleted file mode 100644 index 34ecc9f75cf1e..0000000000000 --- a/recipes/libgettext/all/test_package/po/ru/conan.po +++ /dev/null @@ -1,24 +0,0 @@ -# Conan 1.0. -# Copyright (C) Bincrafters -# This file is distributed under the same license as the Conan package. -# Bincrafters , 2019. -msgid "" -msgstr "" -"Project-Id-Version: conan 1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-11 03:48-0700\n" -"PO-Revision-Date: 2019-07-11 03:58-0700\n" -"Last-Translator: U-DESKTOP-HHN0EAP\\sse4 \n" -"Language-Team: Russian\n" -"Language: ru\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" - -#. Example of i18n usage -#: hello.c:17 -#, c-format -msgid "hello" -msgstr "privet" diff --git a/recipes/libgettext/all/test_package/test_package.c b/recipes/libgettext/all/test_package/test_package.c index 615e9408bed47..262221a2aba6a 100644 --- a/recipes/libgettext/all/test_package/test_package.c +++ b/recipes/libgettext/all/test_package/test_package.c @@ -1,26 +1,8 @@ #include -#include -#include #include -int main(int argc, char * const argv[]) -{ - if (argc < 2) - return -1; - if(!bindtextdomain("conan", argv[1])) - { - printf("Warning: Could not bind text domain\n"); - } - if(!textdomain("conan")) - { - printf("Warning: Could not set text domain\n"); - } - if(!setlocale(LC_ALL, "")) - { - printf("Warning: could not set locale\n"); - } - const char * lang = getenv("LANG"); - lang = lang ? lang : ""; - printf("hello in %s: %s\n", lang, gettext("hello")); +int main() { + gettext("Hello, world!"); + return 0; } diff --git a/recipes/libgettext/all/test_v1_package/CMakeLists.txt b/recipes/libgettext/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index f9bddeec6f96a..0000000000000 --- a/recipes/libgettext/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(Intl CONFIG REQUIRED) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libgettext/all/test_v1_package/conanfile.py b/recipes/libgettext/all/test_v1_package/conanfile.py deleted file mode 100644 index 36bfb4bd5c2c9..0000000000000 --- a/recipes/libgettext/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,31 +0,0 @@ -from conans import ConanFile, CMake, tools -from conan.tools.files import copy, rename -import os -import shutil - - -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() - for locale in ["en", "ru", "es"]: - directory = os.path.join(self.source_folder, locale, "LC_MESSAGES") - if not os.path.isdir(directory): - os.makedirs(directory) - po_folder = os.path.join(self.source_folder, "..", "test_package", "po", locale) - dest_folder = os.path.join(self.source_folder, locale, "LC_MESSAGES") - copy(self, "conan.mo.workaround_git_ignore", po_folder, dest_folder) - mo_file = os.path.join(dest_folder, "conan.mo") - if not os.path.exists(mo_file): - rename(self, os.path.join(dest_folder, "conan.mo.workaround_git_ignore"), mo_file) - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - for locale in ["en_US", "ru_RU", "es_ES"]: - with tools.environment_append({"LANG": locale}): - self.run(f"{bin_path} {os.path.abspath(self.source_folder)}", run_environment=True) diff --git a/recipes/libgit2/0.27.x/CMakeLists.txt b/recipes/libgit2/0.27.x/CMakeLists.txt deleted file mode 100644 index c502da172e7b8..0000000000000 --- a/recipes/libgit2/0.27.x/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/libgit2/0.27.x/conandata.yml b/recipes/libgit2/0.27.x/conandata.yml deleted file mode 100644 index dddcd1d95b8f4..0000000000000 --- a/recipes/libgit2/0.27.x/conandata.yml +++ /dev/null @@ -1,4 +0,0 @@ -sources: - "0.27.10": - url: "https://github.com/libgit2/libgit2/archive/v0.27.10.tar.gz" - sha256: "f6fd26378ff71bd7a4b17b576c82c774a2e9c2d6b74b24718a8fb29551e1c4a5" diff --git a/recipes/libgit2/0.27.x/conanfile.py b/recipes/libgit2/0.27.x/conanfile.py deleted file mode 100644 index 07e2765904500..0000000000000 --- a/recipes/libgit2/0.27.x/conanfile.py +++ /dev/null @@ -1,156 +0,0 @@ -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration -import functools -import os - -required_conan_version = ">=1.45.0" - - -class LibGit2Conan(ConanFile): - name = "libgit2" - description = ( - "libgit2 is a portable, pure C implementation of the Git core methods " - "provided as a re-entrant linkable library with a solid API" - ) - topics = ("libgit2", "git", "scm") - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://libgit2.org/" - license = "GPL-2.0-linking-exception" - - settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - "threadsafe": [True, False], - "with_iconv": [True, False], - "with_libssh2": [True, False], - "with_https": [False, "openssl", "winhttp", "security"], - "with_sha1": ["collisiondetection", "commoncrypto", "openssl", "generic", "win32"], - } - default_options = { - "shared": False, - "fPIC": True, - "threadsafe": True, - "with_iconv": False, - "with_libssh2": True, - "with_https": "openssl", - "with_sha1": "collisiondetection", - } - - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - if not tools.is_apple_os(self.settings.os): - del self.options.with_iconv - - def configure(self): - if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx - - @property - def _need_openssl(self): - return "openssl" in (self.options.with_https, self.options.with_sha1) - - def requirements(self): - self.requires("zlib/1.2.12") - self.requires("http_parser/2.9.4") - if self.options.with_libssh2: - self.requires("libssh2/1.10.0") - if self.settings.os != "Windows": - self.requires("libcurl/7.83.1") - if self._need_openssl: - self.requires("openssl/1.1.1o") - - def validate(self): - if self.options.with_https == "security": - if not tools.is_apple_os(self.settings.os): - raise ConanInvalidConfiguration("security is only valid for Apple products") - elif self.options.with_https == "winhttp": - if self.settings.os != "Windows": - raise ConanInvalidConfiguration("winhttp is only valid on Windows") - - if self.options.with_sha1 == "win32": - if self.settings.os != "Windows": - raise ConanInvalidConfiguration("win32 is only valid on Windows") - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - _cmake_https = { - "openssl": "OpenSSL", - "winhttp": "WinHTTP", - "security": "SecureTransport", - False: "OFF", - } - - _cmake_sha1 = { - "collisiondetection": "CollisionDetection", - "commoncrypto": "CommonCrypto", - "openssl": "OpenSSL", - "generic": "Generic", - "win32": "Win32", - } - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["THREADSAFE"] = self.options.threadsafe - cmake.definitions["USE_SSH"] = self.options.with_libssh2 - - cmake.definitions["USE_ICONV"] = self.options.get_safe("with_iconv", False) - - cmake.definitions["USE_HTTPS"] = self._cmake_https[str(self.options.with_https)] - cmake.definitions["SHA1_BACKEND"] = self._cmake_sha1[str(self.options.with_sha1)] - - cmake.definitions["BUILD_CLAR"] = False - cmake.definitions["BUILD_EXAMPLES"] = False - - if is_msvc(self): - cmake.definitions["STATIC_CRT"] = is_msvc_static_runtime(self) - - cmake.configure() - return cmake - - def _patch_sources(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), - "FIND_PKGLIBRARIES(LIBSSH2 libssh2)", - "FIND_PACKAGE(Libssh2 REQUIRED)\n" - "\tSET(LIBSSH2_FOUND ON)\n" - "\tSET(LIBSSH2_INCLUDE_DIRS ${Libssh2_INCLUDE_DIRS})\n" - "\tSET(LIBSSH2_LIBRARIES ${Libssh2_LIBRARIES})\n" - "\tSET(LIBSSH2_LIBRARY_DIRS ${Libssh2_LIB_DIRS})") - - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), - "FIND_PKGLIBRARIES(CURL libcurl)", - "FIND_PACKAGE(CURL REQUIRED)\n") - - def build(self): - self._patch_sources() - cmake = self._configure_cmake() - cmake.build() - - def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() - cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - - def package_info(self): - self.cpp_info.set_property("pkg_config_name", "libgit2") - self.cpp_info.libs = ["git2"] - if self.settings.os == "Windows": - self.cpp_info.system_libs.extend(["winhttp", "rpcrt4", "crypt32"]) - if self.settings.os in ["Linux", "FreeBSD"] and self.options.threadsafe: - self.cpp_info.system_libs.append("pthread") diff --git a/recipes/libgit2/0.27.x/test_package/CMakeLists.txt b/recipes/libgit2/0.27.x/test_package/CMakeLists.txt deleted file mode 100644 index 912bdc647f324..0000000000000 --- a/recipes/libgit2/0.27.x/test_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libgit2 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} libgit2::libgit2) diff --git a/recipes/libgit2/0.27.x/test_package/test_package.c b/recipes/libgit2/0.27.x/test_package/test_package.c deleted file mode 100644 index 1ea125101cdc8..0000000000000 --- a/recipes/libgit2/0.27.x/test_package/test_package.c +++ /dev/null @@ -1,34 +0,0 @@ -#include - -#include - -int main() -{ - git_libgit2_init(); - int versionMajor, versionMinor, versionRev; - git_libgit2_version(&versionMajor, &versionMinor, &versionRev); - - printf("libgit2 v%i.%i.%i\n", versionMajor, versionMinor, versionRev); - - printf("Compile Features:\n"); - - int features = git_libgit2_features(); - - if (features & GIT_FEATURE_THREADS) - printf(" - Thread safe\n"); - else - printf(" - Single thread only\n"); - - if (features & GIT_FEATURE_HTTPS) - printf(" - TLS (openssl, winhttp or security)\n"); - else - printf(" - No TLS\n"); - - if (features & GIT_FEATURE_SSH) - printf(" - SSH (libssh2)\n"); - else - printf(" - No SSH support\n"); - - git_libgit2_shutdown(); - return 0; -} diff --git a/recipes/libgit2/0.28.x/CMakeLists.txt b/recipes/libgit2/0.28.x/CMakeLists.txt deleted file mode 100644 index c502da172e7b8..0000000000000 --- a/recipes/libgit2/0.28.x/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/libgit2/0.28.x/conandata.yml b/recipes/libgit2/0.28.x/conandata.yml deleted file mode 100644 index 25994eed756a3..0000000000000 --- a/recipes/libgit2/0.28.x/conandata.yml +++ /dev/null @@ -1,4 +0,0 @@ -sources: - "0.28.5": - url: "https://github.com/libgit2/libgit2/archive/v0.28.5.tar.gz" - sha256: "2b7b68aee6f123bc84cc502a9c12738435b8054e7d628962e091cd2a25be4f42" diff --git a/recipes/libgit2/0.28.x/conanfile.py b/recipes/libgit2/0.28.x/conanfile.py deleted file mode 100644 index 7e3da960a3cb2..0000000000000 --- a/recipes/libgit2/0.28.x/conanfile.py +++ /dev/null @@ -1,160 +0,0 @@ -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration -import functools -import os - -required_conan_version = ">=1.45.0" - - -class LibGit2Conan(ConanFile): - name = "libgit2" - description = ( - "libgit2 is a portable, pure C implementation of the Git core methods " - "provided as a re-entrant linkable library with a solid API" - ) - topics = ("libgit2", "git", "scm") - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://libgit2.org/" - license = "GPL-2.0-linking-exception" - - settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - "threadsafe": [True, False], - "with_iconv": [True, False], - "with_libssh2": [True, False], - "with_https": [False, "openssl", "mbedtls", "winhttp", "security"], - "with_sha1": ["collisiondetection", "commoncrypto", "openssl", "mbedtls", "generic", "win32"], - } - default_options = { - "shared": False, - "fPIC": True, - "threadsafe": True, - "with_iconv": False, - "with_libssh2": True, - "with_https": "openssl", - "with_sha1": "collisiondetection", - } - - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - if not tools.is_apple_os(self.settings.os): - del self.options.with_iconv - - def configure(self): - if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx - - @property - def _need_openssl(self): - return "openssl" in (self.options.with_https, self.options.with_sha1) - - @property - def _need_mbedtls(self): - return "mbedtls" in (self.options.with_https, self.options.with_sha1) - - def requirements(self): - self.requires("zlib/1.2.12") - self.requires("http_parser/2.9.4") - if self.options.with_libssh2: - self.requires("libssh2/1.10.0") - if self._need_openssl: - self.requires("openssl/1.1.1o") - if self._need_mbedtls: - self.requires("mbedtls/3.1.0") - if tools.is_apple_os(self.settings.os) and self.options.with_iconv: - self.requires("libiconv/1.16") - - def validate(self): - if self.options.with_https == "security": - if not tools.is_apple_os(self.settings.os): - raise ConanInvalidConfiguration("security is only valid for Apple products") - elif self.options.with_https == "winhttp": - if self.settings.os != "Windows": - raise ConanInvalidConfiguration("winhttp is only valid on Windows") - - if self.options.with_sha1 == "win32": - if self.settings.os != "Windows": - raise ConanInvalidConfiguration("win32 is only valid on Windows") - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - _cmake_https = { - "openssl": "OpenSSL", - "winhttp": "WinHTTP", - "security": "SecureTransport", - "mbedtls": "mbedTLS", - False: "OFF", - } - - _cmake_sha1 = { - "collisiondetection": "CollisionDetection", - "commoncrypto": "CommonCrypto", - "openssl": "OpenSSL", - "mbedtls": "mbedTLS", - "generic": "Generic", - "win32": "Win32", - } - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["THREADSAFE"] = self.options.threadsafe - cmake.definitions["USE_SSH"] = self.options.with_libssh2 - - cmake.definitions["USE_ICONV"] = self.options.get_safe("with_iconv", False) - - cmake.definitions["USE_HTTPS"] = self._cmake_https[str(self.options.with_https)] - cmake.definitions["SHA1_BACKEND"] = self._cmake_sha1[str(self.options.with_sha1)] - - cmake.definitions["BUILD_CLAR"] = False - cmake.definitions["BUILD_EXAMPLES"] = False - - if is_msvc(self): - cmake.definitions["STATIC_CRT"] = is_msvc_static_runtime(self) - - cmake.configure() - return cmake - - def _patch_sources(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), - "FIND_PKGLIBRARIES(LIBSSH2 libssh2)", - "FIND_PACKAGE(Libssh2 REQUIRED)\n" - "\tSET(LIBSSH2_FOUND ON)\n" - "\tSET(LIBSSH2_INCLUDE_DIRS ${Libssh2_INCLUDE_DIRS})\n" - "\tSET(LIBSSH2_LIBRARIES ${Libssh2_LIBRARIES})\n" - "\tSET(LIBSSH2_LIBRARY_DIRS ${Libssh2_LIB_DIRS})") - - def build(self): - self._patch_sources() - cmake = self._configure_cmake() - cmake.build() - - def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() - cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - - def package_info(self): - self.cpp_info.set_property("pkg_config_name", "libgit2") - self.cpp_info.libs = ["git2"] - if self.settings.os == "Windows": - self.cpp_info.system_libs.extend(["winhttp", "rpcrt4", "crypt32"]) - if self.settings.os in ["Linux", "FreeBSD"] and self.options.threadsafe: - self.cpp_info.system_libs.append("pthread") diff --git a/recipes/libgit2/0.28.x/test_package/CMakeLists.txt b/recipes/libgit2/0.28.x/test_package/CMakeLists.txt deleted file mode 100644 index 912bdc647f324..0000000000000 --- a/recipes/libgit2/0.28.x/test_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libgit2 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} libgit2::libgit2) diff --git a/recipes/libgit2/0.28.x/test_package/test_package.c b/recipes/libgit2/0.28.x/test_package/test_package.c deleted file mode 100644 index 96e8eda89c73b..0000000000000 --- a/recipes/libgit2/0.28.x/test_package/test_package.c +++ /dev/null @@ -1,34 +0,0 @@ -#include - -#include - -int main() -{ - git_libgit2_init(); - int versionMajor, versionMinor, versionRev; - git_libgit2_version(&versionMajor, &versionMinor, &versionRev); - - printf("libgit2 v%i.%i.%i\n", versionMajor, versionMinor, versionRev); - - printf("Compile Features:\n"); - - int features = git_libgit2_features(); - - if (features & GIT_FEATURE_THREADS) - printf(" - Thread safe\n"); - else - printf(" - Single thread only\n"); - - if (features & GIT_FEATURE_HTTPS) - printf(" - TLS (openssl, mbedtls, winhttp or security)\n"); - else - printf(" - No TLS\n"); - - if (features & GIT_FEATURE_SSH) - printf(" - SSH (libssh2)\n"); - else - printf(" - No SSH support\n"); - - git_libgit2_shutdown(); - return 0; -} diff --git a/recipes/libgit2/all/CMakeLists.txt b/recipes/libgit2/all/CMakeLists.txt deleted file mode 100644 index c502da172e7b8..0000000000000 --- a/recipes/libgit2/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/libgit2/all/conandata.yml b/recipes/libgit2/all/conandata.yml index 7725b775b39de..c112809f65932 100644 --- a/recipes/libgit2/all/conandata.yml +++ b/recipes/libgit2/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.8.1": + url: "https://github.com/libgit2/libgit2/archive/v1.8.1.tar.gz" + sha256: "8c1eaf0cf07cba0e9021920bfba9502140220786ed5d8a8ec6c7ad9174522f8e" + "1.7.2": + url: "https://github.com/libgit2/libgit2/archive/v1.7.2.tar.gz" + sha256: "de384e29d7efc9330c6cdb126ebf88342b5025d920dcb7c645defad85195ea7f" "1.5.0": url: "https://github.com/libgit2/libgit2/archive/v1.5.0.tar.gz" sha256: "8de872a0f201b33d9522b817c92e14edb4efad18dae95cf156cf240b2efff93e" @@ -18,21 +24,35 @@ sources: url: "https://github.com/libgit2/libgit2/archive/v1.0.1.tar.gz" sha256: "1775427a6098f441ddbaa5bd4e9b8a043c7401e450ed761e69a415530fea81d2" patches: + "1.8.1": + - patch_file: "patches/1.8.1-0001-fix-cmake.patch" + patch_description: "use cci's packages" + patch_type: "conan" + "1.7.2": + - patch_file: "patches/1.7.2-0001-fix-cmake.patch" + patch_description: "use cci's packages" + patch_type: "conan" "1.5.0": - patch_file: "patches/1.4.3-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "use cci's packages" + patch_type: "conan" "1.4.3": - patch_file: "patches/1.4.3-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "use cci's packages" + patch_type: "conan" "1.3.0": - patch_file: "patches/1.3.0-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "use cci's packages" + patch_type: "conan" "1.2.0": - patch_file: "patches/1.2.0-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "use cci's packages" + patch_type: "conan" "1.1.1": - patch_file: "patches/1.1.1-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "use cci's packages" + patch_type: "conan" "1.0.1": - patch_file: "patches/1.0.1-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "use cci's packages" + patch_type: "conan" diff --git a/recipes/libgit2/all/conanfile.py b/recipes/libgit2/all/conanfile.py index c042b13f51df6..ac07d7f6dac70 100644 --- a/recipes/libgit2/all/conanfile.py +++ b/recipes/libgit2/all/conanfile.py @@ -1,10 +1,14 @@ -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration -import functools +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.apple import is_apple_os import os -required_conan_version = ">=1.45.0" + +required_conan_version = ">=1.53.0" class LibGit2Conan(ConanFile): @@ -13,11 +17,11 @@ class LibGit2Conan(ConanFile): "libgit2 is a portable, pure C implementation of the Git core methods " "provided as a re-entrant linkable library with a solid API" ) - topics = ("libgit2", "git", "scm") + license = "GPL-2.0-linking-exception" url = "https://github.com/conan-io/conan-center-index" homepage = "https://libgit2.org/" - license = "GPL-2.0-linking-exception" - + topics = ("git", "scm") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,6 +33,7 @@ class LibGit2Conan(ConanFile): "with_sha1": ["collisiondetection", "commoncrypto", "openssl", "mbedtls", "generic", "win32"], "with_ntlmclient": [True, False], "with_regex": ["builtin", "pcre", "pcre2", "regcomp_l", "regcomp"], + "with_http_parser": ["http-parser", "llhttp"], } default_options = { "shared": False, @@ -40,23 +45,17 @@ class LibGit2Conan(ConanFile): "with_sha1": "collisiondetection", "with_ntlmclient": True, "with_regex": "builtin", + "with_http_parser": "http-parser", } - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if not tools.is_apple_os(self.settings.os): + if not is_apple_os(self): del self.options.with_iconv if self.settings.os == "Windows": @@ -65,27 +64,38 @@ def config_options(self): if self.settings.os == "Macos": self.options.with_regex = "regcomp_l" + # < 1.8.1 requries http_parser only. + if Version(self.version) < "1.8.1": + del self.options.with_http_parser + def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.12") - self.requires("http_parser/2.9.4") + self.requires("zlib/[>=1.2.11 <2]") + if Version(self.version) < "1.8.1" or self.options.get_safe("with_http_parser") == "http-parser": + self.requires("http_parser/2.9.4") + else: + self.requires("llhttp/9.1.3") + if self.options.with_libssh2: - self.requires("libssh2/1.10.0") + self.requires("libssh2/1.11.0") if self._need_openssl: - self.requires("openssl/1.1.1o") + self.requires("openssl/[>=1.1 <4]") if self._need_mbedtls: - self.requires("mbedtls/3.1.0") + self.requires("mbedtls/3.2.1") if self.options.get_safe("with_iconv"): - self.requires("libiconv/1.16") + self.requires("libiconv/1.17") if self.options.with_regex == "pcre": self.requires("pcre/8.45") elif self.options.with_regex == "pcre2": - self.requires("pcre2/10.40") + self.requires("pcre2/10.42") @property def _need_openssl(self): @@ -97,7 +107,7 @@ def _need_mbedtls(self): def validate(self): if self.options.with_https == "security": - if not tools.is_apple_os(self.settings.os): + if not is_apple_os(self): raise ConanInvalidConfiguration("security is only valid for Apple products") elif self.options.with_https == "winhttp": if self.settings.os != "Windows": @@ -108,22 +118,21 @@ def validate(self): raise ConanInvalidConfiguration("win32 is only valid on Windows") if self.options.with_regex == "regcomp" or self.options.with_regex == "regcomp_l": - if self.settings.compiler == "Visual Studio": + if is_msvc(self): raise ConanInvalidConfiguration("{} isn't supported by Visual Studio".format(self.options.with_regex)) if self.settings.os in ["iOS", "tvOS", "watchOS"] and self.options.with_regex == "regcomp_l": raise ConanInvalidConfiguration("regcomp_l isn't supported on {}".format(self.settings.os)) 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) _cmake_https = { "openssl": "OpenSSL", "winhttp": "WinHTTP", "security": "SecureTransport", "mbedtls": "mbedTLS", - False: "OFF", + "False": "OFF", } _cmake_sha1 = { @@ -133,49 +142,57 @@ def source(self): "mbedtls": "mbedTLS", "generic": "Generic", "win32": "Win32", + "False": "OFF", } - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["THREADSAFE"] = self.options.threadsafe - cmake.definitions["USE_SSH"] = self.options.with_libssh2 - - cmake.definitions["USE_ICONV"] = self.options.get_safe("with_iconv", False) - - cmake.definitions["USE_HTTPS"] = self._cmake_https[str(self.options.with_https)] - cmake.definitions["USE_SHA1"] = self._cmake_sha1[str(self.options.with_sha1)] - - if tools.Version(self.version) >= "1.4.0": - cmake.definitions["BUILD_TESTS"] = False - cmake.definitions["BUILD_CLAR"] = False - cmake.definitions["BUILD_EXAMPLES"] = False - cmake.definitions["USE_HTTP_PARSER"] = "system" - - cmake.definitions["REGEX_BACKEND"] = self.options.with_regex - + def generate(self): + tc = CMakeToolchain(self) + tc.variables["THREADSAFE"] = self.options.threadsafe + if Version(self.version) < "1.8.1": + tc.variables["USE_SSH"] = self.options.with_libssh2 + else: + tc.variables["USE_SSH"] = "libssh2" if self.options.with_libssh2 else False + tc.variables["USE_ICONV"] = self.options.get_safe("with_iconv", False) + tc.variables["USE_HTTPS"] = self._cmake_https[str(self.options.with_https)] + tc.variables["USE_SHA1"] = self._cmake_sha1[str(self.options.with_sha1)] + if Version(self.version) >= "1.4.0": + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_CLAR"] = False + tc.variables["BUILD_CLI"] = False + tc.variables["BUILD_EXAMPLES"] = False + if Version(self.version) < "1.8.1": + tc.variables["USE_HTTP_PARSER"] = "system" + else: + tc.variables["USE_HTTP_PARSER"] = self.options.get_safe("with_http_parser") + tc.variables["REGEX_BACKEND"] = self.options.with_regex if is_msvc(self): - cmake.definitions["STATIC_CRT"] = is_msvc_static_runtime(self) - - cmake.configure() - return cmake + tc.variables["STATIC_CRT"] = is_msvc_static_runtime(self) + # REGEX_BACKEND is SET(), avoid options overriding it + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + if self.options.get_safe("with_http_parser") == "llhttp": + deps.set_property("llhttp", "cmake_file_name", "LLHTTP") + 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("COPYING", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, pattern="COPYING", 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.set_property("pkg_config_name", "libgit2") self.cpp_info.libs = ["git2"] if self.settings.os == "Windows": self.cpp_info.system_libs.extend(["winhttp", "rpcrt4", "crypt32"]) + if Version(self.version) >= "1.7.0": + self.cpp_info.system_libs.append("secur32") if self.settings.os in ["Linux", "FreeBSD"] and self.options.threadsafe: self.cpp_info.system_libs.append("pthread") diff --git a/recipes/libgit2/all/patches/1.0.1-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.0.1-0001-fix-cmake.patch index 2f0d05b998d5d..3c23186ba4771 100644 --- a/recipes/libgit2/all/patches/1.0.1-0001-fix-cmake.patch +++ b/recipes/libgit2/all/patches/1.0.1-0001-fix-cmake.patch @@ -1,5 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8264158..374a21c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -11,8 +11,8 @@ + # Install: + # > cmake --build . --target install + +-PROJECT(libgit2 C) + CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1) ++PROJECT(libgit2 C) + CMAKE_POLICY(SET CMP0015 NEW) + IF(POLICY CMP0051) + CMAKE_POLICY(SET CMP0051 NEW) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index dff1d94..abd9c45 100644 +index dff1d94..25652b7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -158,11 +158,11 @@ ENDIF() @@ -31,3 +45,15 @@ index dff1d94..abd9c45 100644 ENDIF() IF (LIBSSH2_FOUND) SET(GIT_SSH 1) +@@ -209,10 +213,7 @@ IF (LIBSSH2_FOUND) + LIST(APPEND LIBGIT2_LIBS ${LIBSSH2_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- SET(GIT_SSH_MEMORY_CREDENTIALS 1) +- ENDIF() ++ SET(GIT_SSH_MEMORY_CREDENTIALS 1) + ELSE() + MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") + ENDIF() diff --git a/recipes/libgit2/all/patches/1.1.1-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.1.1-0001-fix-cmake.patch index 5dc56b1a31b92..3abde1ad5528a 100644 --- a/recipes/libgit2/all/patches/1.1.1-0001-fix-cmake.patch +++ b/recipes/libgit2/all/patches/1.1.1-0001-fix-cmake.patch @@ -1,5 +1,5 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index d01cc64..0941cbd 100644 +index d01cc64..5691f7e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -167,11 +167,11 @@ ENDIF() @@ -31,3 +31,15 @@ index d01cc64..0941cbd 100644 ENDIF() IF (LIBSSH2_FOUND) SET(GIT_SSH 1) +@@ -218,10 +222,7 @@ IF (LIBSSH2_FOUND) + LIST(APPEND LIBGIT2_LIBS ${LIBSSH2_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- SET(GIT_SSH_MEMORY_CREDENTIALS 1) +- ENDIF() ++ SET(GIT_SSH_MEMORY_CREDENTIALS 1) + ELSE() + MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") + ENDIF() diff --git a/recipes/libgit2/all/patches/1.2.0-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.2.0-0001-fix-cmake.patch index 0fbbd568d7b10..950bd6ff11e0a 100644 --- a/recipes/libgit2/all/patches/1.2.0-0001-fix-cmake.patch +++ b/recipes/libgit2/all/patches/1.2.0-0001-fix-cmake.patch @@ -1,5 +1,5 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 45dec27..783c657 100644 +index 45dec27..d7652f7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -178,11 +178,11 @@ ENDIF() @@ -31,3 +31,15 @@ index 45dec27..783c657 100644 ENDIF() IF (LIBSSH2_FOUND) SET(GIT_SSH 1) +@@ -239,10 +243,7 @@ IF (LIBSSH2_FOUND) + LIST(APPEND LIBGIT2_LIBS ${LIBSSH2_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- SET(GIT_SSH_MEMORY_CREDENTIALS 1) +- ENDIF() ++ SET(GIT_SSH_MEMORY_CREDENTIALS 1) + ELSE() + MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") + ENDIF() diff --git a/recipes/libgit2/all/patches/1.3.0-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.3.0-0001-fix-cmake.patch index 997b6dd7759b0..34d77da78eff1 100644 --- a/recipes/libgit2/all/patches/1.3.0-0001-fix-cmake.patch +++ b/recipes/libgit2/all/patches/1.3.0-0001-fix-cmake.patch @@ -1,5 +1,5 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index fdb3673..783c657 100644 +index fdb3673..d7652f7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -178,11 +178,11 @@ ENDIF() @@ -38,3 +38,15 @@ index fdb3673..783c657 100644 ENDIF() IF (LIBSSH2_FOUND) SET(GIT_SSH 1) +@@ -246,10 +243,7 @@ IF (LIBSSH2_FOUND) + LIST(APPEND LIBGIT2_LIBS ${LIBSSH2_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- SET(GIT_SSH_MEMORY_CREDENTIALS 1) +- ENDIF() ++ SET(GIT_SSH_MEMORY_CREDENTIALS 1) + ELSE() + MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") + ENDIF() diff --git a/recipes/libgit2/all/patches/1.4.3-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.4.3-0001-fix-cmake.patch index 459414c1a9584..66a17f3f7e869 100644 --- a/recipes/libgit2/all/patches/1.4.3-0001-fix-cmake.patch +++ b/recipes/libgit2/all/patches/1.4.3-0001-fix-cmake.patch @@ -18,7 +18,7 @@ index 955aea3..ff94eb8 100644 add_feature_info(http-parser ON "http-parser support (system)") else() diff --git a/cmake/SelectSSH.cmake b/cmake/SelectSSH.cmake -index 23dfc97..a094cc7 100644 +index 23dfc97..386f184 100644 --- a/cmake/SelectSSH.cmake +++ b/cmake/SelectSSH.cmake @@ -1,13 +1,10 @@ @@ -40,3 +40,15 @@ index 23dfc97..a094cc7 100644 if(NOT LIBSSH2_FOUND) message(FATAL_ERROR "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") +@@ -20,10 +17,7 @@ if(LIBSSH2_FOUND) + list(APPEND LIBGIT2_SYSTEM_LIBS ${LIBSSH2_LIBRARIES}) + list(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- check_library_exists("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- if(HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- set(GIT_SSH_MEMORY_CREDENTIALS 1) +- endif() ++ set(GIT_SSH_MEMORY_CREDENTIALS 1) + else() + message(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") + endif() diff --git a/recipes/libgit2/all/patches/1.7.2-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.7.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..8705249e1247a --- /dev/null +++ b/recipes/libgit2/all/patches/1.7.2-0001-fix-cmake.patch @@ -0,0 +1,70 @@ +diff --git a/cmake/SelectHTTPParser.cmake b/cmake/SelectHTTPParser.cmake +index 955aea3..ff94eb8 100644 +--- a/cmake/SelectHTTPParser.cmake ++++ b/cmake/SelectHTTPParser.cmake +@@ -1,10 +1,10 @@ + # Optional external dependency: http-parser + if(USE_HTTP_PARSER STREQUAL "system") +- find_package(HTTPParser) ++ find_package(http_parser) + +- if(HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2) +- list(APPEND LIBGIT2_SYSTEM_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS}) +- list(APPEND LIBGIT2_SYSTEM_LIBS ${HTTP_PARSER_LIBRARIES}) ++ if(http_parser_FOUND) ++ list(APPEND LIBGIT2_SYSTEM_INCLUDES ${http_parser_INCLUDE_DIRS}) ++ list(APPEND LIBGIT2_SYSTEM_LIBS ${http_parser_LIBRARIES}) + list(APPEND LIBGIT2_PC_LIBS "-lhttp_parser") + add_feature_info(http-parser ON "http-parser support (system)") + else() +diff --git a/cmake/SelectHTTPSBackend.cmake b/cmake/SelectHTTPSBackend.cmake +index d149416..33473ee 100644 +--- a/cmake/SelectHTTPSBackend.cmake ++++ b/cmake/SelectHTTPSBackend.cmake +@@ -9,6 +9,11 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + endif() + + if(USE_HTTPS) ++ if(WIN32) ++ list(APPEND LIBGIT2_SYSTEM_LIBS "secur32") ++ list(APPEND LIBGIT2_PC_LIBS "-lsecur32") ++ endif() ++ + # Auto-select TLS backend + sanitizebool(USE_HTTPS) + if(USE_HTTPS STREQUAL ON) +diff --git a/cmake/SelectSSH.cmake b/cmake/SelectSSH.cmake +index 23dfc97..386f184 100644 +--- a/cmake/SelectSSH.cmake ++++ b/cmake/SelectSSH.cmake +@@ -1,13 +1,10 @@ + # Optional external dependency: libssh2 + if(USE_SSH) +- find_pkglibraries(LIBSSH2 libssh2) +- if(NOT LIBSSH2_FOUND) +- find_package(LibSSH2) +- set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR}) +- get_filename_component(LIBSSH2_LIBRARY_DIRS "${LIBSSH2_LIBRARY}" DIRECTORY) +- set(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY}) +- set(LIBSSH2_LDFLAGS "-lssh2") +- endif() ++ FIND_PACKAGE(Libssh2 REQUIRED) ++ SET(LIBSSH2_FOUND ON) ++ SET(LIBSSH2_INCLUDE_DIRS ${Libssh2_INCLUDE_DIRS}) ++ SET(LIBSSH2_LIBRARIES ${Libssh2_LIBRARIES}) ++ SET(LIBSSH2_LIBRARY_DIRS ${Libssh2_LIB_DIRS}) + + if(NOT LIBSSH2_FOUND) + message(FATAL_ERROR "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") +@@ -20,10 +17,7 @@ if(LIBSSH2_FOUND) + list(APPEND LIBGIT2_SYSTEM_LIBS ${LIBSSH2_LIBRARIES}) + list(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- check_library_exists("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- if(HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- set(GIT_SSH_MEMORY_CREDENTIALS 1) +- endif() ++ set(GIT_SSH_MEMORY_CREDENTIALS 1) + else() + message(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") + endif() diff --git a/recipes/libgit2/all/patches/1.8.1-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.8.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..7515a48158c94 --- /dev/null +++ b/recipes/libgit2/all/patches/1.8.1-0001-fix-cmake.patch @@ -0,0 +1,72 @@ +diff --git a/cmake/SelectHTTPParser.cmake b/cmake/SelectHTTPParser.cmake +index 4fc1f69..1e8d83e 100644 +--- a/cmake/SelectHTTPParser.cmake ++++ b/cmake/SelectHTTPParser.cmake +@@ -1,10 +1,10 @@ + # Optional external dependency: http-parser + if(USE_HTTP_PARSER STREQUAL "http-parser") +- find_package(HTTPParser) ++ find_package(http_parser) + +- if(HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2) +- list(APPEND LIBGIT2_SYSTEM_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS}) +- list(APPEND LIBGIT2_SYSTEM_LIBS ${HTTP_PARSER_LIBRARIES}) ++ if(http_parser_FOUND) ++ list(APPEND LIBGIT2_SYSTEM_INCLUDES ${http_parser_INCLUDE_DIRS}) ++ list(APPEND LIBGIT2_SYSTEM_LIBS ${http_parser_LIBRARIES}) + list(APPEND LIBGIT2_PC_LIBS "-lhttp_parser") + set(GIT_HTTPPARSER_HTTPPARSER 1) + add_feature_info(http-parser ON "using http-parser (system)") +diff --git a/cmake/SelectHTTPSBackend.cmake b/cmake/SelectHTTPSBackend.cmake +index d293001..acffba9 100644 +--- a/cmake/SelectHTTPSBackend.cmake ++++ b/cmake/SelectHTTPSBackend.cmake +@@ -9,6 +9,11 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + endif() + + if(USE_HTTPS) ++ if(WIN32) ++ list(APPEND LIBGIT2_SYSTEM_LIBS "secur32") ++ list(APPEND LIBGIT2_PC_LIBS "-lsecur32") ++ endif() ++ + # Auto-select TLS backend + sanitizebool(USE_HTTPS) + if(USE_HTTPS STREQUAL ON) +diff --git a/cmake/SelectSSH.cmake b/cmake/SelectSSH.cmake +index 079857f..652b310 100644 +--- a/cmake/SelectSSH.cmake ++++ b/cmake/SelectSSH.cmake +@@ -4,15 +4,11 @@ if(USE_SSH STREQUAL "exec") + + add_feature_info(SSH ON "using OpenSSH exec support") + elseif(USE_SSH STREQUAL ON OR USE_SSH STREQUAL "libssh2") +- find_pkglibraries(LIBSSH2 libssh2) +- +- if(NOT LIBSSH2_FOUND) +- find_package(LibSSH2) +- set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR}) +- get_filename_component(LIBSSH2_LIBRARY_DIRS "${LIBSSH2_LIBRARY}" DIRECTORY) +- set(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY}) +- set(LIBSSH2_LDFLAGS "-lssh2") +- endif() ++ FIND_PACKAGE(Libssh2 REQUIRED) ++ SET(LIBSSH2_FOUND ON) ++ SET(LIBSSH2_INCLUDE_DIRS ${Libssh2_INCLUDE_DIRS}) ++ SET(LIBSSH2_LIBRARIES ${Libssh2_LIBRARIES}) ++ SET(LIBSSH2_LIBRARY_DIRS ${Libssh2_LIB_DIRS}) + + if(NOT LIBSSH2_FOUND) + message(FATAL_ERROR "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") +@@ -22,10 +18,7 @@ elseif(USE_SSH STREQUAL ON OR USE_SSH STREQUAL "libssh2") + list(APPEND LIBGIT2_SYSTEM_LIBS ${LIBSSH2_LIBRARIES}) + list(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- check_library_exists("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- if(HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- set(GIT_SSH_LIBSSH2_MEMORY_CREDENTIALS 1) +- endif() ++ set(GIT_SSH_MEMORY_CREDENTIALS 1) + + if(WIN32 AND EMBED_SSH_PATH) + file(GLOB SSH_SRC "${EMBED_SSH_PATH}/src/*.c") diff --git a/recipes/libgit2/all/test_package/CMakeLists.txt b/recipes/libgit2/all/test_package/CMakeLists.txt index 912bdc647f324..b2c8aa0ca7f27 100644 --- a/recipes/libgit2/all/test_package/CMakeLists.txt +++ b/recipes/libgit2/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) +project(test_package LANGUAGES C) find_package(libgit2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} libgit2::libgit2) +target_link_libraries(${PROJECT_NAME} PRIVATE libgit2::libgit2) diff --git a/recipes/libgit2/all/test_package/conanfile.py b/recipes/libgit2/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/libgit2/all/test_package/conanfile.py +++ b/recipes/libgit2/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/libgit2/config.yml b/recipes/libgit2/config.yml index c472349adb3cc..17396f92e3be0 100644 --- a/recipes/libgit2/config.yml +++ b/recipes/libgit2/config.yml @@ -1,4 +1,8 @@ versions: + "1.8.1": + folder: "all" + "1.7.2": + folder: "all" "1.5.0": folder: "all" "1.4.3": @@ -11,7 +15,3 @@ versions: folder: "all" "1.0.1": folder: "all" - "0.28.5": - folder: "0.28.x" - "0.27.10": - folder: "0.27.x" diff --git a/recipes/libglvnd/all/conanfile.py b/recipes/libglvnd/all/conanfile.py index 2362f8db4e5aa..422acffdcd2c7 100644 --- a/recipes/libglvnd/all/conanfile.py +++ b/recipes/libglvnd/all/conanfile.py @@ -8,7 +8,7 @@ import os import textwrap -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class LibGlvndConan(ConanFile): name = "libglvnd" @@ -59,7 +59,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.name} is only compatible with Linux and FreeBSD") def build_requirements(self): - self.tool_requires("meson/1.3.2") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/2.1.0") @@ -87,6 +87,10 @@ def generate(self): tc.project_options["headers"] = self.options.headers tc.project_options["entrypoint-patching"] = "enabled" if self.options.entrypoint_patching else "disabled" tc.project_options["libdir"] = "lib" + # Configure the data directory so that it defaults to the correct location for ICD discovery on the local system. + tc.project_options["datadir"] = os.path.join("usr", "share") if self.settings.os == "Linux" else os.path.join("usr", "local", "share") + if self.settings.os == "FreeBSD": + tc.project_options["sysconfdir"] = os.path.join("usr", "local", "etc") tc.generate() def build(self): diff --git a/recipes/libidn/all/conandata.yml b/recipes/libidn/all/conandata.yml index 8be8baf6f09f3..fcb454914799b 100644 --- a/recipes/libidn/all/conandata.yml +++ b/recipes/libidn/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "1.36": - patch_file: "patches/0001-unconditional-system-stdint-h.patch" - base_path: "source_subfolder" diff --git a/recipes/libidn/all/conanfile.py b/recipes/libidn/all/conanfile.py index 49221670d5e8e..2512e8efab52b 100644 --- a/recipes/libidn/all/conanfile.py +++ b/recipes/libidn/all/conanfile.py @@ -1,13 +1,14 @@ -from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, rmdir -from conan.tools.scm import Version -from conans import AutoToolsBuildEnvironment, tools -import contextlib -import functools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv, Environment +from conan.tools.files import get, rmdir, export_conandata_patches, apply_conandata_patches, copy, replace_in_file, rm, save +from conan.tools.gnu import AutotoolsToolchain, Autotools, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path, is_msvc + +required_conan_version = ">=1.53.0" class LibIdnConan(ConanFile): @@ -17,6 +18,8 @@ class LibIdnConan(ConanFile): topics = ("libidn", "encode", "decode", "internationalized", "domain", "name") license = "GPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,17 +32,12 @@ class LibIdnConan(ConanFile): "threads": True, } - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -47,91 +45,120 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): self.requires("libiconv/1.17") - def validate(self): - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Shared libraries are not supported on Windows due to libtool limitation") - def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - if self.settings.compiler == "Visual Studio": - self.build_requires("automake/1.16.5") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env = { - "CC": "{} cl -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "CXX": "{} cl -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "LD": "{} link -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), - } - with tools.environment_append(env): - yield - else: - yield + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autotools.libs = [] + tc = AutotoolsToolchain(self) if not self.options.shared: - autotools.defines.append("LIBIDN_STATIC") - if self.settings.compiler == "Visual Studio": - if Version(self.settings.compiler.version) >= "12": - autotools.flags.append("-FS") - autotools.link_flags.extend("-L{}".format(p.replace("\\", "/")) for p in self.deps_cpp_info.lib_paths) + tc.extra_defines.append("LIBIDN_STATIC") yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), + tc.configure_args += [ "--enable-threads={}".format(yes_no(self.options.threads)), - "--with-libiconv-prefix={}".format(tools.unix_path(self.deps_cpp_info["libiconv"].rootpath)), + "--with-libiconv-prefix={}".format(unix_path(self, self.dependencies["libiconv"].package_folder)), + "--disable-csharp", "--disable-nls", "--disable-rpath", ] - autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return autotools - - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - if self.settings.compiler == "Visual Studio": + if is_msvc(self): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.generate() + + if is_msvc(self): + env = Environment() + dep_info = self.dependencies["libiconv"].cpp_info.aggregated_components() + env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in dep_info.includedirs] + [f"-D{d}" for d in dep_info.defines]) + env.append("_LINK_", [lib if lib.endswith(".lib") else f"{lib}.lib" for lib in (dep_info.libs + dep_info.system_libs)]) + env.append("LDFLAGS", [f"-L{unix_path(self, p)}" for p in dep_info.libdirs] + dep_info.sharedlinkflags + dep_info.exelinkflags) + env.append("CFLAGS", dep_info.cflags) + env.vars(self).save_script("conanautotoolsdeps_cl_workaround") + else: + deps = AutotoolsDeps(self) + deps.generate() + + if is_msvc(self): + env = Environment() + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + # Workaround for iconv.lib not being found due to linker flag order + libiconv_libdir = unix_path(self, self.dependencies["libiconv"].cpp_info.aggregated_components().libdir) + env.define("CC", f"{compile_wrapper} cl -nologo -L{libiconv_libdir}") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f'{ar_wrapper} lib') + env.vars(self).save_script("conanbuild_msvc") + + def _patch_sources(self): + apply_conandata_patches(self) + # Disable examples and tests + for subdir in ["examples", "tests", "fuzz", "gltests", os.path.join("lib", "gltests"), "doc"]: + save(self, os.path.join(self.source_folder, subdir, "Makefile.in"), "all:\ninstall:\n") + + if is_msvc(self): if self.settings.arch in ("x86_64", "armv8", "armv8.3"): ssize = "signed long long int" else: ssize = "signed long int" - tools.replace_in_file(os.path.join(self._source_subfolder, "lib", "stringprep.h"), - "ssize_t", ssize) - with self._build_context(): - autotools = self._configure_autotools() - autotools.make(args=["V=1"]) + replace_in_file(self, os.path.join(self.source_folder, "lib", "stringprep.h"), "ssize_t", ssize) - def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() + if self.settings.os == "Windows": + # Otherwise tries to create a symlink from GNUmakefile to itself, which fails on Windows + replace_in_file(self, os.path.join(self.source_folder, "configure"), + '"$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;;', "") + replace_in_file(self, os.path.join(self.source_folder, "configure"), + 'ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"', "") + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) + + if is_msvc(self) and self.options.shared: + os.rename(os.path.join(self.package_folder, "lib", "idn.dll.lib"), + os.path.join(self.package_folder, "lib", "idn-12.lib")) def package_info(self): - self.cpp_info.libs = ["idn"] - self.cpp_info.names["pkg_config"] = "libidn" + if is_msvc(self) and self.options.shared: + self.cpp_info.libs = ["idn-12"] + else: + self.cpp_info.libs = ["idn"] + self.cpp_info.set_property("pkg_config_name", "libidn") if self.settings.os in ["Linux", "FreeBSD"]: if self.options.threads: self.cpp_info.system_libs = ["pthread"] @@ -139,7 +166,6 @@ def package_info(self): if not self.options.shared: self.cpp_info.defines = ["LIBIDN_STATIC"] + # TODO: to remove in conan v2 bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) self.env_info.PATH.append(bin_path) - diff --git a/recipes/libidn/all/test_package/CMakeLists.txt b/recipes/libidn/all/test_package/CMakeLists.txt index 7b9b613cbb24a..3482998466c6b 100644 --- a/recipes/libidn/all/test_package/CMakeLists.txt +++ b/recipes/libidn/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libidn REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libidn::libidn) diff --git a/recipes/libidn/all/test_package/conanfile.py b/recipes/libidn/all/test_package/conanfile.py index 07c965844de9b..441cef7471a37 100644 --- a/recipes/libidn/all/test_package/conanfile.py +++ b/recipes/libidn/all/test_package/conanfile.py @@ -1,10 +1,20 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,8 +22,8 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run("idn --help", run_environment=True) + if can_run(self): + self.run("idn --help", env="conanrun") - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libidn/all/test_v1_package/CMakeLists.txt b/recipes/libidn/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/libidn/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libidn/all/test_v1_package/conanfile.py b/recipes/libidn/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..3eaa9f0102538 --- /dev/null +++ b/recipes/libidn/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run("idn --help", run_environment=True) + + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libidn2/all/conandata.yml b/recipes/libidn2/all/conandata.yml index b710e69645f11..d33653d85c4f6 100644 --- a/recipes/libidn2/all/conandata.yml +++ b/recipes/libidn2/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "2.3.0": - patch_file: "patches/0001-no-versioning-of-symbols.patch" - base_path: "source_subfolder" diff --git a/recipes/libidn2/all/conanfile.py b/recipes/libidn2/all/conanfile.py index 0a83958ffe3fd..18257e8db29d2 100644 --- a/recipes/libidn2/all/conanfile.py +++ b/recipes/libidn2/all/conanfile.py @@ -1,18 +1,30 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from contextlib import contextmanager import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path + +required_conan_version = ">=1.53.0" class LibIdn(ConanFile): name = "libidn2" - description = "GNU Libidn is a fully documented implementation of the Stringprep, Punycode and IDNA 2003 specifications." - homepage = "https://www.gnu.org/software/libidn/" - topics = ("libidn", "encode", "decode", "internationalized", "domain", "name") + description = ( + "GNU Libidn is a fully documented implementation of the Stringprep, Punycode and IDNA 2003" + " specifications." + ) license = "GPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/libidn/" + topics = ("libidn", "encode", "decode", "internationalized", "domain", "name") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -21,17 +33,13 @@ class LibIdn(ConanFile): "shared": False, "fPIC": True, } - settings = "os", "arch", "compiler", "build_type" - - _autotools = None @property - def _source_subfolder(self): - return "source_subfolder" + def _settings_build(self): + return getattr(self, "settings_build", self.settings) def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -39,93 +47,104 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") - def requirements(self): - self.requires("libiconv/1.16") - - def validate(self): - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Shared libraries are not supported on Windows due to libtool limitation") + def layout(self): + basic_layout(self, src_folder="src") - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + def requirements(self): + self.requires("libiconv/1.17") def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - if self.settings.compiler == "Visual Studio": - self.build_requires("automake/1.16.4") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - env = { - "CC": "{} cl -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "CXX": "{} cl -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "LD": "{} link -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), - } - with tools.environment_append(env): - yield - else: - yield + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.libs = [] + tc = AutotoolsToolchain(self) if not self.options.shared: - self._autotools.defines.append("IDN2_STATIC") - if self.settings.compiler == "Visual Studio": - if tools.Version(self.settings.compiler.version) >= "12": - self._autotools.flags.append("-FS") - self._autotools.link_flags.extend("-L{}".format(p.replace("\\", "/")) for p in self.deps_cpp_info.lib_paths) - yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - "--with-libiconv-prefix={}".format(tools.unix_path(self.deps_cpp_info["libiconv"].rootpath)), + tc.extra_defines.append("IDN2_STATIC") + if is_msvc(self): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.configure_args += [ + f"--with-libiconv-prefix={unix_path(self, self.dependencies['libiconv'].package_folder)}", "--disable-nls", "--disable-rpath", ] - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools + tc.generate() + + if is_msvc(self): + env = Environment() + dep_info = self.dependencies["libiconv"].cpp_info.aggregated_components() + env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in dep_info.includedirs] + [f"-D{d}" for d in dep_info.defines]) + env.append("_LINK_", [lib if lib.endswith(".lib") else f"{lib}.lib" for lib in (dep_info.libs + dep_info.system_libs)]) + env.append("LDFLAGS", [f"-L{unix_path(self, p)}" for p in dep_info.libdirs] + dep_info.sharedlinkflags + dep_info.exelinkflags) + env.append("CFLAGS", dep_info.cflags) + env.vars(self).save_script("conanautotoolsdeps_cl_workaround") + else: + deps = AutotoolsDeps(self) + deps.generate() + + if is_msvc(self): + env = Environment() + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + dumpbin_nm = unix_path(self, os.path.join(self.source_folder, "dumpbin_nm.py")) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f'{ar_wrapper} lib') + env.vars(self).save_script("conanbuild_msvc") def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() os.unlink(os.path.join(self.package_folder, "lib", "libidn2.la")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + if is_msvc(self) and self.options.shared: + os.rename(os.path.join(self.package_folder, "lib", "idn2.dll.lib"), + os.path.join(self.package_folder, "lib", "idn2-0.lib")) + copy(self, "idn2.exe", + os.path.join(self.build_folder, "src", ".libs"), + os.path.join(self.package_folder, "bin")) def package_info(self): - self.cpp_info.libs = ["idn2"] - self.cpp_info.names["pkg_config"] = "libidn2" + if is_msvc(self) and self.options.shared: + self.cpp_info.libs = ["idn2-0"] + else: + self.cpp_info.libs = ["idn2"] + self.cpp_info.set_property("pkg_config_name", "libidn2") if self.settings.os == "Windows": if not self.options.shared: self.cpp_info.defines = ["IDN2_STATIC"] bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) self.env_info.PATH.append(bin_path) diff --git a/recipes/libidn2/all/test_package/CMakeLists.txt b/recipes/libidn2/all/test_package/CMakeLists.txt index 7b9b613cbb24a..2279e3cb07d2a 100644 --- a/recipes/libidn2/all/test_package/CMakeLists.txt +++ b/recipes/libidn2/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libidn2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libidn2::libidn2) diff --git a/recipes/libidn2/all/test_package/conanfile.py b/recipes/libidn2/all/test_package/conanfile.py index ae0c2ab3c933c..f56ad0548e3d9 100644 --- a/recipes/libidn2/all/test_package/conanfile.py +++ b/recipes/libidn2/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,9 +21,8 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run("idn2 --help", run_environment=True) - - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + self.run("idn2 --help", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libidn2/all/test_v1_package/CMakeLists.txt b/recipes/libidn2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/libidn2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libidn2/all/test_v1_package/conanfile.py b/recipes/libidn2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a5e01055d3933 --- /dev/null +++ b/recipes/libidn2/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run("idn2 --help", run_environment=True) + + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + diff --git a/recipes/libigl/2.x.x/CMakeLists.txt b/recipes/libigl/2.x.x/CMakeLists.txt deleted file mode 100644 index 64994fe16fd84..0000000000000 --- a/recipes/libigl/2.x.x/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -project(conanlibigl) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -find_package(Eigen3 REQUIRED) - -add_subdirectory(source_subfolder) diff --git a/recipes/libigl/2.x.x/conandata.yml b/recipes/libigl/2.x.x/conandata.yml deleted file mode 100644 index 1ac5bf040c202..0000000000000 --- a/recipes/libigl/2.x.x/conandata.yml +++ /dev/null @@ -1,8 +0,0 @@ -sources: - "2.3.0": - sha256: 5124443c2657023394039fe56fb240d4f7a867723ee4ebba053eaeb881ed7455 - url: https://github.com/libigl/libigl/archive/refs/tags/v2.3.0.zip -patches: - "2.3.0": - - patch_file: "patches/0001-correct-fpic.patch" - base_path: "source_subfolder" diff --git a/recipes/libigl/2.x.x/conanfile.py b/recipes/libigl/2.x.x/conanfile.py deleted file mode 100644 index f5ac50b8841ac..0000000000000 --- a/recipes/libigl/2.x.x/conanfile.py +++ /dev/null @@ -1,140 +0,0 @@ -import os -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration - - -class LibiglConan(ConanFile): - name = "libigl" - description = ("Simple C++ geometry processing library") - topics = ("conan", "libigl", "geometry", "matrices", "algorithms") - url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt", "patches/**"] - homepage = "https://libigl.github.io/" - license = "MPL-2.0" - settings = "os", "arch", "compiler", "build_type" - options = {"header_only": [True, False], "fPIC": [True, False]} - default_options = {"header_only": True, "fPIC": True} - generators = "cmake", "cmake_find_package" - requires = ("eigen/3.3.9") - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - @property - def _minimum_cpp_standard(self): - return 14 - - @property - def _minimum_compilers_version(self): - return { - "Visual Studio": "16", - "gcc": "6", - "clang": "3.4", - "apple-clang": "5.1", - } - - 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)) - 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++{} support. The current compiler {} {} does not support it.".format( - self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) - if self.settings.compiler == "Visual Studio" and "MT" in self.settings.compiler.runtime and not self.options.header_only: - raise ConanInvalidConfiguration("Visual Studio build with MT runtime is not supported") - if "arm" in self.settings.arch or "x86" is self.settings.arch: - raise ConanInvalidConfiguration("Not available for arm. Requested arch: {}".format(self.settings.arch)) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def configure(self): - if self.options.header_only: - del self.options.fPIC - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self, parallel=False) - self._cmake.definitions["LIBIGL_EXPORT_TARGETS"] = True - self._cmake.definitions["LIBIGL_USE_STATIC_LIBRARY"] = not self.options.header_only - - # All these dependencies are needed to build the examples or the tests - self._cmake.definitions["LIBIGL_BUILD_TUTORIALS"] = "OFF" - self._cmake.definitions["LIBIGL_BUILD_TESTS"] = "OFF" - self._cmake.definitions["LIBIGL_BUILD_PYTHON"] = "OFF" - - self._cmake.definitions["LIBIGL_WITH_CGAL"] = False - self._cmake.definitions["LIBIGL_WITH_COMISO"] = False - self._cmake.definitions["LIBIGL_WITH_CORK"] = False - self._cmake.definitions["LIBIGL_WITH_EMBREE"] = False - self._cmake.definitions["LIBIGL_WITH_MATLAB"] = False - self._cmake.definitions["LIBIGL_WITH_MOSEK"] = False - self._cmake.definitions["LIBIGL_WITH_OPENGL"] = False - self._cmake.definitions["LIBIGL_WITH_OPENGL_GLFW"] = False - self._cmake.definitions["LIBIGL_WITH_OPENGL_GLFW_IMGUI"] = False - self._cmake.definitions["LIBIGL_WITH_PNG"] = False - self._cmake.definitions["LIBIGL_WITH_TETGEN"] = False - self._cmake.definitions["LIBIGL_WITH_TRIANGLE"] = False - self._cmake.definitions["LIBIGL_WITH_XML"] = False - self._cmake.definitions["LIBIGL_WITH_PYTHON"] = "OFF" - self._cmake.definitions["LIBIGL_WITH_PREDICATES"] = False - return self._cmake - - def build(self): - self._patch_sources() - cmake = self._configure_cmake() - cmake.configure() - cmake.build() - - def package(self): - cmake = self._configure_cmake() - cmake.install() - self.copy("LICENSE.GPL", dst="licenses", src=self._source_subfolder) - self.copy("LICENSE.MPL2", dst="licenses", src=self._source_subfolder) - - tools.rmdir(os.path.join(self.package_folder, "share")) - if not self.options.header_only: - tools.remove_files_by_mask(self.package_folder, "*.c") - tools.remove_files_by_mask(self.package_folder, "*.cpp") - - def package_id(self): - if self.options.header_only: - self.info.header_only() - - def package_info(self): - self.cpp_info.filenames["cmake_find_package"] = "libigl" - self.cpp_info.filenames["cmake_find_package_multi"] = "libigl" - self.cpp_info.names["cmake_find_package"] = "igl" - self.cpp_info.names["cmake_find_package_multi"] = "igl" - - self.cpp_info.components["igl_common"].names["cmake_find_package"] = "common" - self.cpp_info.components["igl_common"].names["cmake_find_package_multi"] = "common" - self.cpp_info.components["igl_common"].libs = [] - self.cpp_info.components["igl_common"].requires = ["eigen::eigen"] - if self.settings.os == "Linux": - self.cpp_info.components["igl_common"].system_libs = ["pthread"] - - self.cpp_info.components["igl_core"].names["cmake_find_package"] = "core" - self.cpp_info.components["igl_core"].names["cmake_find_package_multi"] = "core" - self.cpp_info.components["igl_core"].requires = ["igl_common"] - if not self.options.header_only: - self.cpp_info.components["igl_core"].libs = ["igl"] - self.cpp_info.components["igl_core"].defines.append("IGL_STATIC_LIBRARY") diff --git a/recipes/libigl/2.x.x/patches/0001-correct-fpic.patch b/recipes/libigl/2.x.x/patches/0001-correct-fpic.patch deleted file mode 100644 index 6a5a6c38650c0..0000000000000 --- a/recipes/libigl/2.x.x/patches/0001-correct-fpic.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/cmake/libigl.cmake b/cmake/libigl.cmake -index 6de1b418..0cc75fcd 100644 ---- a/cmake/libigl.cmake -+++ b/cmake/libigl.cmake -@@ -96,11 +96,6 @@ if(BUILD_SHARED_LIBS) - set_target_properties(igl_common PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON) - endif() - --if(UNIX AND NOT HUNTER_ENABLED) -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") --endif() -- - if(HUNTER_ENABLED) - hunter_add_package(Eigen) - find_package(Eigen3 CONFIG REQUIRED) - diff --git a/recipes/libigl/2.x.x/test_package/CMakeLists.txt b/recipes/libigl/2.x.x/test_package/CMakeLists.txt deleted file mode 100644 index 174c1ae49d642..0000000000000 --- a/recipes/libigl/2.x.x/test_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libigl REQUIRED CONFIG) - -add_executable(example example.cpp) -target_link_libraries(example igl::core) -target_compile_features(example PUBLIC cxx_std_11) diff --git a/recipes/libigl/all/conan_deps.cmake b/recipes/libigl/all/conan_deps.cmake new file mode 100644 index 0000000000000..4c824341569d9 --- /dev/null +++ b/recipes/libigl/all/conan_deps.cmake @@ -0,0 +1 @@ +find_package(Eigen3 REQUIRED) diff --git a/recipes/libigl/all/conandata.yml b/recipes/libigl/all/conandata.yml new file mode 100644 index 0000000000000..d6842af62c120 --- /dev/null +++ b/recipes/libigl/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.5.0": + url: "https://github.com/libigl/libigl/archive/refs/tags/v2.5.0.zip" + sha256: "84af6a5f9266a4c1ce530f9ef8028c8a3569318563012d72a753622f61ea2f68" + "2.3.0": + url: "https://github.com/libigl/libigl/archive/refs/tags/v2.3.0.zip" + sha256: "5124443c2657023394039fe56fb240d4f7a867723ee4ebba053eaeb881ed7455" +patches: + "2.3.0": + - patch_file: "patches/001-replace-random_shuffle.patch" + patch_type: "portability" + patch_description: "Replace std::random_shuffle that was removed in C++17" + patch_source: "https://github.com/libigl/libigl/commit/3f3d186db7c2f5ce79194c3439134ca5faf2818a" diff --git a/recipes/libigl/all/conanfile.py b/recipes/libigl/all/conanfile.py new file mode 100644 index 0000000000000..354d3819dc46d --- /dev/null +++ b/recipes/libigl/all/conanfile.py @@ -0,0 +1,210 @@ +import os + +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration, ConanException +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, replace_in_file, export_conandata_patches, apply_conandata_patches +from conan.tools.microsoft import is_msvc_static_runtime +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class LibiglConan(ConanFile): + name = "libigl" + description = "Simple C++ geometry processing library" + # As per https://libigl.github.io/license/, the library itself is MPL-2, components are not + # No issue as we don't build them, but if done so in the future, please update this field! + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libigl.github.io/" + topics = ("geometry", "matrices", "algorithms", "header-only") + + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "header_only": [True, False], + } + default_options = { + "fPIC": True, + "header_only": False, + } + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "6", + "clang": "3.4", + "apple-clang": "5.1", + } + + def export_sources(self): + export_conandata_patches(self) + copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.header_only: + self.options.rm_safe("fPIC") + # No automatic detection for non "library" package-types, manually override + self.package_type = "header-library" + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) >= "2.5.0": + self.requires("eigen/3.4.0", transitive_headers=True) + else: + # 3.4.0 is not compatible with older versions + self.requires("eigen/3.3.9", transitive_headers=True) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") + + def package_id(self): + if self.info.options.header_only: + self.info.clear() + + def validate(self): + if "arm" in self.settings.arch or self.settings.arch == "x86": + raise ConanInvalidConfiguration(f"Not available for arm. Requested arch: {self.settings.arch}") + if is_msvc_static_runtime(self) and not self.options.header_only: + raise ConanInvalidConfiguration("Visual Studio build with MT runtime is not supported") + + if self.version == "2.3.0" and conan_version.major == 1 and self.settings.build_type == "Debug": + raise ConanInvalidConfiguration("Debug build disabled for Conan 1.x due to excessive memory use in ConanCenter CI") + + def loose_lt_semver(v1, v2): + return all(int(p1) < int(p2) for p1, p2 in zip(str(v1).split("."), str(v2).split("."))) + + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if min_version and loose_lt_semver(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): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + tc.variables["CMAKE_PROJECT_libigl_INCLUDE"] = "conan_deps.cmake" + tc.variables["LIBIGL_USE_STATIC_LIBRARY"] = not self.options.header_only + tc.variables["LIBIGL_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0048"] = "NEW" + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + + # All these dependencies are needed to build the examples or the tests + tc.variables["LIBIGL_BUILD_TUTORIALS"] = False + tc.variables["LIBIGL_BUILD_TESTS"] = False + tc.variables["LIBIGL_BUILD_PYTHON"] = False + + if Version(self.version) >= "2.4.0": + tc.variables["LIBIGL_EMBREE"] = False + tc.variables["LIBIGL_GLFW"] = False + tc.variables["LIBIGL_IMGUI"] = False + tc.variables["LIBIGL_OPENGL"] = False + tc.variables["LIBIGL_STB"] = False + tc.variables["LIBIGL_PREDICATES"] = False + tc.variables["LIBIGL_SPECTRA"] = False + tc.variables["LIBIGL_XML"] = False + tc.variables["LIBIGL_COPYLEFT_CORE"] = False + tc.variables["LIBIGL_COPYLEFT_CGAL"] = False + tc.variables["LIBIGL_COPYLEFT_COMISO"] = False + tc.variables["LIBIGL_COPYLEFT_TETGEN"] = False + tc.variables["LIBIGL_RESTRICTED_MATLAB"] = False + tc.variables["LIBIGL_RESTRICTED_MOSEK"] = False + tc.variables["LIBIGL_RESTRICTED_TRIANGLE"] = False + tc.variables["LIBIGL_GLFW_TESTS"] = False + else: + tc.variables["LIBIGL_EXPORT_TARGETS"] = True + tc.variables["LIBIGL_WITH_EMBREE"] = False + tc.variables["LIBIGL_WITH_OPENGL_GLFW"] = False + tc.variables["LIBIGL_WITH_OPENGL_GLFW_IMGUI"] = False + tc.variables["LIBIGL_WITH_OPENGL"] = False + tc.variables["LIBIGL_WITH_PNG"] = False + tc.variables["LIBIGL_WITH_PREDICATES"] = False + tc.variables["LIBIGL_WITH_XML"] = False + tc.variables["LIBIGL_WITH_CGAL"] = False + tc.variables["LIBIGL_WITH_COMISO"] = False + tc.variables["LIBIGL_WITH_CORK"] = False + tc.variables["LIBIGL_WITH_TETGEN"] = False + tc.variables["LIBIGL_WITH_MATLAB"] = False + tc.variables["LIBIGL_WITH_MOSEK"] = False + tc.variables["LIBIGL_WITH_TRIANGLE"] = False + tc.variables["LIBIGL_WITH_PYTHON"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if Version(self.version) < "2.4.0": + libigl_cmake = os.path.join(self.source_folder, "cmake", "libigl.cmake") + replace_in_file(self, libigl_cmake, "-fPIC", "") + replace_in_file(self, libigl_cmake, "INTERFACE_POSITION_INDEPENDENT_CODE ON", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + try: + cmake.build() + except ConanException: + # Workaround for C3I running out of memory during build + self.conf.define("tools.build:jobs", 1) + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + # If components are built and packaged in the future, uncomment this line, their license is different + # copy(self, "LICENSE.GPL", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE.MPL2", 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, "lib", "cmake")) + if not self.options.header_only: + rm(self, "*.c", self.package_folder, recursive=True) + rm(self, "*.cpp", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libigl") + self.cpp_info.set_property("cmake_target_name", "igl::igl") + + self.cpp_info.components["common"].set_property("cmake_target_name", "igl::common") + self.cpp_info.components["common"].requires = ["eigen::eigen"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["common"].system_libs = ["pthread"] + + self.cpp_info.components["core"].set_property("cmake_target_name", "igl::core") + self.cpp_info.components["core"].requires = ["common"] + if not self.options.header_only: + self.cpp_info.components["core"].libs = ["igl"] + self.cpp_info.components["core"].defines.append("IGL_STATIC_LIBRARY") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "libigl" + self.cpp_info.filenames["cmake_find_package_multi"] = "libigl" + self.cpp_info.names["cmake_find_package"] = "igl" + self.cpp_info.names["cmake_find_package_multi"] = "igl" diff --git a/recipes/libigl/all/patches/001-replace-random_shuffle.patch b/recipes/libigl/all/patches/001-replace-random_shuffle.patch new file mode 100644 index 0000000000000..fa53d862ad422 --- /dev/null +++ b/recipes/libigl/all/patches/001-replace-random_shuffle.patch @@ -0,0 +1,31 @@ +From 3f3d186db7c2f5ce79194c3439134ca5faf2818a Mon Sep 17 00:00:00 2001 +From: Jeremie Dumas +Date: Wed, 5 Jan 2022 11:26:47 -0800 +Subject: [PATCH] Fix blue noise random shuffle. + +--- + include/igl/blue_noise.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/include/igl/blue_noise.cpp b/include/igl/blue_noise.cpp +index ac447feb42..10df1ad1ba 100644 +--- a/include/igl/blue_noise.cpp ++++ b/include/igl/blue_noise.cpp +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + namespace igl + { +@@ -209,7 +210,8 @@ namespace igl + } + //printf(" --------\n"); + // randomize order: this might be a little paranoid... +- std::random_shuffle(std::begin(N), std::end(N)); ++ std::mt19937 twister; ++ std::shuffle(std::begin(N), std::end(N), twister); + bool found = false; + for(const BlueNoiseKeyType & nk : N) + { diff --git a/recipes/libigl/all/test_package/CMakeLists.txt b/recipes/libigl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..eba5d0a0a901d --- /dev/null +++ b/recipes/libigl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +find_package(libigl REQUIRED CONFIG) + +add_executable(example example.cpp) +target_link_libraries(example igl::core) +target_compile_features(example PUBLIC cxx_std_11) diff --git a/recipes/libigl/all/test_package/conanfile.py b/recipes/libigl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8d52b7021efe1 --- /dev/null +++ b/recipes/libigl/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, "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/libigl/2.x.x/test_package/example.cpp b/recipes/libigl/all/test_package/example.cpp similarity index 100% rename from recipes/libigl/2.x.x/test_package/example.cpp rename to recipes/libigl/all/test_package/example.cpp diff --git a/recipes/libigl/all/test_v1_package/CMakeLists.txt b/recipes/libigl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/libigl/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/libigl/2.x.x/test_package/conanfile.py b/recipes/libigl/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/libigl/2.x.x/test_package/conanfile.py rename to recipes/libigl/all/test_v1_package/conanfile.py diff --git a/recipes/libigl/config.yml b/recipes/libigl/config.yml index 58d1203871eb7..7578fb2ee13b0 100644 --- a/recipes/libigl/config.yml +++ b/recipes/libigl/config.yml @@ -1,3 +1,5 @@ versions: + "2.5.0": + folder: "all" "2.3.0": - folder: "2.x.x" + folder: "all" diff --git a/recipes/libinput/all/conandata.yml b/recipes/libinput/all/conandata.yml new file mode 100644 index 0000000000000..541bad5e261c8 --- /dev/null +++ b/recipes/libinput/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.25.0": + url: "https://gitlab.freedesktop.org/libinput/libinput/-/archive/1.25.0/libinput-1.25.0.tar.bz2" + sha256: "193bd592298bd9e369c0ef3e5d83a6a9d68ddc4cd3dfc84bbe77920a8d0d57df" diff --git a/recipes/libinput/all/conanfile.py b/recipes/libinput/all/conanfile.py new file mode 100644 index 0000000000000..0b86139ccb90d --- /dev/null +++ b/recipes/libinput/all/conanfile.py @@ -0,0 +1,154 @@ +import os +import textwrap + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rmdir, save +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain + + +required_conan_version = ">=1.60.0 <2.0 || >=2.0.5" + + +class LibinputConan(ConanFile): + name = "libinput" + description = "libinput is a library that handles input devices for display servers and other applications that need to directly deal with input devices." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.freedesktop.org/wiki/Software/libinput/" + topics = ("device", "display", "event", "input") + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "epoll_dir": [None, "ANY"], + "debug_gui": [True, False], + "with_libudev": ["eudev", "systemd"], + "with_libwacom": [True, False], + "with_wayland": [True, False], + "with_x11": [True, False], + } + default_options = { + "epoll_dir": None, + "debug_gui": False, + "with_libudev": "systemd", + # todo Package libwacom and enable this option by default. + "with_libwacom": False, + "with_wayland": True, + "with_x11": True, + } + + @property + def _has_build_profile(self): + return hasattr(self, "settings_build") + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + if not self.options.debug_gui: + self.options.rm_safe("with_wayland") + self.options.rm_safe("with_x11") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("mtdev/1.1.6") + self.requires("libevdev/1.13.1") + + if self.options.debug_gui: + self.requires("cairo/1.18.0") + self.requires("glib/2.78.3") + self.requires("gtk/system") + if self.options.with_wayland: + self.requires("wayland/1.22.0") + if self.options.with_x11: + self.requires("xorg/system") + + if self.options.with_libudev == "systemd": + self.requires("libudev/system", transitive_libs=True) + elif self.options.with_libudev == "eudev": + self.requires("eudev/3.2.14", transitive_libs=True) + + def validate(self): + if self.settings.os not in ["FreeBSD", "Linux"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + if self.options.with_libwacom: + raise ConanInvalidConfiguration(f"The with_libwacom option for {self.ref} is not yet supported. Contributions welcome.") + + def build_requirements(self): + self.tool_requires("meson/1.3.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + if self.options.get_safe("with_wayland"): + if self._has_build_profile: + self.tool_requires("wayland/") + self.tool_requires("wayland-protocols/1.33") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = VirtualBuildEnv(self) + tc.generate() + if self.options.get_safe("with_wayland") and not self._has_build_profile: + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = MesonToolchain(self) + tc.project_options["build.pkg_config_path"] = self.generators_folder + tc.project_options["coverity"] = False + tc.project_options["datadir"] = "res" + tc.project_options["documentation"] = False + tc.project_options["epoll-dir"] = '' if self.options.epoll_dir is None else str(self.options.epoll_dir) + tc.project_options["debug-gui"] = self.options.debug_gui + tc.project_options["install-tests"] = False + # Change libexecdir so that the libinput subdirectory in the bin directory doesn't conflict with the libinput executable. + tc.project_options["libexecdir"] = "libexec" + tc.project_options["libwacom"] = self.options.with_libwacom + tc.project_options["tests"] = False + tc.generate() + pkg_config_deps = PkgConfigDeps(self) + if self.options.get_safe("with_wayland"): + if self._has_build_profile: + pkg_config_deps.build_context_activated = ["wayland-protocols"] + else: + # Manually generate pkgconfig file of wayland-protocols since + # PkgConfigDeps.build_context_activated can't work with legacy 1 profile + wp_prefix = self.dependencies.build["wayland-protocols"].package_folder + wp_version = self.dependencies.build["wayland-protocols"].ref.version + wp_pkg_content = textwrap.dedent(f"""\ + prefix={wp_prefix} + datarootdir=${{prefix}}/res + pkgdatadir=${{datarootdir}}/wayland-protocols + Name: Wayland Protocols + Description: Wayland protocol files + Version: {wp_version} + """) + save(self, os.path.join(self.generators_folder, "wayland-protocols.pc"), wp_pkg_content) + pkg_config_deps.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + + copy(self, f"{self.name}-*", os.path.join(self.package_folder, "libexec", self.name), os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "libexec")) + + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "res", "zsh")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["input"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "rt"]) diff --git a/recipes/libinput/all/test_package/conanfile.py b/recipes/libinput/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cdcf9b281723d --- /dev/null +++ b/recipes/libinput/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "PkgConfigDeps", "MesonToolchain", "VirtualRunEnv", "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires("meson/1.3.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libinput/all/test_package/meson.build b/recipes/libinput/all/test_package/meson.build new file mode 100644 index 0000000000000..2dea5d2c4a326 --- /dev/null +++ b/recipes/libinput/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +package_dep = dependency('libinput') +executable('test_package', + sources : ['test_package.c'], + dependencies : [package_dep]) diff --git a/recipes/libinput/all/test_package/test_package.c b/recipes/libinput/all/test_package/test_package.c new file mode 100644 index 0000000000000..6a8e1e6d99fe9 --- /dev/null +++ b/recipes/libinput/all/test_package/test_package.c @@ -0,0 +1,54 @@ +#include +#include +#include +#include +#include + +#include +#include + +static int +open_restricted(const char *path, int flags, void *user_data) +{ + int fd = open(path, flags); + return fd < 0 ? -1 : fd; +} + +static void +close_restricted(int fd, void *user_data) +{ + close(fd); +} + +static const struct libinput_interface interface = { + .open_restricted = open_restricted, + .close_restricted = close_restricted, +}; + +int main(void) { + bool grab = false; + struct libinput *li; + struct udev *udev = udev_new(); + if (!udev) { + fprintf(stderr, "Failed to initialize udev\n"); + return EXIT_FAILURE; + } + + li = libinput_udev_create_context(&interface, &grab, udev); + if (!li) { + fprintf(stderr, "Failed to initialize libinput context from udev\n"); + udev_unref(udev); + return EXIT_FAILURE; + } + + if (libinput_udev_assign_seat(li, "seat0")) { + fprintf(stderr, "Failed to set seat\n"); + libinput_unref(li); + li = NULL; + udev_unref(udev); + return EXIT_FAILURE; + } + + udev_unref(udev); + return EXIT_SUCCESS; +} diff --git a/recipes/libinput/config.yml b/recipes/libinput/config.yml new file mode 100644 index 0000000000000..3f07e920910b2 --- /dev/null +++ b/recipes/libinput/config.yml @@ -0,0 +1,3 @@ +versions: + "1.25.0": + folder: all diff --git a/recipes/libjpeg-turbo/all/conandata.yml b/recipes/libjpeg-turbo/all/conandata.yml index 0fb3e348f183d..40dc5dfa58b25 100644 --- a/recipes/libjpeg-turbo/all/conandata.yml +++ b/recipes/libjpeg-turbo/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.3": + url: "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.3/libjpeg-turbo-3.0.3.tar.gz" + sha256: "343e789069fc7afbcdfe44dbba7dbbf45afa98a15150e079a38e60e44578865d" "3.0.2": url: "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.2/libjpeg-turbo-3.0.2.tar.gz" sha256: "c2ce515a78d91b09023773ef2770d6b0df77d674e144de80d63e0389b3a15ca6" diff --git a/recipes/libjpeg-turbo/all/test_package/conanfile.py b/recipes/libjpeg-turbo/all/test_package/conanfile.py index fb5d85902cc52..0a6bc68712d90 100644 --- a/recipes/libjpeg-turbo/all/test_package/conanfile.py +++ b/recipes/libjpeg-turbo/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_name = os.path.join(self.source_folder, "testimg.jpg") - self.run(f"{bin_path} {img_name}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/libjpeg-turbo/all/test_package/test_package.c b/recipes/libjpeg-turbo/all/test_package/test_package.c index 2f94478d7ef6f..243a65f0efd44 100644 --- a/recipes/libjpeg-turbo/all/test_package/test_package.c +++ b/recipes/libjpeg-turbo/all/test_package/test_package.c @@ -1,528 +1,9 @@ -/* - * rdjpgcom.c - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * Modified 2009 by Bill Allombert, Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a very simple stand-alone application that displays - * the text in COM (comment) markers in a JFIF file. - * This may be useful as an example of the minimum logic needed to parse - * JPEG markers. - */ - #include -#include -#include - -#define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */ -#include "jpeglib.h" /* get auto-config symbols, */ - -#ifdef HAVE_LOCALE_H -#include /* Bill Allombert: use locale for isprint */ -#endif -#include /* to declare isupper(), tolower() */ -#ifdef USE_SETMODE -#include /* to declare setmode()'s parameter macros */ -/* If you have setmode() but not , just delete this line: */ -#include /* to declare setmode() */ -#endif - -#ifdef USE_CCOMMAND /* command-line reader for Macintosh */ -#ifdef __MWERKS__ -#include /* Metrowerks needs this */ -#include /* ... and this */ -#endif -#ifdef THINK_C -#include /* Think declares it here */ -#endif -#endif - -#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ -#define READ_BINARY "r" -#else -#ifdef VMS /* VMS is very nonstandard */ -#define READ_BINARY "rb", "ctx=stm" -#else /* standard ANSI-compliant case */ -#define READ_BINARY "rb" -#endif -#endif - -#ifndef EXIT_FAILURE /* define exit() codes if not provided */ -#define EXIT_FAILURE 1 -#endif -#ifndef EXIT_SUCCESS -#ifdef VMS -#define EXIT_SUCCESS 1 /* VMS is very nonstandard */ -#else -#define EXIT_SUCCESS 0 -#endif -#endif - -/* - * These macros are used to read the input file. - * To reuse this code in another application, you might need to change these. - */ - -static FILE *infile; /* input JPEG file */ - -/* Return next input byte, or EOF if no more */ -#define NEXTBYTE() getc(infile) - -/* Error exit handler */ -#define ERREXIT(msg) (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE)) - -/* Read one byte, testing for EOF */ -static int read_1_byte(void) { - int c; - - c = NEXTBYTE(); - if (c == EOF) - ERREXIT("Premature EOF in JPEG file"); - return c; -} - -/* Read 2 bytes, convert to unsigned int */ -/* All 2-byte quantities in JPEG markers are MSB first */ -static unsigned int read_2_bytes(void) { - int c1, c2; - - c1 = NEXTBYTE(); - if (c1 == EOF) - ERREXIT("Premature EOF in JPEG file"); - c2 = NEXTBYTE(); - if (c2 == EOF) - ERREXIT("Premature EOF in JPEG file"); - return (((unsigned int)c1) << 8) + ((unsigned int)c2); -} - -/* - * JPEG markers consist of one or more 0xFF bytes, followed by a marker - * code byte (which is not an FF). Here are the marker codes of interest - * in this program. (See jdmarker.c for a more complete list.) - */ - -#define M_SOF0 0xC0 /* Start Of Frame N */ -#define M_SOF1 0xC1 /* N indicates which compression process */ -#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ -#define M_SOF3 0xC3 -#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ -#define M_SOF6 0xC6 -#define M_SOF7 0xC7 -#define M_SOF9 0xC9 -#define M_SOF10 0xCA -#define M_SOF11 0xCB -#define M_SOF13 0xCD -#define M_SOF14 0xCE -#define M_SOF15 0xCF -#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */ -#define M_EOI 0xD9 /* End Of Image (end of datastream) */ -#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ -#define M_APP0 0xE0 /* Application-specific marker, type N */ -#define M_APP12 0xEC /* (we don't bother to list all 16 APPn's) */ -#define M_COM 0xFE /* COMment */ - -/* - * Find the next JPEG marker and return its marker code. - * We expect at least one FF byte, possibly more if the compressor used FFs - * to pad the file. - * There could also be non-FF garbage between markers. The treatment of such - * garbage is unspecified; we choose to skip over it but emit a warning msg. - * NB: this routine must not be used after seeing SOS marker, since it will - * not deal correctly with FF/00 sequences in the compressed image data... - */ - -static int next_marker(void) { - int c; - int discarded_bytes = 0; - - /* Find 0xFF byte; count and skip any non-FFs. */ - c = read_1_byte(); - while (c != 0xFF) { - discarded_bytes++; - c = read_1_byte(); - } - /* Get marker code byte, swallowing any duplicate FF bytes. Extra FFs - * are legal as pad bytes, so don't count them in discarded_bytes. - */ - do { - c = read_1_byte(); - } while (c == 0xFF); - - if (discarded_bytes != 0) { - fprintf(stderr, "Warning: garbage data found in JPEG file\n"); - } - - return c; -} - -/* - * Read the initial marker, which should be SOI. - * For a JFIF file, the first two bytes of the file should be literally - * 0xFF M_SOI. To be more general, we could use next_marker, but if the - * input file weren't actually JPEG at all, next_marker might read the whole - * file and then return a misleading error message... - */ - -static int first_marker(void) { - int c1, c2; - - c1 = NEXTBYTE(); - c2 = NEXTBYTE(); - if (c1 != 0xFF || c2 != M_SOI) - { - ERREXIT("Not a JPEG file"); - } - return c2; -} - -/* - * Most types of marker are followed by a variable-length parameter segment. - * This routine skips over the parameters for any marker we don't otherwise - * want to process. - * Note that we MUST skip the parameter segment explicitly in order not to - * be fooled by 0xFF bytes that might appear within the parameter segment; - * such bytes do NOT introduce new markers. - */ - -static void skip_variable(void) -/* Skip over an unknown or uninteresting variable-length marker */ -{ - unsigned int length; - - /* Get the marker parameter length count */ - length = read_2_bytes(); - /* Length includes itself, so must be at least 2 */ - if (length < 2) - ERREXIT("Erroneous JPEG marker length"); - length -= 2; - /* Skip over the remaining bytes */ - while (length > 0) { - (void)read_1_byte(); - length--; - } -} - -/* - * Process a COM marker. - * We want to print out the marker contents as legible text; - * we must guard against non-text junk and varying newline representations. - */ - -static void process_COM(int raw) { - unsigned int length; - int ch; - int lastch = 0; - -/* Bill Allombert: set locale properly for isprint */ -#ifdef HAVE_LOCALE_H - setlocale(LC_CTYPE, ""); -#endif - - /* Get the marker parameter length count */ - length = read_2_bytes(); - /* Length includes itself, so must be at least 2 */ - if (length < 2) - ERREXIT("Erroneous JPEG marker length"); - length -= 2; - - while (length > 0) { - ch = read_1_byte(); - if (raw) { - putc(ch, stdout); - /* Emit the character in a readable form. - * Nonprintables are converted to \nnn form, - * while \ is converted to \\. - * Newlines in CR, CR/LF, or LF form will be printed as one newline. - */ - } else if (ch == '\r') { - printf("\n"); - } else if (ch == '\n') { - if (lastch != '\r') - printf("\n"); - } else if (ch == '\\') { - printf("\\\\"); - } else if (isprint(ch)) { - putc(ch, stdout); - } else { - printf("\\%03o", ch); - } - lastch = ch; - length--; - } - printf("\n"); - -/* Bill Allombert: revert to C locale */ -#ifdef HAVE_LOCALE_H - setlocale(LC_CTYPE, "C"); -#endif -} - -/* - * Process a SOFn marker. - * This code is only needed if you want to know the image dimensions... - */ - -static void process_SOFn(int marker) { - unsigned int length; - unsigned int image_height, image_width; - int data_precision, num_components; - const char *process; - int ci; - - length = read_2_bytes(); /* usual parameter length count */ - - data_precision = read_1_byte(); - image_height = read_2_bytes(); - image_width = read_2_bytes(); - num_components = read_1_byte(); - - switch (marker) { - case M_SOF0: - process = "Baseline"; - break; - case M_SOF1: - process = "Extended sequential"; - break; - case M_SOF2: - process = "Progressive"; - break; - case M_SOF3: - process = "Lossless"; - break; - case M_SOF5: - process = "Differential sequential"; - break; - case M_SOF6: - process = "Differential progressive"; - break; - case M_SOF7: - process = "Differential lossless"; - break; - case M_SOF9: - process = "Extended sequential, arithmetic coding"; - break; - case M_SOF10: - process = "Progressive, arithmetic coding"; - break; - case M_SOF11: - process = "Lossless, arithmetic coding"; - break; - case M_SOF13: - process = "Differential sequential, arithmetic coding"; - break; - case M_SOF14: - process = "Differential progressive, arithmetic coding"; - break; - case M_SOF15: - process = "Differential lossless, arithmetic coding"; - break; - default: - process = "Unknown"; - break; - } - - printf("JPEG image is %uw * %uh, %d color components, %d bits per sample\n", - image_width, image_height, num_components, data_precision); - printf("JPEG process: %s\n", process); - - if (length != (unsigned int)(8 + num_components * 3)) - ERREXIT("Bogus SOF marker length"); - - for (ci = 0; ci < num_components; ci++) { - (void)read_1_byte(); /* Component ID code */ - (void)read_1_byte(); /* H, V sampling factors */ - (void)read_1_byte(); /* Quantization table number */ - } -} - -/* - * Parse the marker stream until SOS or EOI is seen; - * display any COM markers. - * While the companion program wrjpgcom will always insert COM markers before - * SOFn, other implementations might not, so we scan to SOS before stopping. - * If we were only interested in the image dimensions, we would stop at SOFn. - * (Conversely, if we only cared about COM markers, there would be no need - * for special code to handle SOFn; we could treat it like other markers.) - */ - -static int scan_JPEG_header(int verbose, int raw) { - int marker; - /* Expect SOI at start of file */ - if (first_marker() != M_SOI) - ERREXIT("Expected SOI marker first"); - - /* Scan miscellaneous markers until we reach SOS. */ - for (;;) { - marker = next_marker(); - switch (marker) { - /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be, - * treated as SOFn. C4 in particular is actually DHT. - */ - case M_SOF0: /* Baseline */ - case M_SOF1: /* Extended sequential, Huffman */ - case M_SOF2: /* Progressive, Huffman */ - case M_SOF3: /* Lossless, Huffman */ - case M_SOF5: /* Differential sequential, Huffman */ - case M_SOF6: /* Differential progressive, Huffman */ - case M_SOF7: /* Differential lossless, Huffman */ - case M_SOF9: /* Extended sequential, arithmetic */ - case M_SOF10: /* Progressive, arithmetic */ - case M_SOF11: /* Lossless, arithmetic */ - case M_SOF13: /* Differential sequential, arithmetic */ - case M_SOF14: /* Differential progressive, arithmetic */ - case M_SOF15: /* Differential lossless, arithmetic */ - if (verbose) - process_SOFn(marker); - else - skip_variable(); - break; - - case M_SOS: /* stop before hitting compressed data */ - return marker; - - case M_EOI: /* in case it's a tables-only JPEG stream */ - return marker; - - case M_COM: - process_COM(raw); - break; - - case M_APP12: - /* Some digital camera makers put useful textual information into - * APP12 markers, so we print those out too when in -verbose mode. - */ - if (verbose) { - printf("APP12 contains:\n"); - process_COM(raw); - } else - skip_variable(); - break; - - default: /* Anything else just gets skipped */ - skip_variable(); /* we assume it has a parameter count... */ - break; - } - } /* end loop */ -} - -/* Command line parsing code */ - -static const char *progname; /* program name for error messages */ - -static void usage(void) -/* complain about bad command line */ -{ - fprintf(stderr, "rdjpgcom displays any textual comments in a JPEG file.\n"); - - fprintf(stderr, "Usage: %s [switches] [inputfile]\n", progname); - - fprintf(stderr, "Switches (names may be abbreviated):\n"); - fprintf( - stderr, - " -raw Display non-printable characters in comments (unsafe)\n"); - fprintf(stderr, " -verbose Also display dimensions of JPEG image\n"); - - exit(EXIT_FAILURE); -} - -static int keymatch(char *arg, const char *keyword, int minchars) -/* Case-insensitive matching of (possibly abbreviated) keyword switches. */ -/* keyword is the constant keyword (must be lower case already), */ -/* minchars is length of minimum legal abbreviation. */ -{ - register int ca, ck; - register int nmatched = 0; - - while ((ca = *arg++) != '\0') { - if ((ck = *keyword++) == '\0') - return 0; /* arg longer than keyword, no good */ - if (isupper(ca)) /* force arg to lcase (assume ck is already) */ - ca = tolower(ca); - if (ca != ck) - return 0; /* no good */ - nmatched++; /* count matched characters */ - } - /* reached end of argument; fail if it's too short for unique abbrev */ - if (nmatched < minchars) - return 0; - return 1; /* A-OK */ -} - -/* - * The main program. - */ - -int main(int argc, char **argv) { - int argn; - char *arg; - int verbose = 1, raw = 0; - -/* On Mac, fetch a command line. */ -#ifdef USE_CCOMMAND - argc = ccommand(&argv); -#endif - - progname = argv[0]; - if (progname == NULL || progname[0] == 0) - progname = "rdjpgcom"; /* in case C library doesn't provide it */ - - /* Parse switches, if any */ - for (argn = 1; argn < argc; argn++) - { - arg = argv[argn]; - if (arg[0] != '-') - break; /* not switch, must be file name */ - arg++; /* advance over '-' */ - if (keymatch(arg, "verbose", 1)) - { - verbose++; - } - else if (keymatch(arg, "raw", 1)) - { - raw = 1; - } - else - usage(); - } - - /* Open the input file. */ - /* Unix style: expect zero or one file name */ - if (argn < argc - 1) - { - fprintf(stderr, "%s: only one input file\n", progname); - usage(); - } - if (argn < argc) - { - if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) - { - fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]); - exit(EXIT_FAILURE); - } - } - else if ((infile = fopen("testimg.jpg", READ_BINARY)) == NULL) - { -/* default input file is stdin */ -#ifdef USE_SETMODE /* need to hack file mode? */ - setmode(fileno(stdin), O_BINARY); -#endif -#ifdef USE_FDOPEN /* need to re-open in binary mode? */ - if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) - { - fprintf(stderr, "%s: can't open stdin\n", progname); - exit(EXIT_FAILURE); - } -#else - infile = stdin; -#endif - } - - /* Scan the JPEG headers. */ - (void)scan_JPEG_header(verbose, raw); +#include "jpeglib.h" - /* All done. */ - exit(EXIT_SUCCESS); - return 0; /* suppress no-return-value warnings */ +int main() { + struct jpeg_decompress_struct info; + struct jpeg_error_mgr err; + info.err = jpeg_std_error(&err); + jpeg_create_decompress(&info); } diff --git a/recipes/libjpeg-turbo/all/test_package/testimg.jpg b/recipes/libjpeg-turbo/all/test_package/testimg.jpg deleted file mode 100644 index a026e486f57de..0000000000000 Binary files a/recipes/libjpeg-turbo/all/test_package/testimg.jpg and /dev/null differ diff --git a/recipes/libjpeg-turbo/all/test_package_module/conanfile.py b/recipes/libjpeg-turbo/all/test_package_module/conanfile.py index fd19bb1425057..0a6bc68712d90 100644 --- a/recipes/libjpeg-turbo/all/test_package_module/conanfile.py +++ b/recipes/libjpeg-turbo/all/test_package_module/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/libjpeg-turbo/all/test_v1_package/conanfile.py b/recipes/libjpeg-turbo/all/test_v1_package/conanfile.py index a2b04c499e0ac..38f4483872d47 100644 --- a/recipes/libjpeg-turbo/all/test_v1_package/conanfile.py +++ b/recipes/libjpeg-turbo/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/libjpeg-turbo/all/test_v1_package_module/conanfile.py b/recipes/libjpeg-turbo/all/test_v1_package_module/conanfile.py index b6600e428515c..19e6a0c06e3d8 100644 --- a/recipes/libjpeg-turbo/all/test_v1_package_module/conanfile.py +++ b/recipes/libjpeg-turbo/all/test_v1_package_module/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/libjpeg-turbo/config.yml b/recipes/libjpeg-turbo/config.yml index b86a136393472..8349c00d69a36 100644 --- a/recipes/libjpeg-turbo/config.yml +++ b/recipes/libjpeg-turbo/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.3": + folder: all "3.0.2": folder: all "3.0.1": diff --git a/recipes/libjpeg/all/Win32.Mak b/recipes/libjpeg/all/Win32.Mak deleted file mode 100644 index d3345df3a31cf..0000000000000 --- a/recipes/libjpeg/all/Win32.Mak +++ /dev/null @@ -1,671 +0,0 @@ -# Win32.Mak - Win32 application master NMAKE definitions file for the -# Microsoft Windows SDK programming samples -# Copyright (C) Microsoft Corporation -# ------------------------------------------------------------------------- -# This files should be included at the top of all MAKEFILEs as follows: -# !include -# ------------------------------------------------------------------------- -# -# Define APPVER = [ 4.0 | 5.0 | 5.01 | 5.02 | 6.0 | 6.1] prior to including win32.mak to get -# build time checking for version dependencies and to mark the executable -# with version information. -# -# Define TARGETOS = [ WIN95 | WINNT | BOTH ] prior to including win32.mak -# to get some build time checking for platform dependencies. -# -# Define TARGETLANG = [ LANG_JAPANESE | LANG_CHINESE | LANG_KOREAN ] prior -# to including win32.mak to getcompile & link flags for building -# applications to run on Far-East Windows. (This is an optional parameter. -# The system locale is the default.) -# -# Define _WIN32_IE = [ 0x0300 | 0x0400 | 0x0500 | 0x0600 | 0x0700 | 0x0800] prior to including win32.mak to -# get compile and link flags for building applications and components to -# run on Internet Explorer. (This is an optional parameter. IE 4.0 is -# the default.) -# -# ------------------------------------------------------------------------- -# NMAKE Options -# -# Use the table below to determine the additional options for NMAKE to -# generate various application debugging, profiling and performance tuning -# information. -# -# Application Information Type Invoke NMAKE -# ---------------------------- ------------ -# For No Debugging Info nmake nodebug=1 -# For Working Set Tuner Info nmake tune=1 -# For Call Attributed Profiling Info nmake profile=1 -# -# Note: The three options above are mutually exclusive (you may use only -# one to compile/link the application). -# -# Note: creating the environment variables NODEBUG, TUNE, and PROFILE is an -# alternate method to setting these options via the nmake command line. -# -# Note: TUNE and PROFILE do nothing for 64bit compilation -# -# Additional NMAKE Options Invoke NMAKE -# ---------------------------- ------------ -# For No ANSI NULL Compliance nmake no_ansi=1 -# (ANSI NULL is defined as PVOID 0) -# -# ========================================================================= -# Build Rules Quick Start -# -# To build one of the following types of executables, use the specified -# compiler and linker command-line options. -# -# --------------------------------------------------------------------------- -# To build: | Compiler Options | Linker options (pick one -# | | line. con = console, -# | | gui = GUI, ole = GUI OLE) -# --------------------------------------------------------------------------- -# Single threaded | cdebug cflags cvars | ldebug guilflags guilibs -# app with static | | ldebug conlflags conlibs -# CRT | | ldebug guilflags olelibs -# --------------------------------------------------------------------------- -# Multithreaded app | cdebug cflags cvarsmt | ldebug guilflags guilibsmt -# with static CRT | | ldebug conlflags conlibsmt -# | | ldebug guilflags olelibsmt -# --------------------------------------------------------------------------- -# Single or multi- | cdebug cflags cvarsdll | ldebug guilflags guilibsdll -# threaded app with | | ldebug conlflags conlibsdll -# DLL version of CRT | | ldebug guilflags olelibsdll -# (MSVCRT.DLL) | | -# --------------------------------------------------------------------------- -# DLL with static | cdebug cflags cvarsmt | ldebug dlllflags guilibsmt -# CRT* | | ldebug dlllflags conlibsmt -# | | ldebug dlllflags olelibsmt -# --------------------------------------------------------------------------- -# DLL with DLL | cdebug cflags cvarsdll | ldebug dlllflags guilibsdll -# version of CRT | | ldebug dlllflags conlibsdll -# (MSVCRT.DLL) | | ldebug dlllflags olelibsdll -# --------------------------------------------------------------------------- -# -# * Always make DLLs multithreaded because a DLL has no way to know whether -# the calling application has multiple threads, and has no way to prevent -# multithreaded apps from loading it. -# -# To specify an Intel x86 build that defaults to stdcall, add scall to the -# list of compiler options. -# -# ========================================================================= - -!IFNDEF _WIN32_MAK_ -_WIN32_MAK_ = 1 - -# ------------------------------------------------------------------------- -# Get CPU Type - exit if CPU environment variable is not defined -# ------------------------------------------------------------------------- - -# Win95 does not define PROCESSOR_ARCHITECTURE - default to i386 - -!IF "$(PROCESSOR_ARCHITECTURE)" == "" -CPU=i386 -PROCESSOR_ARCHITECTURE=x86 -!endif - -!IF !DEFINED(CPU) || "$(CPU)" == "" -CPU = $(PROCESSOR_ARCHITECTURE) -!ENDIF # CPU - -# if PROCESSOR_ARCHITECTURE was x86 or X86 change CPU to i386 - -!IF ( "$(CPU)" == "X86" ) || ( "$(CPU)" == "x86" ) -CPU = i386 -!ENDIF # CPU == X86 - -!IF "$(CPU)" != "i386" -!IF "$(CPU)" != "IA64" -!IF "$(CPU)" != "AMD64" -!ERROR Must specify CPU environment variable ( CPU=i386, CPU=IA64, CPU=AMD64) -!ENDIF -!ENDIF -!ENDIF - - -# ------------------------------------------------------------------------- -# Get Target Operating System - Default to WINNT -# ------------------------------------------------------------------------- -!IFNDEF TARGETOS -TARGETOS = WINNT -!ENDIF - -!IF "$(TARGETOS)" != "WINNT" -!IF "$(TARGETOS)" != "WIN95" -!IF "$(TARGETOS)" != "BOTH" -!ERROR Must specify TARGETOS environment variable (BOTH, WIN95, WINNT) -!ENDIF -!ENDIF -!ENDIF - -# default to APPVER of 5.0 - -!IFNDEF APPVER -APPVER = 5.0 -!ENDIF - -!IF "$(APPVER)" != "6.1" -!IF "$(APPVER)" != "6.0" -!IF "$(APPVER)" != "5.02" -!IF "$(APPVER)" != "5.01" -!IF "$(APPVER)" != "5.0" -!IF "$(APPVER)" != "4.0" -!ERROR Must specify APPVER environment variable (4.0, 5.0, 5.01, 5.02, 6.0, 6.1) -!ENDIF -!ENDIF -!ENDIF -!ENDIF -!ENDIF -!ENDIF - -!IF "$(APPVER)" =="6.1" -!IFNDEF _WIN32_IE -_WIN32_IE = 0x0800 -!ENDIF # _WIN32_IE -!ENDIF # APPVER == 6.1 - -!IF "$(APPVER)" =="6.0" -!IFNDEF _WIN32_IE -_WIN32_IE = 0x0700 -!ENDIF # _WIN32_IE -!ENDIF # APPVER == 6.0 - -!IF "$(APPVER)" =="5.0" -!IFNDEF _WIN32_IE -_WIN32_IE = 0x0500 -!ENDIF # _WIN32_IE -!ENDIF # APPVER == 5.0 - -!IF "$(APPVER)" =="5.01" -!IFNDEF _WIN32_IE -_WIN32_IE = 0x0600 -!ENDIF # _WIN32_IE -!ENDIF # APPVER == 5.01 - -!IF "$(APPVER)" =="5.02" -!IFNDEF _WIN32_IE -_WIN32_IE = 0x0600 -!ENDIF # _WIN32_IE -!ENDIF # APPVER == 5.02 - -!IFNDEF _WIN32_IE -_WIN32_IE = 0x0400 -!ENDIF - -# ------------------------------------------------------------------------- -# Build tool declarations common to all platforms -# Check to see if Cole Porter is used, otherwise use C/C++ compiler -# ------------------------------------------------------------------------- - -cc = cl -link = link -implib = lib - -midl = midl -rc = Rc -hc = Start /Wait Hcrtf -mc = Mc - -hcvars = -xn - -# ------------------------------------------------------------------------- -# Platform Dependent Compile Flags - must be specified after $(cc) -# -# Note: Debug switches are on by default for current release -# -# These switches set code generation and debugging options for the compiler. -# They also set macros used for conditional compilation. -# -# The debugging switches allow for source level debugging with WinDebug or -# Microsoft Visual C++. -# -# Common compiler flags: -# -c - compile without linking -# -W3 - Set warning level to level 3 (-W4 for 64-bit compilations) -# -Zi - generate debugging information -# -Od - disable all optimizations -# -Ox - use maximum optimizations -# -Zd - generate only public symbols and line numbers for debugging -# -GS - enable security checks -# -# i386 specific compiler flags: -# -Gz - stdcall (only if scall is added to makefile's compiler build rules) -# -# ------------------------------------------------------------------------- - -# declarations common to all compiler options -ccommon = -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS - -# for compatibility with old source code, map {try, except, leave, finally} -# to their proper names (i.e. prefaced by "__") -!IFDEF SEHMAP -ccommon = $(ccommon) -FIsehmap.h -!ENDIF - -!IF "$(TARGETLANG)" == "LANG_JAPANESE" -ccommon = $(ccommon) -DJAPAN -DDBCS -DFE_IME -!ENDIF - -!IF "$(TARGETLANG)" == "LANG_CHINESE" -ccommon = $(ccommon) -DDBCS -DFE_IME -!ENDIF - -!IF "$(TARGETLANG)" == "LANG_KOREAN" -ccommon = $(ccommon) -DDBCS -DFE_IME -!ENDIF - -!IF "$(CPU)" == "i386" -cflags = $(ccommon) -D_X86_=1 -DWIN32 -D_WIN32 -W3 -scall = -Gz - -!ELSEIF "$(CPU)" == "IA64" -cflags = $(ccommon) -D_IA64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -cflags = $(cflags) -W4 -scall = - -!ELSEIF "$(CPU)" == "AMD64" -cflags = $(ccommon) -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -cflags = $(cflags) -W4 -scall = - -!ENDIF - - -!IF "$(APPVER)" == "4.0" -NMAKE_WINVER = 0x0400 -!ELSEIF "$(APPVER)" == "5.0" -NMAKE_WINVER = 0x0500 -!ELSEIF "$(APPVER)" == "5.01" -NMAKE_WINVER = 0x0501 -!ELSEIF "$(APPVER)" == "5.02" -NMAKE_WINVER = 0x0502 -!ELSEIF "$(APPVER)" == "6.0" -NMAKE_WINVER = 0x0600 -!ELSEIF "$(APPVER)" == "6.1" -NMAKE_WINVER = 0x0601 -!ENDIF - -!IF "$(TARGETOS)" == "WINNT" -cflags = $(cflags) -D_WINNT -D_WIN32_WINNT=$(NMAKE_WINVER) -DNTDDI_VERSION=$(NMAKE_WINVER)0000 -!ENDIF - -!IF "$(TARGETOS)" == "WIN95" -cflags = $(cflags) -D_WIN95 -D_WIN32_WINDOWS=$(NMAKE_WINVER) /D_WIN32_DCOM -!ENDIF - -# regardless of the TARGET OS, define compile time WINVER to match APPVER macro -cflags = $(cflags) -D_WIN32_IE=$(_WIN32_IE) -DWINVER=$(NMAKE_WINVER) - - -# Set debugging options - -!IF "$(CPU)" != "IA64" -!IFDEF NODEBUG -cdebug = -Ox -DNDEBUG -!ELSE IFDEF PROFILE -cdebug = -Gh -Ox -DNDEBUG -!ELSE IFDEF TUNE -cdebug = -Gh -Ox -DNDEBUG -!ELSE -cdebug = -Zi -Od -DDEBUG -Fdlibjpeg.pdb -!ENDIF - -!ELSE - -!IFDEF NODEBUG -cdebug = -Ox -DNDEBUG -!ELSE -cdebug = -Zi -Od -DDEBUG -Fdlibjpeg.pdb -!ENDIF - -!ENDIF - -# ------------------------------------------------------------------------- -# Target Module & Subsystem Dependent Compile Defined Variables - must be -# specified after $(cc) -# -# The following table indicates the various acceptable combinations of -# the C Run-Time libraries LIBC, LIBCMT, and MSVCRT respect to the creation -# of a EXE and/or DLL target object. The appropriate compiler flag macros -# that should be used for each combination are also listed. -# -# Executable Type C Runtime Lib Compiler switch -# ------------------------------------------------------------- -# Single threaded app static CRT CVARS * -# Single-threaded app DLL CRT CVARSDLL -# Multi-threaded app static CRT CVARSMT * -# Multi-threaded app DLL CRT CVARSDLL * -# -# Single threaded DLL static CRT CVARS -# Single-threaded DLL DLL CRT CVARSDLL -# Multi-threaded DLL static CRT CVARSMT * -# Multi-threaded DLL DLL CRT CVARSDLL * -# -# * - Denotes the Recommended Configuration -# -# When building single-threaded applications you can link your executable -# with either LIBC, LIBCMT, or MSVCRT, although LIBC will provide the best -# performance. -# -# When building multi-threaded applications, either LIBCMT or MSVCRT can -# be used as the C-Runtime library, as both are multi-thread safe. -# -# Note: Any executable which accesses a DLL linked with MSVCRT.LIB must -# also link with MSVCRT.LIB instead of LIBC.LIB or LIBCMT.LIB. -# When using DLLs, it is recommended that all of the modules be -# linked with MSVCRT.LIB. -# -# Note: The macros of the form xDLL are used when linking the object with -# the DLL version of the C Run-Time (that is, MSVCRT.LIB). They are -# not used when the target object is itself a DLL. -# -# ------------------------------------------------------------------------- - -!IFDEF NO_ANSI -noansi = -DNULL=0 -!ENDIF - - -# for Windows applications that use the C Run-Time libraries -!IFDEF NODEBUG -cvarsmt = $(noansi) -D_MT -MT -cvars = $(cvarsmt) -cvarsdll = $(noansi) -D_MT -D_DLL -MD -!ELSE -cvarsmt = $(noansi) -D_MT -MTd -cvars = $(cvarsmt) -cvarsdll = $(noansi) -D_MT -D_DLL -MDd -!ENDIF - - -# for compatibility with older-style makefiles -cvarsmtdll = $(cvarsdll) - -# for POSIX applications -psxvars = -D_POSIX_ - -# resource compiler -rcflags = /r -!ifdef NODEBUG -rcvars = -DWIN32 -D_WIN32 -DWINVER=$(NMAKE_WINVER) $(noansi) -!else -rcvars = -DWIN32 -D_WIN32 -DWINVER=$(NMAKE_WINVER) -DDEBUG -D_DEBUG $(noansi) -!endif - - -!IF "$(TARGETLANG)" == "LANG_JAPANESE" -rcflags = $(rcflags) /c932 -rcvars = $(rcvars) -DJAPAN -DDBCS -DFE_IME -!ENDIF - -!IF "$(TARGETLANG)" == "LANG_CHINESE" -rcvars = $(rcvars) -DDBCS -DFE_IME -!ENDIF - -!IF "$(TARGETLANG)" == "LANG_KOREAN" -rcvars = $(rcvars) -DDBCS -DFE_IME -!ENDIF - - -# ------------------------------------------------------------------------- -# Platform Dependent MIDL Flags - must be specified after midl -# -# -# ------------------------------------------------------------------------- -!IF "$(TARGETOS)" == "WIN95" -MIDL_OPTIMIZATION=-target NT40 -!ELSEIF "$(TARGETOS)" == "WINNT" -!IF "$(APPVER)" == "5.0" -MIDL_OPTIMIZATION=-target NT50 -!ELSEIF "$(APPVER)" == "6.0" -MIDL_OPTIMIZATION=-target NT60 -!ELSEIF "$(APPVER)" == "6.1" -MIDL_OPTIMIZATION=-target NT61 -!ELSEIF "$(APPVER)" == "5.01" -MIDL_OPTIMIZATION=-target NT51 -!ELSEIF "$(APPVER)" == "5.02" -MIDL_OPTIMIZATION=-target NT51 -!ELSEIF "$(APPVER)" == "4.0" -MIDL_OPTIMIZATION=-target NT40 -!ENDIF -!ENDIF - -!IF "$(CPU)" == "IA64" -MIDL_OPTIMIZATION = $(MIDL_OPTIMIZATION) /ia64 -!ELSEIF "$(CPU)" == "AMD64" -MIDL_OPTIMIZATION = $(MIDL_OPTIMIZATION) /x64 -!ELSE -MIDL_OPTIMIZATION = $(MIDL_OPTIMIZATION) /win32 -!ENDIF - -!IF ("$(TARGETOS)" == "WINNT" ) && ("$(APPVER)" != "4.0") -MIDL_OPTIMIZATION = $(MIDL_OPTIMIZATION) /robust -!ENDIF - - - -# ------------------------------------------------------------------------- -# Platform Dependent Link Flags - must be specified after $(link) -# -# Note: $(DLLENTRY) should be appended to each -entry: flag on the link -# line. -# -# Note: When creating a DLL that uses C Run-Time functions it is -# recommended to include the entry point function of the name DllMain -# in the DLL's source code. Also, the MAKEFILE should include the -# -entry:_DllMainCRTStartup$(DLLENTRY) option for the creation of -# this DLL. (The C Run-Time entry point _DllMainCRTStartup in turn -# calls the DLL defined DllMain entry point.) -# -# ------------------------------------------------------------------------- - -# declarations common to all linker options -lflags = $(lflags) /INCREMENTAL:NO /NOLOGO - -# declarations for use on Intel x86 systems -!IF "$(CPU)" == "i386" -DLLENTRY = @12 -!ENDIF - -# declarations for use on Intel Architecture 64-bit systems -!IF "$(CPU)" == "IA64" -DLLENTRY = -!ENDIF - -# declarations for use on AMD64 systems -!IF "$(CPU)" == "AMD64" -DLLENTRY = -!ENDIF - - -# ------------------------------------------------------------------------- -# Target Module Dependent Link Debug Flags - must be specified after $(link) -# -# These switches allow the inclusion of the necessary symbolic information -# for source level debugging with WinDebug, profiling and/or performance -# tuning. -# -# Note: Debug switches are on by default. -# ------------------------------------------------------------------------- - -!IF "$(CPU)" == "i386" - -!IFDEF NODEBUG -ldebug = /RELEASE -!ELSE -ldebug = /DEBUG /DEBUGTYPE:cv -!ENDIF - -!ELSE - -!IFDEF NODEBUG -ldebug = /RELEASE -!ELSE IFDEF PROFILE -ldebug = /DEBUG:mapped,partial /DEBUGTYPE:coff -!ELSE IFDEF TUNE -ldebug = /DEBUG:mapped,partial /DEBUGTYPE:coff -!ELSE -ldebug = /DEBUG /DEBUGTYPE:cv -!ENDIF - -!ENDIF - -# for compatibility with older-style makefiles -linkdebug = $(ldebug) - - -# ------------------------------------------------------------------------- -# Subsystem Dependent Link Flags - must be specified after $(link) -# -# These switches allow for source level debugging with WinDebug for local -# and global variables. They also provide the standard application type and -# entry point declarations. -# -# Note that on x86 screensavers have a WinMain entrypoint, but on RISC -# platforms it is main. This is a Win95 compatibility issue. -# -# ------------------------------------------------------------------------- - -# Windows 98 needs subsystem version set to 4.10 for version 5.0 features. -!IF ("$(APPVER)" == "5.0") && (("$(TARGETOS)" == "BOTH") || ("$(TARGETOS)" == "WIN95")) -EXEVER = 4.10 -!ELSE -EXEVER = $(APPVER) -!ENDIF - - -# --------------------------------------------- - -# for Windows applications -conlflags = $(lflags) -subsystem:console,$(EXEVER) -guilflags = $(lflags) -subsystem:windows,$(EXEVER) -dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll - -# For screen savers -!IF "$(CPU)" == "i386" -savlflags = $(lflags) -subsystem:windows,$(EXEVER) -entry:WinMainCRTStartup -!ELSE -savlflags = $(lflags) -subsystem:windows,$(EXEVER) -entry:mainCRTStartup -!ENDIF - -# for POSIX applications -psxlflags = $(lflags) -subsystem:posix -entry:__PosixProcessStartup - -# for compatibility with older-style makefiles -conflags = $(conlflags) -guiflags = $(guilflags) -psxflags = $(psxlflags) - -# ------------------------------------------------------------------------- -# C Run-Time Target Module Dependent Link Libraries -# -# Note: For POSIX applications, link with $(psxlibs). -# ------------------------------------------------------------------------- - -# for POSIX applications -psxlibs = libcpsx.lib psxdll.lib psxrtl.lib oldnames.lib - - -# optional profiling and tuning libraries -!IF "$(CPU)" != "IA64" - -!IFDEF PROFILE -optlibs = cap.lib -!ELSE IFDEF TUNE -optlibs = wst.lib -!ELSE -optlibs = -!ENDIF - -!ELSE -optlibs = -!ENDIF - -# if building for basic Windows 95, use WinSock1, else use WinSock2 -!IF "$(TARGETOS)" == "WIN95" -!IF "$(APPVER)" == "4.0" -winsocklibs = wsock32.lib -!ELSE -winsocklibs = ws2_32.lib mswsock.lib -!ENDIF -!ELSE -winsocklibs = ws2_32.lib mswsock.lib -!ENDIF - - -# basic subsystem specific libraries, less the C Run-Time -baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib -winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib - -# for Windows applications that use the C Run-Time libraries -conlibs = $(baselibs) -guilibs = $(winlibs) - -# for OLE applications -olelibs = ole32.lib uuid.lib oleaut32.lib $(guilibs) - -#for backwards compatibility -conlibsmt = $(conlibs) -conlibsdll = $(conlibs) -guilibsmt = $(guilibs) -guilibsdll = $(guilibs) -olelibsmt = $(olelibs) -olelibsdll = $(olelibs) - -# for backward compatibility -ole2libs = $(olelibs) -ole2libsmt = $(olelibsmt) -ole2libsdll = $(olelibsdll) - -# Visual Basic -bc = vb6 -bc_exe = /Make -bc_dll = /Makedll - -# Set the Output Directory -!IF ("$(APPVER)" == "6.1") -OUTDIR=WIN7 -!ELSEIF ("$(APPVER)" == "6.0") -OUTDIR=Vista -!ELSEIF "$(APPVER)" == "5.0" -OUTDIR=WIN2000 -!ELSEIF "$(APPVER)" == "5.01" -OUTDIR=XP32 -!ELSEIF "$(APPVER)" == "5.02" -OUTDIR=SRV2003 -!ELSEIF "$(APPVER)" == "4.0" -OUTDIR=NT4 -!ENDIF - -!IF "$(CPU)" == "AMD64" -OUTDIR=$(OUTDIR)_X64 -!ELSEIF "$(CPU)" == "IA64" -OUTDIR=$(OUTDIR)_64 -!ENDIF - -#set Prerelease Out directories -!IF "$(SDKPRERELEASE)" == "1" -OUTDIR=PRE_$(OUTDIR) -!ENDIF - -#Set DEBUG -!IF "$(NODEBUG)" == "" -OUTDIR=$(OUTDIR)_DEBUG -!ELSE -OUTDIR=$(OUTDIR)_RETAIL -!ENDIF - -!IF "$(OS)" == "Windows_NT" -CLEANUP=if exist $(OUTDIR)/$(NULL) rd /s /q $(OUTDIR) -!ELSE -CLEANUP=deltree /y $(OUTDIR) -!ENDIF - -VC6MSG=This sample only compiles with Microsoft Visual C++ 6.0. \ - To compile this run vcvars32.bat for Visual C++ 6.0, and setenv.bat in $(MSSDK). - -WIN64MSG=This sample is currently not supported on the 64 bit platform. - -#ENDIF _WIN32_MAK_ -!ENDIF diff --git a/recipes/libjpeg/all/conandata.yml b/recipes/libjpeg/all/conandata.yml index b147d8fb1dd7d..c16f5b9d9e4d8 100644 --- a/recipes/libjpeg/all/conandata.yml +++ b/recipes/libjpeg/all/conandata.yml @@ -1,14 +1,18 @@ sources: + "9f": + url: "https://ijg.org/files/jpegsrc.v9f.tar.gz" + sha256: "04705c110cb2469caa79fb71fba3d7bf834914706e9641a4589485c1f832565b" "9e": - url: "http://ijg.org/files/jpegsrc.v9e.tar.gz" + url: "https://ijg.org/files/jpegsrc.v9e.tar.gz" sha256: "4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d" "9d": - url: "http://ijg.org/files/jpegsrc.v9d.tar.gz" + url: "https://ijg.org/files/jpegsrc.v9d.tar.gz" sha256: "2303a6acfb6cc533e0e86e8a9d29f7e6079e118b9de3f96e07a71a11c082fa6a" - "9c": - url: "http://ijg.org/files/jpegsrc.v9c.tar.gz" - sha256: "682aee469c3ca857c4c38c37a6edadbfca4b04d42e56613b11590ec6aa4a278d" patches: + "9f": + - patch_file: "patches/0001-9f-libjpeg-add-msvc-dll-support.patch" + patch_description: "Add support to generate DLL on Windows" + patch_type: "portability" "9e": - patch_file: "patches/0001-9e-libjpeg-add-msvc-dll-support.patch" patch_description: "Add support to generate DLL on Windows" @@ -17,7 +21,3 @@ patches: - patch_file: "patches/0001-libjpeg-add-msvc-dll-support.patch" patch_description: "Add support to generate DLL on Windows" patch_type: "portability" - "9c": - - patch_file: "patches/0001-libjpeg-add-msvc-dll-support.patch" - patch_description: "Add support to generate DLL on Windows" - patch_type: "portability" diff --git a/recipes/libjpeg/all/conanfile.py b/recipes/libjpeg/all/conanfile.py index dd93ec3f8004c..a4eb4a8f376c9 100644 --- a/recipes/libjpeg/all/conanfile.py +++ b/recipes/libjpeg/all/conanfile.py @@ -1,13 +1,13 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name -from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, load, replace_in_file, rm, rmdir, save from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, NMakeToolchain +from conan.tools.microsoft import is_msvc, MSBuild, MSBuildToolchain import os import re -import shutil required_conan_version = ">=1.55.0" @@ -40,7 +40,6 @@ def _settings_build(self): return getattr(self, "settings_build", self.settings) def export_sources(self): - copy(self, "Win32.Mak", src=self.recipe_folder, dst=self.export_sources_folder) export_conandata_patches(self) def config_options(self): @@ -53,6 +52,10 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + def validate(self): + if self.version == "9d" and self.settings.os == "Windows" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration("This version of libjpeg does not support ARM64, please use a newer version") + def layout(self): basic_layout(self, src_folder="src") @@ -66,14 +69,11 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): - if is_msvc(self) or self._is_clang_cl: - # clean environment variables that might affect on the build (e.g. if set by Jenkins) - env = Environment() - env.define("PROFILE", None) - env.define("TUNE", None) - env.define("NODEBUG", None) - env.vars(self).save_script("conanbuildenv_nmake_unset_env") - tc = NMakeToolchain(self) + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.cflags.append("-DLIBJPEG_BUILDING") + if not self.options.shared: + tc.cflags.append(" -DLIBJPEG_STATIC") tc.generate() else: env = VirtualBuildEnv(self) @@ -82,46 +82,65 @@ def generate(self): tc.extra_defines.append("LIBJPEG_BUILDING") tc.generate() - def _build_nmake(self): - copy(self, "Win32.Mak", src=os.path.join(self.source_folder, os.pardir), dst=self.source_folder) - with chdir(self, self.source_folder): - # export symbols if shared - replace_in_file( - self, - "Win32.Mak", - "\nccommon = -c ", - "\nccommon = -c -DLIBJPEG_BUILDING {}".format("" if self.options.shared else "-DLIBJPEG_STATIC "), - ) - shutil.copy("jconfig.vc", "jconfig.h") - make_args = [ - "nodebug=1" if self.settings.build_type != "Debug" else "", - ] - if self._is_clang_cl: - compilers_from_conf = self.conf.get("tools.build:compiler_executables", default={}, check_type=dict) - buildenv_vars = VirtualBuildEnv(self).vars() - cl = compilers_from_conf.get("c", buildenv_vars.get("CC", "clang-cl")) - link = buildenv_vars.get("LD", "lld-link") - lib = buildenv_vars.get("AR", "llvm-lib") - rc = compilers_from_conf.get("rc", buildenv_vars.get("RC", "llvm-rc")) - replace_in_file(self, "Win32.Mak", "cc = cl", f"cc = {cl}") - replace_in_file(self, "Win32.Mak", "link = link", f"link = {link}") - replace_in_file(self, "Win32.Mak", "implib = lib", f"implib = {lib}") - replace_in_file(self, "Win32.Mak", "rc = Rc", f"rc = {rc}") - # set flags directly in makefile.vc - # cflags are critical for the library. ldflags and ldlibs are only for binaries - if is_msvc_static_runtime(self): - replace_in_file(self, "makefile.vc", "(cvars)", "(cvarsmt)") - replace_in_file(self, "makefile.vc", "(conlibs)", "(conlibsmt)") - else: - replace_in_file(self, "makefile.vc", "(cvars)", "(cvarsdll)") - replace_in_file(self, "makefile.vc", "(conlibs)", "(conlibsdll)") - target = "{}/libjpeg.lib".format("shared" if self.options.shared else "static") - self.run("nmake -f makefile.vc {} {}".format(" ".join(make_args), target)) - def build(self): apply_conandata_patches(self) - if is_msvc(self) or self._is_clang_cl: - self._build_nmake() + if is_msvc(self): + with chdir(self, self.source_folder): + self.run("nmake /f makefile.vs setupcopy-v16") + + # Rename target to 'libjpeg.lib' to match legacy behaviour (otherwise we break backwards compatibility) + # static: "libjpeg.lib" + # shared: "libjpeg.lib" (import), "libjpeg-9.dll" (DLL) + jpeg_vcxproj = os.path.join(self.source_folder, "jpeg.vcxproj") + target_name = "libjpeg-9" if self.options.shared else "libjpeg" + replace_in_file(self, jpeg_vcxproj, """""", + f""" {target_name} + """) + if self.options.shared: + replace_in_file(self, jpeg_vcxproj, "", + "$(OutDir)libjpeg.lib") + + # Support static/shared + if self.options.shared: + replace_in_file(self, jpeg_vcxproj, + "StaticLibrary", + "DynamicLibrary" + ) + + # Don't force LTO + replace_in_file(self, jpeg_vcxproj, "true", "") + + # Inject conan-generated .props file + # Note: importing it right before Microsoft.Cpp.props also ensures we correctly + # handle the toolset setting + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + replace_in_file( + self, jpeg_vcxproj, + """""", + f"""""", + ) + + # Patch settings for a different build type + if self.settings.build_type is not "Release": + replacements = { + "Release": str(self.settings.build_type) + } + if self.settings.build_type == "Debug": + replacements.update({ + "Full": "Disabled", + "NDEBUG;": "_DEBUG;", + }) + for key, value in replacements.items(): + replace_in_file(self, jpeg_vcxproj, key, value) + + replace_in_file(self, os.path.join(self.source_folder, "jpeg.sln"), "Release", str(self.settings.build_type)) + + msbuild = MSBuild(self) + if self.settings.arch == "x86": + # This .sln uses "Win32" instead of the usual "x86" + # as the solution platform, so need to override this + msbuild.platform = "Win32" + msbuild.build(sln="jpeg.sln") else: autotools = Autotools(self) autotools.configure() diff --git a/recipes/libjpeg/all/patches/0001-9f-libjpeg-add-msvc-dll-support.patch b/recipes/libjpeg/all/patches/0001-9f-libjpeg-add-msvc-dll-support.patch new file mode 100644 index 0000000000000..ac2d14df61117 --- /dev/null +++ b/recipes/libjpeg/all/patches/0001-9f-libjpeg-add-msvc-dll-support.patch @@ -0,0 +1,31 @@ +--- jmorecfg.h ++++ jmorecfg.h +@@ -238,14 +238,26 @@ + * or code profilers that require it. + */ + ++#if defined(_MSC_VER) ++#if defined(LIBJPEG_STATIC) ++#define LIBJPEG_EXPORTS ++#elif !defined(LIBJPEG_BUILDING) ++#define LIBJPEG_EXPORTS __declspec(dllimport) ++#else ++#define LIBJPEG_EXPORTS __declspec(dllexport) ++#endif ++#else ++#define LIBJPEG_EXPORTS ++#endif ++ + /* a function called through method pointers: */ + #define METHODDEF(type) static type + /* a function used only in its module: */ + #define LOCAL(type) static type + /* a function referenced thru EXTERNs: */ +-#define GLOBAL(type) type ++#define GLOBAL(type) LIBJPEG_EXPORTS type + /* a reference to a GLOBAL function: */ +-#define EXTERN(type) extern type ++#define EXTERN(type) extern GLOBAL(type) + + + /* This macro is used to declare a "method", that is, a function pointer. diff --git a/recipes/libjpeg/all/test_package/CMakeLists.txt b/recipes/libjpeg/all/test_package/CMakeLists.txt index 7885c9011ac59..2506f77d5cc66 100644 --- a/recipes/libjpeg/all/test_package/CMakeLists.txt +++ b/recipes/libjpeg/all/test_package/CMakeLists.txt @@ -10,11 +10,3 @@ if (MSVC) target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS) endif() -if(BUILD_TRANSUPP) - add_executable(test_transupp test_transupp.c ${LIBJPEG_RES_DIR}/transupp.c) - target_link_libraries(test_transupp PRIVATE JPEG::JPEG) - target_compile_features(test_transupp PRIVATE c_std_99) - if (MSVC) - target_compile_definitions(test_transupp PRIVATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS) - endif() -endif() diff --git a/recipes/libjpeg/all/test_package/conanfile.py b/recipes/libjpeg/all/test_package/conanfile.py index 0243933ba22dd..5eb32d655b0b8 100644 --- a/recipes/libjpeg/all/test_package/conanfile.py +++ b/recipes/libjpeg/all/test_package/conanfile.py @@ -7,27 +7,15 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv", "CMakeToolchain" test_type = "explicit" - @property - def _build_transupp(self): - # transupp+libjpeg makes use of stdio of the C library. This cannot be used when using a dll libjpeg, built with a static c library. - return not (self.dependencies["libjpeg"].options.shared and is_msvc(self) and is_msvc_static_runtime(self)) - def layout(self): cmake_layout(self) def requirements(self): self.requires(self.tested_reference_str) - def generate(self): - tc = CMakeToolchain(self) - tc.variables["BUILD_TRANSUPP"] = self._build_transupp - if self._build_transupp: - tc.variables["LIBJPEG_RES_DIR"] = self.dependencies["libjpeg"].cpp_info.resdirs[0].replace("\\", "/") - tc.generate() - def build(self): cmake = CMake(self) cmake.configure() @@ -36,9 +24,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_name = os.path.join(self.source_folder, "testimg.jpg") - self.run(f"{bin_path} {img_name}", env="conanrun") - test_transupp_path = os.path.join(self.cpp.build.bindirs[0], "test_transupp") - if os.path.exists(test_transupp_path): - out_img = os.path.join(self.build_folder, "outimg.jpg") - self.run(f"{test_transupp_path} {img_name} {out_img}", env="conanrun") + self.run(f"{bin_path}", env="conanrun") diff --git a/recipes/libjpeg/all/test_package/test_package.c b/recipes/libjpeg/all/test_package/test_package.c index 2f94478d7ef6f..d23690dd29b19 100644 --- a/recipes/libjpeg/all/test_package/test_package.c +++ b/recipes/libjpeg/all/test_package/test_package.c @@ -1,528 +1,11 @@ -/* - * rdjpgcom.c - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * Modified 2009 by Bill Allombert, Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a very simple stand-alone application that displays - * the text in COM (comment) markers in a JFIF file. - * This may be useful as an example of the minimum logic needed to parse - * JPEG markers. - */ - #include -#include -#include - -#define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */ -#include "jpeglib.h" /* get auto-config symbols, */ - -#ifdef HAVE_LOCALE_H -#include /* Bill Allombert: use locale for isprint */ -#endif -#include /* to declare isupper(), tolower() */ -#ifdef USE_SETMODE -#include /* to declare setmode()'s parameter macros */ -/* If you have setmode() but not , just delete this line: */ -#include /* to declare setmode() */ -#endif - -#ifdef USE_CCOMMAND /* command-line reader for Macintosh */ -#ifdef __MWERKS__ -#include /* Metrowerks needs this */ -#include /* ... and this */ -#endif -#ifdef THINK_C -#include /* Think declares it here */ -#endif -#endif - -#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ -#define READ_BINARY "r" -#else -#ifdef VMS /* VMS is very nonstandard */ -#define READ_BINARY "rb", "ctx=stm" -#else /* standard ANSI-compliant case */ -#define READ_BINARY "rb" -#endif -#endif - -#ifndef EXIT_FAILURE /* define exit() codes if not provided */ -#define EXIT_FAILURE 1 -#endif -#ifndef EXIT_SUCCESS -#ifdef VMS -#define EXIT_SUCCESS 1 /* VMS is very nonstandard */ -#else -#define EXIT_SUCCESS 0 -#endif -#endif - -/* - * These macros are used to read the input file. - * To reuse this code in another application, you might need to change these. - */ - -static FILE *infile; /* input JPEG file */ - -/* Return next input byte, or EOF if no more */ -#define NEXTBYTE() getc(infile) - -/* Error exit handler */ -#define ERREXIT(msg) (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE)) - -/* Read one byte, testing for EOF */ -static int read_1_byte(void) { - int c; - - c = NEXTBYTE(); - if (c == EOF) - ERREXIT("Premature EOF in JPEG file"); - return c; -} - -/* Read 2 bytes, convert to unsigned int */ -/* All 2-byte quantities in JPEG markers are MSB first */ -static unsigned int read_2_bytes(void) { - int c1, c2; - - c1 = NEXTBYTE(); - if (c1 == EOF) - ERREXIT("Premature EOF in JPEG file"); - c2 = NEXTBYTE(); - if (c2 == EOF) - ERREXIT("Premature EOF in JPEG file"); - return (((unsigned int)c1) << 8) + ((unsigned int)c2); -} - -/* - * JPEG markers consist of one or more 0xFF bytes, followed by a marker - * code byte (which is not an FF). Here are the marker codes of interest - * in this program. (See jdmarker.c for a more complete list.) - */ - -#define M_SOF0 0xC0 /* Start Of Frame N */ -#define M_SOF1 0xC1 /* N indicates which compression process */ -#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ -#define M_SOF3 0xC3 -#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ -#define M_SOF6 0xC6 -#define M_SOF7 0xC7 -#define M_SOF9 0xC9 -#define M_SOF10 0xCA -#define M_SOF11 0xCB -#define M_SOF13 0xCD -#define M_SOF14 0xCE -#define M_SOF15 0xCF -#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */ -#define M_EOI 0xD9 /* End Of Image (end of datastream) */ -#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ -#define M_APP0 0xE0 /* Application-specific marker, type N */ -#define M_APP12 0xEC /* (we don't bother to list all 16 APPn's) */ -#define M_COM 0xFE /* COMment */ - -/* - * Find the next JPEG marker and return its marker code. - * We expect at least one FF byte, possibly more if the compressor used FFs - * to pad the file. - * There could also be non-FF garbage between markers. The treatment of such - * garbage is unspecified; we choose to skip over it but emit a warning msg. - * NB: this routine must not be used after seeing SOS marker, since it will - * not deal correctly with FF/00 sequences in the compressed image data... - */ - -static int next_marker(void) { - int c; - int discarded_bytes = 0; - - /* Find 0xFF byte; count and skip any non-FFs. */ - c = read_1_byte(); - while (c != 0xFF) { - discarded_bytes++; - c = read_1_byte(); - } - /* Get marker code byte, swallowing any duplicate FF bytes. Extra FFs - * are legal as pad bytes, so don't count them in discarded_bytes. - */ - do { - c = read_1_byte(); - } while (c == 0xFF); - - if (discarded_bytes != 0) { - fprintf(stderr, "Warning: garbage data found in JPEG file\n"); - } - - return c; -} - -/* - * Read the initial marker, which should be SOI. - * For a JFIF file, the first two bytes of the file should be literally - * 0xFF M_SOI. To be more general, we could use next_marker, but if the - * input file weren't actually JPEG at all, next_marker might read the whole - * file and then return a misleading error message... - */ - -static int first_marker(void) { - int c1, c2; - - c1 = NEXTBYTE(); - c2 = NEXTBYTE(); - if (c1 != 0xFF || c2 != M_SOI) - { - ERREXIT("Not a JPEG file"); - } - return c2; -} - -/* - * Most types of marker are followed by a variable-length parameter segment. - * This routine skips over the parameters for any marker we don't otherwise - * want to process. - * Note that we MUST skip the parameter segment explicitly in order not to - * be fooled by 0xFF bytes that might appear within the parameter segment; - * such bytes do NOT introduce new markers. - */ - -static void skip_variable(void) -/* Skip over an unknown or uninteresting variable-length marker */ -{ - unsigned int length; - - /* Get the marker parameter length count */ - length = read_2_bytes(); - /* Length includes itself, so must be at least 2 */ - if (length < 2) - ERREXIT("Erroneous JPEG marker length"); - length -= 2; - /* Skip over the remaining bytes */ - while (length > 0) { - (void)read_1_byte(); - length--; - } -} - -/* - * Process a COM marker. - * We want to print out the marker contents as legible text; - * we must guard against non-text junk and varying newline representations. - */ - -static void process_COM(int raw) { - unsigned int length; - int ch; - int lastch = 0; - -/* Bill Allombert: set locale properly for isprint */ -#ifdef HAVE_LOCALE_H - setlocale(LC_CTYPE, ""); -#endif - - /* Get the marker parameter length count */ - length = read_2_bytes(); - /* Length includes itself, so must be at least 2 */ - if (length < 2) - ERREXIT("Erroneous JPEG marker length"); - length -= 2; - - while (length > 0) { - ch = read_1_byte(); - if (raw) { - putc(ch, stdout); - /* Emit the character in a readable form. - * Nonprintables are converted to \nnn form, - * while \ is converted to \\. - * Newlines in CR, CR/LF, or LF form will be printed as one newline. - */ - } else if (ch == '\r') { - printf("\n"); - } else if (ch == '\n') { - if (lastch != '\r') - printf("\n"); - } else if (ch == '\\') { - printf("\\\\"); - } else if (isprint(ch)) { - putc(ch, stdout); - } else { - printf("\\%03o", ch); - } - lastch = ch; - length--; - } - printf("\n"); - -/* Bill Allombert: revert to C locale */ -#ifdef HAVE_LOCALE_H - setlocale(LC_CTYPE, "C"); -#endif -} - -/* - * Process a SOFn marker. - * This code is only needed if you want to know the image dimensions... - */ - -static void process_SOFn(int marker) { - unsigned int length; - unsigned int image_height, image_width; - int data_precision, num_components; - const char *process; - int ci; - - length = read_2_bytes(); /* usual parameter length count */ - - data_precision = read_1_byte(); - image_height = read_2_bytes(); - image_width = read_2_bytes(); - num_components = read_1_byte(); - - switch (marker) { - case M_SOF0: - process = "Baseline"; - break; - case M_SOF1: - process = "Extended sequential"; - break; - case M_SOF2: - process = "Progressive"; - break; - case M_SOF3: - process = "Lossless"; - break; - case M_SOF5: - process = "Differential sequential"; - break; - case M_SOF6: - process = "Differential progressive"; - break; - case M_SOF7: - process = "Differential lossless"; - break; - case M_SOF9: - process = "Extended sequential, arithmetic coding"; - break; - case M_SOF10: - process = "Progressive, arithmetic coding"; - break; - case M_SOF11: - process = "Lossless, arithmetic coding"; - break; - case M_SOF13: - process = "Differential sequential, arithmetic coding"; - break; - case M_SOF14: - process = "Differential progressive, arithmetic coding"; - break; - case M_SOF15: - process = "Differential lossless, arithmetic coding"; - break; - default: - process = "Unknown"; - break; - } - - printf("JPEG image is %uw * %uh, %d color components, %d bits per sample\n", - image_width, image_height, num_components, data_precision); - printf("JPEG process: %s\n", process); - - if (length != (unsigned int)(8 + num_components * 3)) - ERREXIT("Bogus SOF marker length"); - - for (ci = 0; ci < num_components; ci++) { - (void)read_1_byte(); /* Component ID code */ - (void)read_1_byte(); /* H, V sampling factors */ - (void)read_1_byte(); /* Quantization table number */ - } -} - -/* - * Parse the marker stream until SOS or EOI is seen; - * display any COM markers. - * While the companion program wrjpgcom will always insert COM markers before - * SOFn, other implementations might not, so we scan to SOS before stopping. - * If we were only interested in the image dimensions, we would stop at SOFn. - * (Conversely, if we only cared about COM markers, there would be no need - * for special code to handle SOFn; we could treat it like other markers.) - */ - -static int scan_JPEG_header(int verbose, int raw) { - int marker; - /* Expect SOI at start of file */ - if (first_marker() != M_SOI) - ERREXIT("Expected SOI marker first"); - - /* Scan miscellaneous markers until we reach SOS. */ - for (;;) { - marker = next_marker(); - switch (marker) { - /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be, - * treated as SOFn. C4 in particular is actually DHT. - */ - case M_SOF0: /* Baseline */ - case M_SOF1: /* Extended sequential, Huffman */ - case M_SOF2: /* Progressive, Huffman */ - case M_SOF3: /* Lossless, Huffman */ - case M_SOF5: /* Differential sequential, Huffman */ - case M_SOF6: /* Differential progressive, Huffman */ - case M_SOF7: /* Differential lossless, Huffman */ - case M_SOF9: /* Extended sequential, arithmetic */ - case M_SOF10: /* Progressive, arithmetic */ - case M_SOF11: /* Lossless, arithmetic */ - case M_SOF13: /* Differential sequential, arithmetic */ - case M_SOF14: /* Differential progressive, arithmetic */ - case M_SOF15: /* Differential lossless, arithmetic */ - if (verbose) - process_SOFn(marker); - else - skip_variable(); - break; - - case M_SOS: /* stop before hitting compressed data */ - return marker; - - case M_EOI: /* in case it's a tables-only JPEG stream */ - return marker; - - case M_COM: - process_COM(raw); - break; - - case M_APP12: - /* Some digital camera makers put useful textual information into - * APP12 markers, so we print those out too when in -verbose mode. - */ - if (verbose) { - printf("APP12 contains:\n"); - process_COM(raw); - } else - skip_variable(); - break; - - default: /* Anything else just gets skipped */ - skip_variable(); /* we assume it has a parameter count... */ - break; - } - } /* end loop */ -} - -/* Command line parsing code */ - -static const char *progname; /* program name for error messages */ - -static void usage(void) -/* complain about bad command line */ -{ - fprintf(stderr, "rdjpgcom displays any textual comments in a JPEG file.\n"); - - fprintf(stderr, "Usage: %s [switches] [inputfile]\n", progname); - - fprintf(stderr, "Switches (names may be abbreviated):\n"); - fprintf( - stderr, - " -raw Display non-printable characters in comments (unsafe)\n"); - fprintf(stderr, " -verbose Also display dimensions of JPEG image\n"); - - exit(EXIT_FAILURE); -} - -static int keymatch(char *arg, const char *keyword, int minchars) -/* Case-insensitive matching of (possibly abbreviated) keyword switches. */ -/* keyword is the constant keyword (must be lower case already), */ -/* minchars is length of minimum legal abbreviation. */ -{ - register int ca, ck; - register int nmatched = 0; - - while ((ca = *arg++) != '\0') { - if ((ck = *keyword++) == '\0') - return 0; /* arg longer than keyword, no good */ - if (isupper(ca)) /* force arg to lcase (assume ck is already) */ - ca = tolower(ca); - if (ca != ck) - return 0; /* no good */ - nmatched++; /* count matched characters */ - } - /* reached end of argument; fail if it's too short for unique abbrev */ - if (nmatched < minchars) - return 0; - return 1; /* A-OK */ -} - -/* - * The main program. - */ - -int main(int argc, char **argv) { - int argn; - char *arg; - int verbose = 1, raw = 0; - -/* On Mac, fetch a command line. */ -#ifdef USE_CCOMMAND - argc = ccommand(&argv); -#endif - - progname = argv[0]; - if (progname == NULL || progname[0] == 0) - progname = "rdjpgcom"; /* in case C library doesn't provide it */ - - /* Parse switches, if any */ - for (argn = 1; argn < argc; argn++) - { - arg = argv[argn]; - if (arg[0] != '-') - break; /* not switch, must be file name */ - arg++; /* advance over '-' */ - if (keymatch(arg, "verbose", 1)) - { - verbose++; - } - else if (keymatch(arg, "raw", 1)) - { - raw = 1; - } - else - usage(); - } - - /* Open the input file. */ - /* Unix style: expect zero or one file name */ - if (argn < argc - 1) - { - fprintf(stderr, "%s: only one input file\n", progname); - usage(); - } - if (argn < argc) - { - if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) - { - fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]); - exit(EXIT_FAILURE); - } - } - else if ((infile = fopen("testimg.jpg", READ_BINARY)) == NULL) - { -/* default input file is stdin */ -#ifdef USE_SETMODE /* need to hack file mode? */ - setmode(fileno(stdin), O_BINARY); -#endif -#ifdef USE_FDOPEN /* need to re-open in binary mode? */ - if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) - { - fprintf(stderr, "%s: can't open stdin\n", progname); - exit(EXIT_FAILURE); - } -#else - infile = stdin; -#endif - } - - /* Scan the JPEG headers. */ - (void)scan_JPEG_header(verbose, raw); - - /* All done. */ - exit(EXIT_SUCCESS); - return 0; /* suppress no-return-value warnings */ +#include "jpeglib.h" +#include "transupp.h" + +int main() { + struct jpeg_decompress_struct info; + struct jpeg_error_mgr err; + info.err = jpeg_std_error(&err); + jpeg_create_decompress(&info); + printf("libjpeg test successful\n"); } diff --git a/recipes/libjpeg/all/test_package/test_transupp.c b/recipes/libjpeg/all/test_package/test_transupp.c deleted file mode 100644 index 188c5655a0762..0000000000000 --- a/recipes/libjpeg/all/test_package/test_transupp.c +++ /dev/null @@ -1,96 +0,0 @@ -#include -#include -#include - -#include "jpeglib.h" -#include "jpegint.h" -#include "transupp.h" - -struct error_data { - struct jpeg_error_mgr pub; - const char *name; -}; - - -static void -my_error_handler(j_common_ptr cinfo) { - struct error_data *data = (struct error_data *) cinfo; - while(1) { - fprintf(stderr, "-"); - } - fprintf(stderr, "%s:\n", data->name); - fflush(stdout); - fflush(stderr); - (*cinfo->err->output_message) (cinfo); - exit(2); -} - -int main(int argc, char *argv[]) { - if (argc < 3) { - fprintf(stderr, "Usage: %s \n", argv[0]); - return 1; - } - - struct error_data err_in; - err_in.name = "input"; - err_in.pub.error_exit = my_error_handler; - - struct error_data err_out; - err_out.name = "output"; - err_out.pub.error_exit = my_error_handler; - - FILE *fin = fopen(argv[1], "rb"); - - struct jpeg_decompress_struct src; - struct jpeg_compress_struct dst; - - src.err = jpeg_std_error(&err_in.pub); - jpeg_create_decompress(&src); - - dst.err = jpeg_std_error(&err_in.pub); - jpeg_create_compress(&dst); - - jpeg_stdio_src(&src, fin); - - jcopy_markers_setup(&src, JCOPYOPT_ALL); - - (void)jpeg_read_header(&src, TRUE); - - jpeg_transform_info transform = { - .transform = JXFORM_ROT_180, - }; - - if ((src.image_width % 2) || (dst.image_height % 2)) { - fprintf(stderr, "The input image is odd-sized. The transform will not be correct.\n"); - } - - if (!jtransform_request_workspace(&src, &transform)) { - fprintf(stderr, "Can only transform odd-size images perfectly.\n"); - return 3; - } - - jvirt_barray_ptr *src_coeffs = jpeg_read_coefficients(&src); - jpeg_copy_critical_parameters(&src, &dst); - - jvirt_barray_ptr *dst_coefs = jtransform_adjust_parameters(&src, &dst, src_coeffs, &transform); - - - FILE *fout = fopen(argv[2], "wb"); - jpeg_stdio_dest(&dst, fout); - - jpeg_write_coefficients(&dst, dst_coefs); - - jcopy_markers_execute(&src, &dst, JCOPYOPT_ALL); - jtransform_execute_transformation(&src, &dst, src_coeffs, &transform); - - jpeg_finish_compress(&dst); - jpeg_destroy_compress(&dst); - fclose(fout); - - jpeg_finish_decompress(&src); - jpeg_destroy_decompress(&src); - fclose(fin); - - printf("Done\n"); - return 0; -} diff --git a/recipes/libjpeg/all/test_package/testimg.jpg b/recipes/libjpeg/all/test_package/testimg.jpg deleted file mode 100644 index a026e486f57de..0000000000000 Binary files a/recipes/libjpeg/all/test_package/testimg.jpg and /dev/null differ diff --git a/recipes/libjpeg/all/test_v1_package/CMakeLists.txt b/recipes/libjpeg/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 961b416af6b07..0000000000000 --- a/recipes/libjpeg/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libjpeg/all/test_v1_package/conanfile.py b/recipes/libjpeg/all/test_v1_package/conanfile.py deleted file mode 100644 index 803919e9ca672..0000000000000 --- a/recipes/libjpeg/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,31 +0,0 @@ -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - - @property - def _test_transupp(self): - # transupp+libjpeg makes use of stdio of the C library. This cannot be used when using a dll libjpeg, built with a static c library. - return not (self.options["libjpeg"].shared and is_msvc(self) and is_msvc_static_runtime(self)) - - def build(self): - cmake = CMake(self) - cmake.definitions["BUILD_TRANSUPP"] = self._test_transupp - if self._test_transupp: - cmake.definitions["LIBJPEG_RES_DIR"] = os.path.join(self.deps_cpp_info["libjpeg"].rootpath, "res").replace("\\", "/") - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", run_environment=True) - if self._test_transupp: - test_transupp_path = os.path.join("bin", "test_transupp") - out_img = os.path.join(self.build_folder, "outimg.jpg") - self.run(f"{test_transupp_path} {img_name} {out_img}", run_environment=True) diff --git a/recipes/libjpeg/config.yml b/recipes/libjpeg/config.yml index 6c44911f307cd..182822cf7c426 100644 --- a/recipes/libjpeg/config.yml +++ b/recipes/libjpeg/config.yml @@ -1,7 +1,7 @@ versions: + "9f": + folder: all "9e": folder: all "9d": folder: all - "9c": - folder: all diff --git a/recipes/libjxl/all/CMakeLists.txt b/recipes/libjxl/all/CMakeLists.txt deleted file mode 100644 index c986d294c7547..0000000000000 --- a/recipes/libjxl/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/libjxl/all/conan_deps.cmake b/recipes/libjxl/all/conan_deps.cmake new file mode 100644 index 0000000000000..e62d6fec8071b --- /dev/null +++ b/recipes/libjxl/all/conan_deps.cmake @@ -0,0 +1,24 @@ +find_package(Brotli REQUIRED CONFIG) +find_package(HWY REQUIRED CONFIG) +find_package(LCMS2 REQUIRED CONFIG) + +# Add wrapper targets for the project to link against +add_library(brotlicommon INTERFACE) +target_link_libraries(brotlicommon INTERFACE brotli::brotli) +set_target_properties(brotlicommon PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Brotli_INCLUDE_DIRS}") +set_target_properties(brotlicommon PROPERTIES INCLUDE_DIRECTORIES "${Brotli_INCLUDE_DIRS}") +add_library(brotlidec ALIAS brotlicommon) +add_library(brotlienc ALIAS brotlicommon) +add_library(brotlicommon-static ALIAS brotlicommon) +add_library(brotlidec-static ALIAS brotlicommon) +add_library(brotlienc-static ALIAS brotlicommon) + +add_library(hwy INTERFACE) +target_link_libraries(hwy INTERFACE highway::highway) +set_target_properties(hwy PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${HWY_INCLUDE_DIRS}") +set_target_properties(hwy PROPERTIES INCLUDE_DIRECTORIES "${HWY_INCLUDE_DIRS}") + +add_library(lcms2 INTERFACE) +target_link_libraries(lcms2 INTERFACE lcms::lcms) +set_target_properties(lcms2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LCMS2_INCLUDE_DIRS}") +set_target_properties(lcms2 PROPERTIES INCLUDE_DIRECTORIES "${LCMS2_INCLUDE_DIRS}") diff --git a/recipes/libjxl/all/conandata.yml b/recipes/libjxl/all/conandata.yml index 8a3abcae1301c..a7d688f285681 100644 --- a/recipes/libjxl/all/conandata.yml +++ b/recipes/libjxl/all/conandata.yml @@ -1,18 +1,13 @@ sources: - "0.5.0": - url: "https://github.com/libjxl/libjxl/archive/v0.5.zip" - sha256: "a208be41542c6f81f10a82c6bb4bc75d3eceb9d4f7ecb6ea0ad2f2d236694c4b" + "0.10.3": + url: "https://github.com/libjxl/libjxl/archive/v0.10.3.zip" + sha256: "a9e2103f61ab79f5561b506ad03fcba33207263284b1a796eba3ca826ab0a75f" + "0.10.2": + url: "https://github.com/libjxl/libjxl/archive/v0.10.2.zip" + sha256: "910ab4245eebe0fba801a057f5fbc4fe96dad7c9979880bb49ad3e2623a911a2" + "0.8.2": + url: "https://github.com/libjxl/libjxl/archive/v0.8.2.zip" + sha256: "1f2ccc06f07c4f6cf4aa6c7763ba0598f12a7544d597f02beb07f615eb08ccf0" "0.6.1": url: "https://github.com/libjxl/libjxl/archive/v0.6.1.zip" sha256: "3e4877daef07724aa6f490bf80c45ada804f35fe3cce59c27e89c5ae3099535a" -patches: - "0.5.0": - - patch_file: "patches/0001-clean-targets-v0.5.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-fix-dependencies-v0.5.patch" - base_path: "source_subfolder" - "0.6.1": - - patch_file: "patches/0001-clean-targets-v0.6.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-fix-dependencies-v0.6.patch" - base_path: "source_subfolder" diff --git a/recipes/libjxl/all/conanfile.py b/recipes/libjxl/all/conanfile.py index a8d214a9a78ab..1f4b5564868a0 100644 --- a/recipes/libjxl/all/conanfile.py +++ b/recipes/libjxl/all/conanfile.py @@ -1,9 +1,16 @@ -from conans import ConanFile, CMake, tools import os -import shutil -import glob -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building, stdcpp_library, 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, rmdir, save, rm, replace_in_file +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class LibjxlConan(ConanFile): @@ -14,114 +21,215 @@ class LibjxlConan(ConanFile): homepage = "https://github.com/libjxl/libjxl" topics = ("image", "jpeg-xl", "jxl", "jpeg") - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - - exports_sources = "CMakeLists.txt", "patches/**" - generators = "cmake" - _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], + "avx512": [True, False], + "avx512_spr": [True, False], + "avx512_zen4": [True, False], + "with_tcmalloc": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "avx512": False, + "avx512_spr": False, + "avx512_zen4": False, + "with_tcmalloc": False, + } + + def export_sources(self): + copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if self.settings.arch not in ["x86", "x86_64"] or Version(self.version) < "0.9": + del self.options.avx512 + del self.options.avx512_spr + del self.options.avx512_zen4 + # https://github.com/libjxl/libjxl/blob/v0.9.1/CMakeLists.txt#L52-L59 + if self.settings.os in ["Linux", "FreeBSD"] and self.settings.arch == "x86_64": + self.options.with_tcmalloc = True 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("brotli/1.0.9") - self.requires("highway/0.12.2") - self.requires("lcms/2.11") + self.requires("brotli/1.1.0") + if Version(self.version) >= "0.7": + self.requires("highway/1.1.0") + else: + self.requires("highway/0.12.2") + self.requires("lcms/2.16") + if self.options.with_tcmalloc: + self.requires("gperftools/2.15") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + if self.version == "0.6.1" and is_msvc(self) and self.options.shared: + # Fails with a missing DLL error in test_package + raise ConanInvalidConfiguration(f"{self.ref} does not support shared builds with MSVC") + + def build_requirements(self): + # Require newer CMake, which allows INCLUDE_DIRECTORIES to be set on INTERFACE targets + # Also, v0.9+ require CMake 3.16 + self.tool_requires("cmake/[>=3.19 <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 generate(self): + VirtualBuildEnv(self).generate() + + tc = CMakeToolchain(self) + tc.variables["CMAKE_PROJECT_LIBJXL_INCLUDE"] = "conan_deps.cmake" + tc.variables["BUILD_TESTING"] = False + tc.variables["JPEGXL_STATIC"] = not self.options.shared # applies to tools only + tc.variables["JPEGXL_BUNDLE_LIBPNG"] = False + tc.variables["JPEGXL_ENABLE_BENCHMARK"] = False + tc.variables["JPEGXL_ENABLE_DOXYGEN"] = False + tc.variables["JPEGXL_ENABLE_EXAMPLES"] = False + tc.variables["JPEGXL_ENABLE_JNI"] = False + tc.variables["JPEGXL_ENABLE_MANPAGES"] = False + tc.variables["JPEGXL_ENABLE_OPENEXR"] = False + tc.variables["JPEGXL_ENABLE_PLUGINS"] = False + tc.variables["JPEGXL_ENABLE_SJPEG"] = False + tc.variables["JPEGXL_ENABLE_SKCMS"] = False + tc.variables["JPEGXL_ENABLE_TCMALLOC"] = self.options.with_tcmalloc + tc.variables["JPEGXL_ENABLE_VIEWERS"] = False + tc.variables["JPEGXL_ENABLE_TOOLS"] = False + tc.variables["JPEGXL_FORCE_SYSTEM_BROTLI"] = True + tc.variables["JPEGXL_FORCE_SYSTEM_GTEST"] = True + tc.variables["JPEGXL_FORCE_SYSTEM_HWY"] = True + tc.variables["JPEGXL_FORCE_SYSTEM_LCMS2"] = True + tc.variables["JPEGXL_WARNINGS_AS_ERRORS"] = False + tc.variables["JPEGXL_FORCE_NEON"] = False + tc.variables["JPEGXL_ENABLE_AVX512"] = self.options.get_safe("avx512", False) + tc.variables["JPEGXL_ENABLE_AVX512_SPR"] = self.options.get_safe("avx512_spr", False) + tc.variables["JPEGXL_ENABLE_AVX512_ZEN4"] = self.options.get_safe("avx512_zen4", False) + if cross_building(self): + tc.variables["CMAKE_SYSTEM_PROCESSOR"] = str(self.settings.arch) + # Allow non-cache_variables to be used + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + # Skip the buggy custom FindAtomic and force the use of atomic library directly for libstdc++ + tc.variables["ATOMICS_LIBRARIES"] = "atomic" if self._atomic_required else "" + if Version(self.version) >= "0.8": + # TODO: add support for the jpegli JPEG encoder library + tc.variables["JPEGXL_ENABLE_JPEGLI"] = False + tc.variables["JPEGXL_ENABLE_JPEGLI_LIBJPEG"] = False + # TODO: can hopefully be removed in newer versions + # https://github.com/libjxl/libjxl/issues/3159 + if Version(self.version) >= "0.9" and self.settings.build_type == "Debug" and is_msvc(self): + tc.preprocessor_definitions["JXL_DEBUG_V_LEVEL"] = 1 + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("brotli", "cmake_file_name", "Brotli") + deps.set_property("highway", "cmake_file_name", "HWY") + deps.set_property("lcms", "cmake_file_name", "LCMS2") + deps.generate() + + # For tcmalloc + deps = PkgConfigDeps(self) + deps.generate() + + @property + def _atomic_required(self): + return self.settings.get_safe("compiler.libcxx") in ["libstdc++", "libstdc++11"] def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.definitions["JPEGXL_STATIC"] = not self.options.shared - self._cmake.definitions["JPEGXL_ENABLE_BENCHMARK"] = False - self._cmake.definitions["JPEGXL_ENABLE_EXAMPLES"] = False - self._cmake.definitions["JPEGXL_ENABLE_MANPAGES"] = False - self._cmake.definitions["JPEGXL_ENABLE_SJPEG"] = False - self._cmake.definitions["JPEGXL_ENABLE_OPENEXR"] = False - self._cmake.definitions["JPEGXL_ENABLE_SKCMS"] = False - self._cmake.definitions["JPEGXL_ENABLE_TCMALLOC"] = False - if tools.cross_building(self): - self._cmake.definitions["CMAKE_SYSTEM_PROCESSOR"] = \ - str(self.settings.arch) - self._cmake.configure() - return self._cmake + # Disable tools, extras and third_party + save(self, os.path.join(self.source_folder, "tools", "CMakeLists.txt"), "") + save(self, os.path.join(self.source_folder, "third_party", "CMakeLists.txt"), "") + # FindAtomics.cmake values are set by CMakeToolchain instead + save(self, os.path.join(self.source_folder, "cmake", "FindAtomics.cmake"), "") + + # Allow fPIC to be set by Conan + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)", "") + for cmake_file in ["jxl.cmake", "jxl_threads.cmake", "jxl_cms.cmake", "jpegli.cmake"]: + path = os.path.join(self.source_folder, "lib", cmake_file) + if os.path.exists(path): + fpic = "ON" if self.options.get_safe("fPIC", True) else "OFF" + replace_in_file(self, path, "POSITION_INDEPENDENT_CODE ON", f"POSITION_INDEPENDENT_CODE {fpic}") + + if Version(self.version) < "0.7": + replace_in_file(self, os.path.join(self.source_folder, "lib", "jxl.cmake"), + " DESTINATION ${CMAKE_INSTALL_LIBDIR}", + " RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib") + if self.settings.compiler not in ["gcc", "clang"]: + replace_in_file(self, os.path.join(self.source_folder, "lib", "jxl.cmake"), + "-Wl,--exclude-libs=ALL", "") def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) if self.options.shared: - libs_dir = os.path.join(self.package_folder, "lib") - tools.remove_files_by_mask(libs_dir, "*.a") - tools.remove_files_by_mask(libs_dir, "*-static.lib") - - if self.settings.os == "Windows": - self.copy("jxl_dec.dll", src="bin", dst="bin") - self.copy("jxl_dec.lib", src="lib", dst="lib") - for dll_path in glob.glob(os.path.join(libs_dir, "*.dll")): - shutil.move(dll_path, os.path.join(self.package_folder, - "bin", os.path.basename(dll_path))) - else: - self.copy("libjxl_dec.*", src="lib", dst="lib") + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + rm(self, "*-static.lib", os.path.join(self.package_folder, "lib")) def _lib_name(self, name): - if not self.options.shared and self.settings.os == "Windows": + if Version(self.version) < "0.9" and not self.options.shared and self.settings.os == "Windows": return name + "-static" return name def package_info(self): + libcxx = stdcpp_library(self) + # jxl - self.cpp_info.components["jxl"].names["pkg_config"] = "libjxl" + self.cpp_info.components["jxl"].set_property("pkg_config_name", "libjxl") self.cpp_info.components["jxl"].libs = [self._lib_name("jxl")] - self.cpp_info.components["jxl"].requires = ["brotli::brotli", - "highway::highway", - "lcms::lcms"] + self.cpp_info.components["jxl"].requires = ["brotli::brotli", "highway::highway", "lcms::lcms"] + if self.options.with_tcmalloc: + self.cpp_info.components["jxl"].requires.append("gperftools::tcmalloc_minimal") + if self._atomic_required: + self.cpp_info.components["jxl"].system_libs.append("atomic") + if not self.options.shared: + self.cpp_info.components["jxl"].defines.append("JXL_STATIC_DEFINE") + if libcxx: + self.cpp_info.components["jxl"].system_libs.append(libcxx) + + # jxl_cms + if Version(self.version) >= "0.9.0": + self.cpp_info.components["jxl_cms"].set_property("pkg_config_name", "libjxl_cms") + self.cpp_info.components["jxl_cms"].libs = [self._lib_name("jxl_cms")] + self.cpp_info.components["jxl_cms"].requires = ["lcms::lcms", "highway::highway"] + if not self.options.shared: + self.cpp_info.components["jxl"].defines.append("JXL_CMS_STATIC_DEFINE") + if libcxx: + self.cpp_info.components["jxl_cms"].system_libs.append(libcxx) + # jxl_dec - self.cpp_info.components["jxl_dec"].names["pkg_config"] = "libjxl_dec" - self.cpp_info.components["jxl_dec"].libs = [self._lib_name("jxl_dec")] - self.cpp_info.components["jxl_dec"].requires = ["brotli::brotli", - "highway::highway", - "lcms::lcms"] + if Version(self.version) < "0.9.0": + if not self.options.shared: + self.cpp_info.components["jxl_dec"].set_property("pkg_config_name", "libjxl_dec") + self.cpp_info.components["jxl_dec"].libs = [self._lib_name("jxl_dec")] + self.cpp_info.components["jxl_dec"].requires = ["brotli::brotli", "highway::highway", "lcms::lcms"] + if libcxx: + self.cpp_info.components["jxl_dec"].system_libs.append(libcxx) + # jxl_threads - self.cpp_info.components["jxl_threads"].names["pkg_config"] = \ - "libjxl_threads" - self.cpp_info.components["jxl_threads"].libs = \ - [self._lib_name("jxl_threads")] - if self.settings.os == "Linux": + self.cpp_info.components["jxl_threads"].set_property("pkg_config_name", "libjxl_threads") + self.cpp_info.components["jxl_threads"].libs = [self._lib_name("jxl_threads")] + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["jxl_threads"].system_libs = ["pthread"] - - if not self.options.shared and tools.stdcpp_library(self): - self.cpp_info.components["jxl"].system_libs.append( - tools.stdcpp_library(self)) - self.cpp_info.components["jxl_dec"].system_libs.append( - tools.stdcpp_library(self)) - self.cpp_info.components["jxl_threads"].system_libs.append( - tools.stdcpp_library(self)) + if not self.options.shared: + self.cpp_info.components["jxl_threads"].defines.append("JXL_THREADS_STATIC_DEFINE") + if libcxx: + self.cpp_info.components["jxl_threads"].system_libs.append(libcxx) diff --git a/recipes/libjxl/all/patches/0001-clean-targets-v0.5.patch b/recipes/libjxl/all/patches/0001-clean-targets-v0.5.patch deleted file mode 100644 index 1f47c925782ce..0000000000000 --- a/recipes/libjxl/all/patches/0001-clean-targets-v0.5.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -150,8 +150,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - if(JPEGXL_STATIC) - set(CMAKE_FIND_LIBRARY_SUFFIXES .a) - set(BUILD_SHARED_LIBS 0) -- set(CMAKE_EXE_LINKER_FLAGS -- "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++") - if (MINGW) - # In MINGW libstdc++ uses pthreads directly. When building statically a - # program (regardless of whether the source code uses pthread or not) the -@@ -247,8 +245,6 @@ set(CMAKE_CXX_STANDARD 11) - set(CMAKE_CXX_EXTENSIONS OFF) - set(CMAKE_CXX_STANDARD_REQUIRED YES) - --add_subdirectory(third_party) -- - set(THREADS_PREFER_PTHREAD_FLAG YES) - find_package(Threads REQUIRED) - -@@ -331,6 +327,3 @@ endif () - if (${JPEGXL_ENABLE_PLUGINS}) - add_subdirectory(plugins) - endif () -- --# Binary tools --add_subdirectory(tools) - ---- a/lib/CMakeLists.txt -+++ b/lib/CMakeLists.txt -@@ -119,7 +119,6 @@ endif() #!MSVC - include(jxl.cmake) - - # Other libraries outside the core jxl library. --include(jxl_extras.cmake) - include(jxl_threads.cmake) - - # Install all the library headers from the source and the generated ones. There diff --git a/recipes/libjxl/all/patches/0001-clean-targets-v0.6.patch b/recipes/libjxl/all/patches/0001-clean-targets-v0.6.patch deleted file mode 100644 index e59af39610354..0000000000000 --- a/recipes/libjxl/all/patches/0001-clean-targets-v0.6.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -161,6 +161,4 @@ # ourselves; for real use case we don't care about stdlib, as it is "granted", - # so just linking all other libraries is fine. - if (NOT APPLE) -- set(CMAKE_EXE_LINKER_FLAGS -- "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++") - endif() - endif() # JPEGXL_STATIC -@@ -278,8 +277,6 @@ set(CMAKE_CXX_STANDARD 11) - set(CMAKE_CXX_EXTENSIONS OFF) - set(CMAKE_CXX_STANDARD_REQUIRED YES) - --add_subdirectory(third_party) -- - # Copy the JXL license file to the output build directory. - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" - ${PROJECT_BINARY_DIR}/LICENSE.jpeg-xl COPYONLY) -@@ -380,6 +376,3 @@ # Plugins for third-party software - if (${JPEGXL_ENABLE_PLUGINS}) - add_subdirectory(plugins) - endif () -- --# Binary tools --add_subdirectory(tools) - ---- a/lib/CMakeLists.txt -+++ b/lib/CMakeLists.txt -@@ -132,7 +132,6 @@ # The jxl library definition. - include(jxl.cmake) - - # Other libraries outside the core jxl library. --include(jxl_extras.cmake) - include(jxl_threads.cmake) - - # Install all the library headers from the source and the generated ones. There diff --git a/recipes/libjxl/all/patches/0002-fix-dependencies-v0.5.patch b/recipes/libjxl/all/patches/0002-fix-dependencies-v0.5.patch deleted file mode 100644 index 8ec6fc1cb0d9d..0000000000000 --- a/recipes/libjxl/all/patches/0002-fix-dependencies-v0.5.patch +++ /dev/null @@ -1,106 +0,0 @@ ---- a/lib/jxl.cmake -+++ b/lib/jxl.cmake -@@ -328,7 +328,7 @@ if (JPEGXL_ENABLE_SKCMS) - list(APPEND JPEGXL_INTERNAL_FLAGS -DJPEGXL_ENABLE_SKCMS=1) - list(APPEND JPEGXL_INTERNAL_LIBS skcms) - else () -- list(APPEND JPEGXL_INTERNAL_LIBS lcms2) -+ list(APPEND JPEGXL_INTERNAL_LIBS ${CONAN_LIBS_LCMS}) - endif () - - if (NOT JPEGXL_ENABLE_TRANSCODE_JPEG) -@@ -353,8 +353,6 @@ set_property(TARGET jxl_dec-obj PROPERTY POSITION_INDEPENDENT_CODE ON) - target_include_directories(jxl_dec-obj PUBLIC - ${PROJECT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include -- $ -- $ - ) - target_compile_definitions(jxl_dec-obj PUBLIC - ${OBJ_COMPILE_DEFINITIONS} -@@ -371,8 +369,6 @@ set_property(TARGET jxl_enc-obj PROPERTY POSITION_INDEPENDENT_CODE ON) - target_include_directories(jxl_enc-obj PUBLIC - ${PROJECT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include -- $ -- $ - ) - target_compile_definitions(jxl_enc-obj PUBLIC - ${OBJ_COMPILE_DEFINITIONS} -@@ -381,23 +377,6 @@ if (JPEGXL_ENABLE_PROFILER) - target_link_libraries(jxl_enc-obj PUBLIC jxl_profiler) - endif() - --#TODO(lode): don't depend on CMS for the core library --if (JPEGXL_ENABLE_SKCMS) -- target_include_directories(jxl_enc-obj PRIVATE -- $ -- ) -- target_include_directories(jxl_dec-obj PRIVATE -- $ -- ) --else () -- target_include_directories(jxl_enc-obj PRIVATE -- $ -- ) -- target_include_directories(jxl_dec-obj PRIVATE -- $ -- ) --endif () -- - # Headers for exporting/importing public headers - include(GenerateExportHeader) - # TODO(deymo): Add these visibility properties to the static dependencies of -@@ -416,9 +395,6 @@ set_target_properties(jxl_enc-obj PROPERTIES - VISIBILITY_INLINES_HIDDEN 1 - DEFINE_SYMBOL JXL_INTERNAL_LIBRARY_BUILD - ) --generate_export_header(jxl_enc-obj -- BASE_NAME JXL -- EXPORT_FILE_NAME include/jxl/jxl_export.h) - target_include_directories(jxl_enc-obj PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/include) - -@@ -496,9 +472,8 @@ if (((NOT DEFINED "${TARGET_SUPPORTS_SHARED_LIBS}") OR - add_library(jxl SHARED - $ - $) --strip_static(JPEGXL_INTERNAL_SHARED_LIBS JPEGXL_INTERNAL_LIBS) - target_link_libraries(jxl PUBLIC ${JPEGXL_COVERAGE_FLAGS}) --target_link_libraries(jxl PRIVATE ${JPEGXL_INTERNAL_SHARED_LIBS}) -+target_link_libraries(jxl PRIVATE ${JPEGXL_INTERNAL_LIBS}) - # Shared library include path contains only the "include/" paths. - target_include_directories(jxl PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/include" -@@ -507,13 +482,13 @@ set_target_properties(jxl PROPERTIES - VERSION ${JPEGXL_LIBRARY_VERSION} - SOVERSION ${JPEGXL_LIBRARY_SOVERSION} - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" -- RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") -+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" -+ DEFINE_SYMBOL JXL_INTERNAL_LIBRARY_BUILD) - - # Public shared decoder library. - add_library(jxl_dec SHARED $) --strip_static(JPEGXL_DEC_INTERNAL_SHARED_LIBS JPEGXL_DEC_INTERNAL_LIBS) - target_link_libraries(jxl_dec PUBLIC ${JPEGXL_COVERAGE_FLAGS}) --target_link_libraries(jxl_dec PRIVATE ${JPEGXL_DEC_INTERNAL_SHARED_LIBS}) -+target_link_libraries(jxl_dec PRIVATE ${JPEGXL_DEC_INTERNAL_LIBS}) - # Shared library include path contains only the "include/" paths. - target_include_directories(jxl_dec PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/include" -@@ -549,8 +524,14 @@ install(TARGETS jxl - else() - add_library(jxl ALIAS jxl-static) - add_library(jxl_dec ALIAS jxl_dec-static) -+set_target_properties(jxl-static PROPERTIES -+ DEFINE_SYMBOL JXL_INTERNAL_LIBRARY_BUILD) - endif() # TARGET_SUPPORTS_SHARED_LIBS AND NOT JPEGXL_STATIC - -+generate_export_header(jxl -+ BASE_NAME JXL -+ EXPORT_FILE_NAME include/jxl/jxl_export.h) -+ - # Add a pkg-config file for libjxl. - set(JPEGXL_LIBRARY_REQUIRES - "libhwy libbrotlicommon libbrotlienc libbrotlidec") diff --git a/recipes/libjxl/all/patches/0002-fix-dependencies-v0.6.patch b/recipes/libjxl/all/patches/0002-fix-dependencies-v0.6.patch deleted file mode 100644 index b4ff403da499f..0000000000000 --- a/recipes/libjxl/all/patches/0002-fix-dependencies-v0.6.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- a/lib/jxl.cmake -+++ b/lib/jxl.cmake -@@ -334,7 +334,7 @@ if (JPEGXL_ENABLE_SKCMS) - list(APPEND JPEGXL_INTERNAL_LIBS skcms) - endif () - else () -- list(APPEND JPEGXL_INTERNAL_LIBS lcms2) -+ list(APPEND JPEGXL_INTERNAL_LIBS ${CONAN_LIBS_LCMS}) - endif () - - if (NOT JPEGXL_ENABLE_TRANSCODE_JPEG) -@@ -359,8 +359,6 @@ set_property(TARGET jxl_dec-obj PROPERTY POSITION_INDEPENDENT_CODE ON) - target_include_directories(jxl_dec-obj PUBLIC - ${PROJECT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include -- $ -- $ - ) - target_compile_definitions(jxl_dec-obj PUBLIC - ${OBJ_COMPILE_DEFINITIONS} -@@ -377,8 +375,6 @@ set_property(TARGET jxl_enc-obj PROPERTY POSITION_INDEPENDENT_CODE ON) - target_include_directories(jxl_enc-obj PUBLIC - ${PROJECT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include -- $ -- $ - ) - target_compile_definitions(jxl_enc-obj PUBLIC - ${OBJ_COMPILE_DEFINITIONS} -@@ -387,17 +383,6 @@ if (JPEGXL_ENABLE_PROFILER) - target_link_libraries(jxl_enc-obj PUBLIC jxl_profiler) - endif() - --#TODO(lode): don't depend on CMS for the core library --if (JPEGXL_ENABLE_SKCMS) -- target_include_directories(jxl_enc-obj PRIVATE -- $ -- ) --else () -- target_include_directories(jxl_enc-obj PRIVATE -- $ -- ) --endif () -- - # Headers for exporting/importing public headers - include(GenerateExportHeader) - set_target_properties(jxl_dec-obj PROPERTIES -@@ -413,9 +398,6 @@ set_target_properties(jxl_enc-obj PROPERTIES - VISIBILITY_INLINES_HIDDEN 1 - DEFINE_SYMBOL JXL_INTERNAL_LIBRARY_BUILD - ) --generate_export_header(jxl_enc-obj -- BASE_NAME JXL -- EXPORT_FILE_NAME include/jxl/jxl_export.h) - target_include_directories(jxl_enc-obj PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/include) - -@@ -495,9 +477,8 @@ if (((NOT DEFINED "${TARGET_SUPPORTS_SHARED_LIBS}") OR - - # Public shared library. - add_library(jxl SHARED ${JPEGXL_INTERNAL_OBJECTS}) --strip_static(JPEGXL_INTERNAL_SHARED_LIBS JPEGXL_INTERNAL_LIBS) - target_link_libraries(jxl PUBLIC ${JPEGXL_COVERAGE_FLAGS}) --target_link_libraries(jxl PRIVATE ${JPEGXL_INTERNAL_SHARED_LIBS}) -+target_link_libraries(jxl PRIVATE ${JPEGXL_INTERNAL_LIBS}) - # Shared library include path contains only the "include/" paths. - target_include_directories(jxl PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/include" -@@ -506,13 +487,13 @@ set_target_properties(jxl PROPERTIES - VERSION ${JPEGXL_LIBRARY_VERSION} - SOVERSION ${JPEGXL_LIBRARY_SOVERSION} - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" -- RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") -+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" -+ DEFINE_SYMBOL JXL_INTERNAL_LIBRARY_BUILD) - - # Public shared decoder library. - add_library(jxl_dec SHARED $) --strip_static(JPEGXL_DEC_INTERNAL_SHARED_LIBS JPEGXL_DEC_INTERNAL_LIBS) - target_link_libraries(jxl_dec PUBLIC ${JPEGXL_COVERAGE_FLAGS}) --target_link_libraries(jxl_dec PRIVATE ${JPEGXL_DEC_INTERNAL_SHARED_LIBS}) -+target_link_libraries(jxl_dec PRIVATE ${JPEGXL_DEC_INTERNAL_LIBS}) - # Shared library include path contains only the "include/" paths. - target_include_directories(jxl_dec PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/include" -@@ -523,6 +504,12 @@ set_target_properties(jxl_dec PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") - -+set(LINKER_EXCLUDE_LIBS_FLAG "-Wl,--exclude-libs=ALL") -+include(CheckCSourceCompiles) -+list(APPEND CMAKE_EXE_LINKER_FLAGS ${LINKER_EXCLUDE_LIBS_FLAG}) -+check_c_source_compiles("int main(){return 0;}" LINKER_SUPPORT_EXCLUDE_LIBS) -+list(REMOVE_ITEM CMAKE_EXE_LINKER_FLAGS ${LINKER_EXCLUDE_LIBS_FLAG}) -+ - # Add a jxl.version file as a version script to tag symbols with the - # appropriate version number. This script is also used to limit what's exposed - # in the shared library from the static dependencies bundled here. -@@ -541,8 +528,10 @@ foreach(target IN ITEMS jxl jxl_dec) - # This hides the default visibility symbols from static libraries bundled into - # the shared library. In particular this prevents exposing symbols from hwy - # and skcms in the shared library. -- set_property(TARGET ${target} APPEND_STRING PROPERTY -- LINK_FLAGS " -Wl,--exclude-libs=ALL") -+ if(${LINKER_SUPPORT_EXCLUDE_LIBS}) -+ set_property(TARGET ${target} APPEND_STRING PROPERTY -+ LINK_FLAGS " ${LINKER_EXCLUDE_LIBS_FLAG}") -+ endif() - endforeach() - - # Only install libjxl shared library. The libjxl_dec is not installed since it -@@ -553,8 +542,14 @@ install(TARGETS jxl - else() - add_library(jxl ALIAS jxl-static) - add_library(jxl_dec ALIAS jxl_dec-static) -+set_target_properties(jxl-static PROPERTIES -+ DEFINE_SYMBOL JXL_INTERNAL_LIBRARY_BUILD) - endif() # TARGET_SUPPORTS_SHARED_LIBS AND NOT JPEGXL_STATIC - -+generate_export_header(jxl -+ BASE_NAME JXL -+ EXPORT_FILE_NAME include/jxl/jxl_export.h) -+ - # Add a pkg-config file for libjxl. - set(JPEGXL_LIBRARY_REQUIRES - "libhwy libbrotlicommon libbrotlienc libbrotlidec") diff --git a/recipes/libjxl/all/test_package/CMakeLists.txt b/recipes/libjxl/all/test_package/CMakeLists.txt index 7b9b613cbb24a..4cb796f1c09f2 100644 --- a/recipes/libjxl/all/test_package/CMakeLists.txt +++ b/recipes/libjxl/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(libjxl REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libjxl::libjxl) diff --git a/recipes/libjxl/all/test_package/conanfile.py b/recipes/libjxl/all/test_package/conanfile.py index 138d4f5333429..ef5d7042163ec 100644 --- a/recipes/libjxl/all/test_package/conanfile.py +++ b/recipes/libjxl/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,7 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - img_path = os.path.join(self.source_folder, "test.jxl") - self.run(bin_path + " " + img_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/libjxl/all/test_package/test.jxl b/recipes/libjxl/all/test_package/test.jxl deleted file mode 100644 index a0f419a98a426..0000000000000 Binary files a/recipes/libjxl/all/test_package/test.jxl and /dev/null differ diff --git a/recipes/libjxl/all/test_package/test_package.c b/recipes/libjxl/all/test_package/test_package.c index 2cb652aa9249a..3b65dffc293ab 100644 --- a/recipes/libjxl/all/test_package/test_package.c +++ b/recipes/libjxl/all/test_package/test_package.c @@ -4,87 +4,15 @@ #include "jxl/decode.h" #include "jxl/thread_parallel_runner.h" -static int ReadFile(const char filename[], uint8_t *data[], size_t *size) +int main() { - FILE *fp = fopen(filename, "rb"); - if (!fp) - return 0; - - if (fseek(fp, 0, SEEK_END) != 0) { - fclose(fp); - return 0; - } - - *size = ftell(fp); - if (fseek(fp, 0, SEEK_SET) != 0) { - fclose(fp); - return 0; - } - - *data = malloc(*size); - if (!*data) { - fclose(fp); - return 0; - } - - if (fread(*data, sizeof(uint8_t), *size, fp) != *size) { - free(*data); - fclose(fp); - return 0; - } - - if (fclose(fp) != 0) { - free(*data); - return 0; - } - - return 1; -} - -int main(int argc, char *argv[]) -{ - int ret = EXIT_FAILURE; - - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return ret; - } - - uint8_t *data; - size_t size; - if (!ReadFile(argv[1], &data, &size)) - return ret; - JxlDecoder *dec = NULL; void *runner = NULL; - dec = JxlDecoderCreate(NULL); - if (JxlDecoderSubscribeEvents(dec, JXL_DEC_BASIC_INFO) != JXL_DEC_SUCCESS) - goto Exit; - - runner = JxlThreadParallelRunnerCreate( - NULL, JxlThreadParallelRunnerDefaultNumWorkerThreads()); - if (JxlDecoderSetParallelRunner(dec, JxlThreadParallelRunner, runner) - != JXL_DEC_SUCCESS) - goto Exit; - if (JxlDecoderSetInput(dec, data, size) != JXL_DEC_SUCCESS) - goto Exit; - - if (JxlDecoderProcessInput(dec) != JXL_DEC_BASIC_INFO) - goto Exit; - - JxlBasicInfo info; - if (JxlDecoderGetBasicInfo(dec, &info) != JXL_DEC_SUCCESS) - goto Exit; - - printf("Image size: %d x %d pixels\n", info.xsize, info.ysize); - - ret = EXIT_SUCCESS; - -Exit: - free(data); - JxlThreadParallelRunnerDestroy(runner); - JxlDecoderDestroy(dec); - return ret; + // Allways True + if (JxlDecoderSubscribeEvents(dec, JXL_DEC_BASIC_INFO) == JXL_DEC_SUCCESS) + { + printf("Test"); + } } diff --git a/recipes/libjxl/all/test_v1_package/CMakeLists.txt b/recipes/libjxl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/libjxl/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/libjxl/all/test_v1_package/conanfile.py b/recipes/libjxl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/libjxl/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/libjxl/config.yml b/recipes/libjxl/config.yml index c79a1af3be31f..efc7447d06943 100644 --- a/recipes/libjxl/config.yml +++ b/recipes/libjxl/config.yml @@ -1,5 +1,9 @@ versions: - "0.5.0": + "0.10.3": + folder: all + "0.10.2": + folder: all + "0.8.2": folder: all "0.6.1": folder: all diff --git a/recipes/libkml/all/conandata.yml b/recipes/libkml/all/conandata.yml index deea781fb42fe..018a7586f3180 100644 --- a/recipes/libkml/all/conandata.yml +++ b/recipes/libkml/all/conandata.yml @@ -1,3 +1,5 @@ +# NOTE: if a new version >1.3.0 is added, verify if it is +# compatible with C++17 and above to reflect this in recipe sources: "1.3.0": url: "https://github.com/libkml/libkml/archive/1.3.0.zip" diff --git a/recipes/libkml/all/conanfile.py b/recipes/libkml/all/conanfile.py index 1a9d0a90947d1..4ea7fb43e50c7 100644 --- a/recipes/libkml/all/conanfile.py +++ b/recipes/libkml/all/conanfile.py @@ -1,4 +1,4 @@ -from conan import ConanFile +from conan import ConanFile, conan_version 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, rmdir, save @@ -43,7 +43,7 @@ def layout(self): def requirements(self): self.requires("boost/1.81.0", transitive_headers=True) - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") self.requires("minizip/1.2.13") self.requires("uriparser/0.9.7") self.requires("zlib/[>=1.2.11 <2]") @@ -51,6 +51,12 @@ def requirements(self): def validate(self): if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration(f"{self.ref} shared with Visual Studio and MT runtime is not supported") + + def package_id(self): + cppstd = self.info.settings.get_safe("compiler.cppstd") + if cppstd and cppstd not in ['98', 'gnu98', '11', 'gnu11', '14', 'gnu14']: + prefix = "gnu" if str(cppstd).startswith("gnu") else "" + self.info.settings.compiler.cppstd = f"{prefix}14" def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -58,6 +64,20 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + + # Fallback to C++14 - the implementation uses + # functionality that is not compliant with C++17 + # See https://github.com/conan-io/conan/issues/16148 + cppstd = self.settings.get_safe("compiler.cppstd") + if cppstd and conan_version.major >= 2: + from conan.tools.build import valid_max_cppstd + if not valid_max_cppstd(self, "14"): + self.output.warning(f"Recipe not compatible with C++ {cppstd}, falling back to C++14") + use_gnu_extensions = str(cppstd).startswith("gnu") + tc.blocks.remove("cppstd") + tc.cache_variables["CMAKE_CXX_STANDARD"] = "14" + tc.cache_variables["CMAKE_CXX_EXTENSIONS"] = use_gnu_extensions + # To install relocatable shared libs on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" tc.generate() diff --git a/recipes/libliftoff/all/conandata.yml b/recipes/libliftoff/all/conandata.yml index 9cc2caed8889e..18f54d8b034f2 100644 --- a/recipes/libliftoff/all/conandata.yml +++ b/recipes/libliftoff/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.5.0": + url: "https://gitlab.freedesktop.org/emersion/libliftoff/-/archive/v0.5.0/libliftoff-v0.5.0.tar.bz2" + sha256: "2ed21be3c563b129bd8f188195a23256017e15908c195f3edcd3697584caf1c8" "0.4.1": url: "https://gitlab.freedesktop.org/emersion/libliftoff/-/archive/v0.4.1/libliftoff-v0.4.1.tar.bz2" sha256: "2ec4a6b467dda20476acb4d6bd864538ccdaa946e8666f96efa98156bf25cfb5" diff --git a/recipes/libliftoff/all/conanfile.py b/recipes/libliftoff/all/conanfile.py index 28626c0146534..792e87c5ed4a9 100644 --- a/recipes/libliftoff/all/conanfile.py +++ b/recipes/libliftoff/all/conanfile.py @@ -16,7 +16,7 @@ class LibliftoffConan(ConanFile): description = "Lightweight KMS plane library." license = "MIT" url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/project/package" + homepage = "https://gitlab.freedesktop.org/emersion/libliftoff" topics = ("drm", "KMS", "plane") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -39,16 +39,16 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libdrm/2.4.114") + self.requires("libdrm/2.4.119") def validate(self): if self.settings.os not in ["Linux", "FreeBSD"]: raise ConanInvalidConfiguration(f"{self.name} only supports FreeBSD and Linux") def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.3.2") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libliftoff/all/test_package/conanfile.py b/recipes/libliftoff/all/test_package/conanfile.py index 5aab0703e7a4e..cdcf9b281723d 100644 --- a/recipes/libliftoff/all/test_package/conanfile.py +++ b/recipes/libliftoff/all/test_package/conanfile.py @@ -17,9 +17,9 @@ def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.3.2") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def build(self): meson = Meson(self) diff --git a/recipes/libliftoff/config.yml b/recipes/libliftoff/config.yml index 3a9d5538921fc..bdf259c14aca4 100644 --- a/recipes/libliftoff/config.yml +++ b/recipes/libliftoff/config.yml @@ -1,3 +1,5 @@ versions: + "0.5.0": + folder: all "0.4.1": folder: all diff --git a/recipes/liblzf/all/CMakeLists.txt b/recipes/liblzf/all/CMakeLists.txt index a501b15938468..c20ae859c1770 100644 --- a/recipes/liblzf/all/CMakeLists.txt +++ b/recipes/liblzf/all/CMakeLists.txt @@ -2,8 +2,9 @@ cmake_minimum_required(VERSION 3.15) project(liblzf LANGUAGES C) add_library(liblzf - src/lzf_c.c - src/lzf_d.c + lzf_c.c + lzf_d.c + liblzf.def ) set_target_properties(liblzf PROPERTIES OUTPUT_NAME lzf) @@ -20,14 +21,10 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") target_compile_options(liblzf PRIVATE "-funroll-all-loops") endif() -set_target_properties(liblzf PROPERTIES - WINDOWS_EXPORT_ALL_SYMBOLS ON - PUBLIC_HEADER src/lzf.h -) - +include(GNUInstallDirs) install(TARGETS liblzf RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) +install(FILES lzf.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/liblzf/all/conanfile.py b/recipes/liblzf/all/conanfile.py index 70d2ac9f7171b..0796e45c4ac60 100644 --- a/recipes/liblzf/all/conanfile.py +++ b/recipes/liblzf/all/conanfile.py @@ -29,7 +29,8 @@ class LiblzfConan(ConanFile): } def export_sources(self): - copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + copy(self, "liblzf.def", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) export_conandata_patches(self) def config_options(self): @@ -55,11 +56,11 @@ def generate(self): def build(self): apply_conandata_patches(self) cmake = CMake(self) - cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.configure() cmake.build() def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() diff --git a/recipes/liblzf/all/liblzf.def b/recipes/liblzf/all/liblzf.def new file mode 100644 index 0000000000000..2d8efa48df7f7 --- /dev/null +++ b/recipes/liblzf/all/liblzf.def @@ -0,0 +1,3 @@ +EXPORTS + lzf_compress + lzf_decompress diff --git a/recipes/libmaxminddb/all/conandata.yml b/recipes/libmaxminddb/all/conandata.yml index 6267e2c13434f..673b071ef221d 100644 --- a/recipes/libmaxminddb/all/conandata.yml +++ b/recipes/libmaxminddb/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.10.0": + url: "https://github.com/maxmind/libmaxminddb/releases/download/1.10.0/libmaxminddb-1.10.0.tar.gz" + sha256: "5e6db72df423ae225bfe8897069f6def40faa8931f456b99d79b8b4d664c6671" "1.9.1": url: "https://github.com/maxmind/libmaxminddb/releases/download/1.9.1/libmaxminddb-1.9.1.tar.gz" sha256: "a80682a89d915fdf60b35d316232fb04ebf36fff27fda9bd39fe8a38d3cd3f12" diff --git a/recipes/libmaxminddb/all/conanfile.py b/recipes/libmaxminddb/all/conanfile.py index 7afd56f70e087..866a4b5b085e7 100644 --- a/recipes/libmaxminddb/all/conanfile.py +++ b/recipes/libmaxminddb/all/conanfile.py @@ -1,9 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibmaxminddbConan(ConanFile): name = "libmaxminddb" @@ -13,13 +14,16 @@ class LibmaxminddbConan(ConanFile): homepage = "http://maxmind.github.io/libmaxminddb/" topics = ("maxmind", "geoip") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], + "with_binaries": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_binaries": True, } def export_sources(self): @@ -28,21 +32,14 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "1.10.0": + del self.options.with_binaries 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.libcxx") + self.settings.rm_safe("compiler.cppstd") def layout(self): cmake_layout(self, src_folder="src") @@ -54,6 +51,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False + if "with_binaries" in self.options: + tc.variables["MAXMINDDB_BUILD_BINARIES"] = self.options.with_binaries # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() @@ -79,9 +78,8 @@ def package_info(self): if self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32"] - if self.settings.os != "Windows": + if self.settings.os != "Windows" and self.options.get_safe("with_binaries", True): bin_path = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) # TODO: to remove in conan v2 once cmake_find_package_* generators removed diff --git a/recipes/libmaxminddb/config.yml b/recipes/libmaxminddb/config.yml index 0a05d03a9c3a0..4c7c42eea0733 100644 --- a/recipes/libmaxminddb/config.yml +++ b/recipes/libmaxminddb/config.yml @@ -1,4 +1,6 @@ versions: + "1.10.0": + folder: all "1.9.1": folder: all "1.8.0": diff --git a/recipes/libmd/all/conandata.yml b/recipes/libmd/all/conandata.yml new file mode 100644 index 0000000000000..6433755dc3365 --- /dev/null +++ b/recipes/libmd/all/conandata.yml @@ -0,0 +1,6 @@ +sources: + "1.1.0": + url: + - "https://libbsd.freedesktop.org/releases/libmd-1.1.0.tar.xz" + - "https://archive.hadrons.org/software/libmd/libmd-1.1.0.tar.xz" + sha256: "1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332" diff --git a/recipes/libmd/all/conanfile.py b/recipes/libmd/all/conanfile.py new file mode 100644 index 0000000000000..b7ad5096688cd --- /dev/null +++ b/recipes/libmd/all/conanfile.py @@ -0,0 +1,114 @@ +import os + +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 chdir, rename, copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path + +required_conan_version = ">=1.53.0" + + +class LibMDConan(ConanFile): + name = "libmd" + description = "Message Digest functions from BSD systems" + license = "BSD-2-Clause AND BSD-3-Clause AND ISC AND Beerware AND DocumentRef-COPYING:LicenseRef-libmd-Public-Domain" + homepage = "https://gitlab.freedesktop.org/libbsd/libmd" + url = "https://github.com/conan-io/conan-center-index" + topics = ("message-digest", "hash", "bsd", + "md2", "md4", "md5", "ripemd", "rmd160", + "sha", "sha1", "sha2", "sha256", "sha512") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def 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 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 generate(self): + venv = VirtualBuildEnv(self) + venv.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.generate() + + if is_msvc(self): + env = Environment() + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} lib") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_msvc") + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + if self.settings.os == "Windows" and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "md.dll.lib"), + os.path.join(self.package_folder, "lib", "md-0.lib")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libmd") + + if self.settings.os == "Windows" and self.options.shared: + lib = "md-0" + else: + lib = "md" + self.cpp_info.libs = [lib] diff --git a/recipes/libmd/all/test_package/CMakeLists.txt b/recipes/libmd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6bdd5550a5b87 --- /dev/null +++ b/recipes/libmd/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package C) + +find_package(libmd REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmd::libmd) diff --git a/recipes/libmd/all/test_package/conanfile.py b/recipes/libmd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0f2d20bbcb70a --- /dev/null +++ b/recipes/libmd/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libmd/all/test_package/test_package.c b/recipes/libmd/all/test_package/test_package.c new file mode 100644 index 0000000000000..a7d2d1ef0b245 --- /dev/null +++ b/recipes/libmd/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include + +int main() { + const char data[] = "12345"; + uint8_t hash[MD5_DIGEST_LENGTH]; + MD5_CTX md5_ctx; + MD5Init(&md5_ctx); + MD5Update(&md5_ctx, (const uint8_t *)data, strlen(data)); + MD5Final(hash, &md5_ctx); + return 0; +} diff --git a/recipes/libmd/config.yml b/recipes/libmd/config.yml new file mode 100644 index 0000000000000..11b7aff3a5ac4 --- /dev/null +++ b/recipes/libmd/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: "all" diff --git a/recipes/libmediainfo/all/test_package/conanfile.py b/recipes/libmediainfo/all/test_package/conanfile.py index a518ea1284361..181c93b2a88a0 100644 --- a/recipes/libmediainfo/all/test_package/conanfile.py +++ b/recipes/libmediainfo/all/test_package/conanfile.py @@ -31,5 +31,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - testsrc = os.path.join(self.source_folder, "testsrc.mp4") - self.run(f"{bin_path} {testsrc}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/libmediainfo/all/test_package/test_package.cpp b/recipes/libmediainfo/all/test_package/test_package.cpp index d4de9d263a0bc..5aa26cc3025e5 100644 --- a/recipes/libmediainfo/all/test_package/test_package.cpp +++ b/recipes/libmediainfo/all/test_package/test_package.cpp @@ -10,22 +10,18 @@ #include int main(int argc, const char *argv[]) { - if (argc < 2) { - std::cerr << "Need at least one argument\n"; - return 1; - } MEDIAINFO_NS::MediaInfo mediainfo; #if defined(LIBMEDIAINFO_SHARED) std::cout << "Is MediaInfo ready? " << mediainfo.IsReady() << "\n"; #endif - ZenLib::Ztring videofile(argv[1]); - size_t opened = mediainfo.Open(videofile.To_Unicode()); - if (!opened) { - std::cerr << "Open failed\n"; - return 1; - } + std::string fakeVideoData = "FAKE DATA FOR TESTING\n"; + + mediainfo.Open_Buffer_Init(fakeVideoData.size(), 0); + mediainfo.Open_Buffer_Continue((unsigned char*)fakeVideoData.data(), fakeVideoData.size()); + mediainfo.Open_Buffer_Finalize(); + MEDIAINFO_NS::String info = mediainfo.Inform(); #ifdef UNICODE std::wcout << info; diff --git a/recipes/libmediainfo/all/test_package/testsrc.mp4 b/recipes/libmediainfo/all/test_package/testsrc.mp4 deleted file mode 100644 index 7e12ea126587e..0000000000000 Binary files a/recipes/libmediainfo/all/test_package/testsrc.mp4 and /dev/null differ diff --git a/recipes/libmediainfo/all/test_v1_package/conanfile.py b/recipes/libmediainfo/all/test_v1_package/conanfile.py index f87f616cc28bd..c3c864d919d33 100644 --- a/recipes/libmediainfo/all/test_v1_package/conanfile.py +++ b/recipes/libmediainfo/all/test_v1_package/conanfile.py @@ -15,5 +15,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - testsrc = os.path.join(self.source_folder, os.pardir, "test_package", "testsrc.mp4") - self.run(f"{bin_path} {testsrc}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/libmetalink/all/conanfile.py b/recipes/libmetalink/all/conanfile.py index 10c23cc875879..57b9b280bec17 100644 --- a/recipes/libmetalink/all/conanfile.py +++ b/recipes/libmetalink/all/conanfile.py @@ -53,9 +53,9 @@ def layout(self): def requirements(self): if self.options.xml_backend == "expat": - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") elif self.options.xml_backend == "libxml2": - self.requires("libxml2/2.12.3") + self.requires("libxml2/[>=2.12.5 <3]") def validate(self): if is_msvc(self): diff --git a/recipes/libnghttp2/all/conandata.yml b/recipes/libnghttp2/all/conandata.yml index 66dd4333f96a2..c95a58d3fe33d 100644 --- a/recipes/libnghttp2/all/conandata.yml +++ b/recipes/libnghttp2/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.61.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.61.0/nghttp2-1.61.0.tar.bz2" + sha256: "4e8cf7ec32d4c5a430966242d72035d255cd9470a8766d61eed7a0190dd544fd" + "1.60.0": + url: "https://github.com/nghttp2/nghttp2/archive/v1.60.0.tar.gz" + sha256: "3cc9403c64e0a133868f62132ff0884cd5dc567eee5bd7b2d03ac81293695d6b" "1.59.0": url: "https://github.com/nghttp2/nghttp2/archive/v1.59.0.tar.gz" sha256: "0dd5c980f1262ff5f03676fd99f46f250b66c842f7d864fa1ca9f8453e5f8868" diff --git a/recipes/libnghttp2/all/conanfile.py b/recipes/libnghttp2/all/conanfile.py index 7e54ec938b2f3..8fa456dd4d783 100644 --- a/recipes/libnghttp2/all/conanfile.py +++ b/recipes/libnghttp2/all/conanfile.py @@ -83,8 +83,11 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["ENABLE_SHARED_LIB"] = self.options.shared - tc.variables["ENABLE_STATIC_LIB"] = not self.options.shared + if Version(self.version) < "1.60.0": + tc.variables["ENABLE_SHARED_LIB"] = self.options.shared + tc.variables["ENABLE_STATIC_LIB"] = not self.options.shared + else: + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared tc.variables["ENABLE_HPACK_TOOLS"] = self.options.with_hpack tc.variables["ENABLE_APP"] = self.options.with_app tc.variables["ENABLE_EXAMPLES"] = False @@ -96,6 +99,9 @@ def generate(self): tc.variables["WITH_JEMALLOC"] = self.options.get_safe("with_jemalloc", False) if Version(self.version) < "1.52.0": tc.variables["ENABLE_ASIO_LIB"] = self.options.with_asio + # To avoid overwriting dll import lib by static lib + if Version(self.version) >= "1.60.0" and self.options.shared: + tc.variables["STATIC_LIB_SUFFIX"] = "-static" if is_apple_os(self): # workaround for: install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False @@ -107,7 +113,7 @@ def generate(self): tc.generate() def _patch_sources(self): - if not self.options.shared: + if not self.options.shared and Version(self.version) < "1.60.0": # easier to patch here rather than have patch 'nghttp_static_include_directories' for each version save(self, os.path.join(self.source_folder, "lib", "CMakeLists.txt"), "target_include_directories(nghttp2_static INTERFACE\n" @@ -135,6 +141,8 @@ def _patch_sources(self): "\n" " target_link_libraries(nghttp2_asio\n" f" {target_libnghttp2}\n") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(examples)", "") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(tests)", "") def build(self): self._patch_sources() @@ -148,6 +156,7 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.components["nghttp2"].set_property("pkg_config_name", "libnghttp2") diff --git a/recipes/libnghttp2/config.yml b/recipes/libnghttp2/config.yml index 3479f13f33830..99922e9441daf 100644 --- a/recipes/libnghttp2/config.yml +++ b/recipes/libnghttp2/config.yml @@ -1,4 +1,8 @@ versions: + "1.61.0": + folder: all + "1.60.0": + folder: all "1.59.0": folder: all "1.58.0": diff --git a/recipes/libpcap/all/conanfile.py b/recipes/libpcap/all/conanfile.py index f8f592dda7427..10fbd7a3b7b60 100644 --- a/recipes/libpcap/all/conanfile.py +++ b/recipes/libpcap/all/conanfile.py @@ -29,11 +29,13 @@ class LibPcapConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "enable_libusb": [True, False], + "with_snf": [True, False], } default_options = { "shared": False, "fPIC": True, "enable_libusb": False, + "with_snf": False, } # TODO: Add dbus-glib when available @@ -114,7 +116,9 @@ def generate(self): "--disable-packet-ring", "--disable-dbus", "--disable-rdma", + f"--with-snf={yes_no(self.options.get_safe('with_snf'))}", ]) + if cross_building(self): target_os = "linux" if self.settings.os == "Linux" else "null" tc.configure_args.append(f"--with-pcap={target_os}") @@ -171,3 +175,5 @@ def package_info(self): self.cpp_info.libs = [f"pcap{suffix}"] if self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32"] + if self.options.get_safe("with_snf"): + self.cpp_info.system_libs.append("snf") diff --git a/recipes/libpq/all/conandata.yml b/recipes/libpq/all/conandata.yml index 58acf20d0817e..bad003ca4bd76 100644 --- a/recipes/libpq/all/conandata.yml +++ b/recipes/libpq/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "15.5": + url: "https://ftp.postgresql.org/pub/source/v15.5/postgresql-15.5.tar.bz2" + sha256: "8f53aa95d78eb8e82536ea46b68187793b42bba3b4f65aa342f540b23c9b10a6" "15.4": url: "https://ftp.postgresql.org/pub/source/v15.4/postgresql-15.4.tar.bz2" sha256: "baec5a4bdc4437336653b6cb5d9ed89be5bd5c0c58b94e0becee0a999e63c8f9" @@ -24,6 +27,10 @@ sources: url: "https://ftp.postgresql.org/pub/source/v9.6.24/postgresql-9.6.24.tar.gz" sha256: "52947ecc119846eace5164399d173576c0d4a47ec116ae58a46a8fd0c576c7c3" patches: + "15.5": + - patch_file: "patches/15/001-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" "15.4": - patch_file: "patches/15/001-mingw-build-static-libraries.patch" patch_description: "port MinGW: Enable building static libraries in MinGW." diff --git a/recipes/libpq/all/conanfile.py b/recipes/libpq/all/conanfile.py index 53f51b549f74e..3980215f4b1d7 100644 --- a/recipes/libpq/all/conanfile.py +++ b/recipes/libpq/all/conanfile.py @@ -164,6 +164,13 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "src", "interfaces", "libpq", "Makefile"), "ifeq ($(enable_thread_safety), yes)\nOBJS += pthread-win32.o\nendif", "") + # When linking to static openssl, it comes with static pthread library too, failing with: + # libpq.so.5.15: U pthread_exit@GLIBC_2.2.5: libpq must not be calling any function which invokes exit + # https://www.postgresql.org/message-id/20210703001639.GB2374652%40rfd.leadboat.com + if Version(self.version) >= "15": + replace_in_file(self, os.path.join(self.source_folder, "src", "interfaces", "libpq", "Makefile"), + "-v __cxa_atexit", + "-v __cxa_atexit -e pthread_exit") def build(self): apply_conandata_patches(self) diff --git a/recipes/libpq/config.yml b/recipes/libpq/config.yml index e010db029229d..d16e671201aae 100644 --- a/recipes/libpq/config.yml +++ b/recipes/libpq/config.yml @@ -1,4 +1,6 @@ versions: + "15.5": + folder: all "15.4": folder: all "15.3": diff --git a/recipes/libpqxx/all/conandata.yml b/recipes/libpqxx/all/conandata.yml index 4d1617ceb885b..0a09eba2c892d 100644 --- a/recipes/libpqxx/all/conandata.yml +++ b/recipes/libpqxx/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "7.9.1": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.9.1.tar.gz" + sha256: "4fafd63009b1d6c2b64b8c184c04ae4d1f7aa99d8585154832d28012bae5b0b6" "7.9.0": url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.9.0.tar.gz" sha256: "a1fafd5f6455f6c66241fca1f35f5cb603251580b99f9a0cf1b5d0a586006f16" @@ -27,6 +30,10 @@ sources: url: "https://github.com/jtv/libpqxx/archive/6.4.8.tar.gz" sha256: "3f7aba951822e01f1b9f9f353702954773323dd9f9dc376ffb57cb6bbd9a7a2f" patches: + "7.9.1": + - patch_file: "patches/0001-cmake-fix-module.patch" + patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." + patch_type: "conan" "7.9.0": - patch_file: "patches/0001-cmake-fix-module.patch" patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." diff --git a/recipes/libpqxx/config.yml b/recipes/libpqxx/config.yml index 4c8b35797bd1a..f6402ea576565 100644 --- a/recipes/libpqxx/config.yml +++ b/recipes/libpqxx/config.yml @@ -1,4 +1,6 @@ versions: + "7.9.1": + folder: all "7.9.0": folder: all "7.8.1": diff --git a/recipes/libprotobuf-mutator/all/CMakeLists.txt b/recipes/libprotobuf-mutator/all/CMakeLists.txt index 694038520f556..54f184da6c63a 100644 --- a/recipes/libprotobuf-mutator/all/CMakeLists.txt +++ b/recipes/libprotobuf-mutator/all/CMakeLists.txt @@ -1,13 +1,9 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) +cmake_minimum_required(VERSION 3.15) +project(cmake_wrapper CXX) -include(conanbuildinfo.cmake) -conan_basic_setup() +find_package(Protobuf REQUIRED) +find_package(absl CONFIG REQUIRED) -add_subdirectory(source_subfolder) +add_subdirectory(src) -if(MSVC) - # Should be added because of - # https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-initonceexecuteonce - add_definitions(-D_WIN32_WINNT=0x0600) -endif() +target_link_libraries(protobuf-mutator PUBLIC protobuf::libprotobuf absl::strings) diff --git a/recipes/libprotobuf-mutator/all/conandata.yml b/recipes/libprotobuf-mutator/all/conandata.yml index 813688d3f74a5..1152bb8579584 100644 --- a/recipes/libprotobuf-mutator/all/conandata.yml +++ b/recipes/libprotobuf-mutator/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "cci.20210831": - url: "https://github.com/google/libprotobuf-mutator/archive/ffd86a32874e5c08a143019aad1aaf0907294c9f.zip" - sha256: "14f595863452808483776ce1964209db00cdac79e649b31eb4d4b06ca72912d8" + "1.3": + url: "https://github.com/google/libprotobuf-mutator/archive/refs/tags/v1.3.tar.gz" + sha256: "1ee3473a6b0274494fce599539605bb19305c0efadc62b58d645812132c31baa" diff --git a/recipes/libprotobuf-mutator/all/conanfile.py b/recipes/libprotobuf-mutator/all/conanfile.py index f0419a2397845..b03de6dbf5696 100644 --- a/recipes/libprotobuf-mutator/all/conanfile.py +++ b/recipes/libprotobuf-mutator/all/conanfile.py @@ -1,8 +1,14 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +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, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.env import VirtualBuildEnv +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.54.0" class LibProtobufMutatorConan(ConanFile): @@ -13,76 +19,117 @@ class LibProtobufMutatorConan(ConanFile): description = "A library to randomly mutate protobuffers." topics = ("test", "fuzzing", "protobuf") settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - exports_sources = ["CMakeLists.txt"] - - _cmake = None + package_type = "library" + 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 14 @property - def _build_subfolder(self): - return "build_subfolder" + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "7", + "gcc": "5", + "msvc": "191", + "Visual Studio": "15", + } + + 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": + del self.options.fPIC + + def configure(self): + if self.options.get_safe("shared"): + self.options.rm_safe("fPIC") + if is_msvc(self): + self.options.rm_safe("shared") + self.package_type = "static-library" + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("protobuf/3.17.1") - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + # Protobuf headers are required by public src/binary_format.h and + self.requires("protobuf/4.25.3", transitive_headers=True) + # Abseil headers are required by public src/field_instance.h + self.requires("abseil/20240116.2") def validate(self): - if self.settings.compiler != "clang": - raise ConanInvalidConfiguration("Only clang allowed") - if self.settings.compiler.libcxx != "libstdc++11": - raise ConanInvalidConfiguration("Requires either compiler.libcxx=libstdc++11") if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.24 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def _patch_sources(self): - tools.replace_in_file( - os.path.join(self._source_subfolder, 'CMakeLists.txt'), - """include_directories(${PROTOBUF_INCLUDE_DIRS})""", - """include_directories(${protobuf_INCLUDE_DIRS})""") - tools.replace_in_file( - os.path.join(self._source_subfolder, 'CMakeLists.txt'), - """set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/external)""", - """# (disabled by conan) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/external)""") - tools.replace_in_file( - os.path.join(self._source_subfolder, 'CMakeLists.txt'), - """add_subdirectory(examples EXCLUDE_FROM_ALL)""", - """# (disabled by conan) add_subdirectory(examples EXCLUDE_FROM_ALL)""") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - - self._cmake = CMake(self) - self._cmake.definitions["LIB_PROTO_MUTATOR_TESTING"] = "OFF" - self._cmake.definitions["LIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF"] = "OFF" - self._cmake.definitions["LIB_PROTO_MUTATOR_WITH_ASAN"] = "OFF" - self._cmake.definitions["LIB_PROTO_MUTATOR_FUZZER_LIBRARIES"] = "" - # todo: check option(LIB_PROTO_MUTATOR_MSVC_STATIC_RUNTIME "Link static runtime libraries" ON) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + # Preserves Conan as dependency manager + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/external)", + "", + ) + # Fix libprotobuf-mutator.pc installation origin path + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "${CMAKE_BINARY_DIR}/libprotobuf-mutator.pc", + "${CMAKE_CURRENT_BINARY_DIR}/libprotobuf-mutator.pc", + ) + # Do not include examples when running CMake configure to avoid more dependencies + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "add_subdirectory(examples EXCLUDE_FROM_ALL)", + "", + ) + + def generate(self): + tc = VirtualBuildEnv(self) + tc.generate() + tc = CMakeToolchain(self) + tc.variables["LIB_PROTO_MUTATOR_TESTING"] = False + tc.variables["LIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF"] = False + tc.variables["LIB_PROTO_MUTATOR_WITH_ASAN"] = False + tc.variables["PKG_CONFIG_PATH"] = "share" + if is_msvc(self): + tc.variables["LIB_PROTO_MUTATOR_MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, pattern="LICENSE", 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, "OFF")) - tools.rmdir(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, "lib", "cmake")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "libprotobuf-mutator" - self.cpp_info.names["cmake_find_package_multi"] = "libprotobuf-mutator" - - self.cpp_info.libs = ['protobuf-mutator-libfuzzer', 'protobuf-mutator'] - self.cpp_info.includedirs.append(os.path.join("include", "libprotobuf-mutator")) + self.cpp_info.components["mutator"].libs = ["protobuf-mutator"] + self.cpp_info.components["mutator"].set_property("cmake_target_name", "libprotobuf-mutator::protobuf-mutator") + self.cpp_info.components["mutator"].includedirs.append("include/libprotobuf-mutator") + self.cpp_info.components["mutator"].requires = ["protobuf::libprotobuf", "abseil::absl_strings"] + + self.cpp_info.components["fuzzer"].libs = ['protobuf-mutator-libfuzzer'] + self.cpp_info.components["fuzzer"].set_property("cmake_target_name", "libprotobuf-mutator::protobuf-mutator-libfuzzer") + self.cpp_info.components["fuzzer"].includedirs.append("include/libprotobuf-mutator") + self.cpp_info.components["fuzzer"].requires = ["mutator", "protobuf::libprotobuf"] diff --git a/recipes/libprotobuf-mutator/all/test_package/CMakeLists.txt b/recipes/libprotobuf-mutator/all/test_package/CMakeLists.txt index 00520b9489805..70a0e97ac972f 100644 --- a/recipes/libprotobuf-mutator/all/test_package/CMakeLists.txt +++ b/recipes/libprotobuf-mutator/all/test_package/CMakeLists.txt @@ -1,19 +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(TARGETS) find_package(libprotobuf-mutator REQUIRED CONFIG) - -protobuf_generate_cpp( - MSG_PROTO_SRCS - MSG_PROTO_HDRS - msg.proto -) - - -add_executable(${PROJECT_NAME} ${MSG_PROTO_SRCS} test_package.cpp) -target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries(${PROJECT_NAME} libprotobuf-mutator::libprotobuf-mutator) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libprotobuf-mutator::protobuf-mutator libprotobuf-mutator::protobuf-mutator-libfuzzer) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/libprotobuf-mutator/all/test_package/conanfile.py b/recipes/libprotobuf-mutator/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/libprotobuf-mutator/all/test_package/conanfile.py +++ b/recipes/libprotobuf-mutator/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/libprotobuf-mutator/all/test_package/msg.proto b/recipes/libprotobuf-mutator/all/test_package/msg.proto deleted file mode 100644 index cb25c9d008352..0000000000000 --- a/recipes/libprotobuf-mutator/all/test_package/msg.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto2"; -package libfuzzer_example; - -import "google/protobuf/any.proto"; - -message Msg { - optional float optional_float = 1; - optional uint64 optional_uint64 = 2; - optional string optional_string = 3; - optional google.protobuf.Any any = 4; -} diff --git a/recipes/libprotobuf-mutator/all/test_package/test_package.cpp b/recipes/libprotobuf-mutator/all/test_package/test_package.cpp index c169f66031176..f7273ed21de60 100644 --- a/recipes/libprotobuf-mutator/all/test_package/test_package.cpp +++ b/recipes/libprotobuf-mutator/all/test_package/test_package.cpp @@ -1,23 +1,11 @@ -#include -#include +#include -#include "msg.pb.h" -#include +#include -DEFINE_PROTO_FUZZER(const libfuzzer_example::Msg& message) { - protobuf_mutator::protobuf::FileDescriptorProto file; - - // Emulate a bug. - if (message.optional_uint64() == std::hash{}(message.optional_string()) && - message.optional_string() == "abcdefghijklmnopqrstuvwxyz" && - !std::isnan(message.optional_float()) && - std::fabs(message.optional_float()) > 1000 && - message.any().UnpackTo(&file) && !file.name().empty()) - { - std::cerr << message.DebugString() << "\n"; - } -} int main() { - return 0; + protobuf_mutator::Mutator mutator{}; + const auto seed_value{42}; + mutator.Seed(seed_value); + return EXIT_SUCCESS; } diff --git a/recipes/libprotobuf-mutator/config.yml b/recipes/libprotobuf-mutator/config.yml index 9d5b0e4c50569..d2eb4ed4a511f 100644 --- a/recipes/libprotobuf-mutator/config.yml +++ b/recipes/libprotobuf-mutator/config.yml @@ -1,3 +1,3 @@ versions: - "cci.20210831": + "1.3": folder: all diff --git a/recipes/libqasm/all/conandata.yml b/recipes/libqasm/all/conandata.yml new file mode 100644 index 0000000000000..8ef190015c47b --- /dev/null +++ b/recipes/libqasm/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.6.6": + url: "https://github.com/QuTech-Delft/libqasm/archive/refs/tags/0.6.6.tar.gz" + sha256: "b3a2d1670f8865ce22bcc62c6a696ee7e0764a7b76901a4f082efa2287e0cbad" + "0.6.5": + url: "https://github.com/QuTech-Delft/libqasm/archive/refs/tags/0.6.5.tar.gz" + sha256: "0577622a512d1f64892949af02abe3d0b53195ad454045715a0ebf837ecde0d6" diff --git a/recipes/libqasm/all/conanfile.py b/recipes/libqasm/all/conanfile.py new file mode 100644 index 0000000000000..4eeedc606ece2 --- /dev/null +++ b/recipes/libqasm/all/conanfile.py @@ -0,0 +1,127 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rm, replace_in_file +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.60.0 <2 || >=2.0.6" + + +class LibqasmConan(ConanFile): + name = "libqasm" + license = "Apache-2.0" + homepage = "https://github.com/QuTech-Delft/libqasm" + url = "https://github.com/conan-io/conan-center-index" + description = "Library to parse cQASM files" + topics = ("code generation", "parser", "compiler", "quantum compilation", "quantum simulation") + settings = "os", "compiler", "build_type", "arch" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_python": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "build_python": False + } + + @property + def _should_build_test(self): + return not self.conf.get("tools.build:skip_test", default=True, check_type=bool) + + @property + def _min_cppstd(self): + return "20" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "10", + "clang": "13", + "apple-clang": "14", + "Visual Studio": "16", + "msvc": "192" + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if self.settings.arch == "wasm": + self.options["antlr4-cppruntime"].shared = self.options.shared + + def layout(self): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("tree-gen/") + self.tool_requires("zulu-openjdk/21.0.1") + if self.settings.arch == "wasm": + self.tool_requires("emsdk/3.1.50") + if self._should_build_test: + self.test_requires("gtest/1.14.0") + if self.options.build_python: + self.tool_requires("cpython/3.12.2") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}," + f"which your compiler does not support.") + + if self.settings.arch != "wasm" and self.dependencies["antlr4-cppruntime"].options.shared != self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} requires antlr4-cppruntime to be built with the same shared option value.") + + def requirements(self): + self.requires("fmt/10.2.1", transitive_headers=True) + self.requires("range-v3/0.12.0", transitive_headers=True) + self.requires("tree-gen/1.0.7", transitive_headers=True, transitive_libs=True) + if not self.settings.arch == "wasm": + self.requires("antlr4-cppruntime/4.13.1", transitive_headers=True) + + 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["LIBQASM_BUILD_PYTHON"] = self.options.build_python + tc.variables["LIBQASM_BUILD_TESTS"] = self._should_build_test + tc.generate() + env = VirtualBuildEnv(self) + env.generate() + + def _patch_sources(self): + werror = "/WX" if is_msvc(self) else "-Werror" + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), werror, "") + replace_in_file(self, os.path.join(self.source_folder, "test", "CMakeLists.txt"), werror, "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + fix_apple_shared_install_name(self) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.libs = ["cqasm"] diff --git a/recipes/libqasm/all/test_package/CMakeLists.txt b/recipes/libqasm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..528ff39eb1365 --- /dev/null +++ b/recipes/libqasm/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +find_package(libqasm REQUIRED CONFIG) + +add_executable(test_package "${CMAKE_CURRENT_SOURCE_DIR}/src/test_package.cpp") +target_compile_features(test_package PRIVATE cxx_std_20) +target_link_libraries(test_package PRIVATE libqasm::libqasm) diff --git a/recipes/libqasm/all/test_package/conanfile.py b/recipes/libqasm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6ad8a48ce8086 --- /dev/null +++ b/recipes/libqasm/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + 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 can_run(self): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/libqasm/all/test_package/src/test_package.cpp b/recipes/libqasm/all/test_package/src/test_package.cpp new file mode 100644 index 0000000000000..d961b8daa4a16 --- /dev/null +++ b/recipes/libqasm/all/test_package/src/test_package.cpp @@ -0,0 +1,10 @@ +#include "cqasm.hpp" + +#include + + +int main() { + auto analyzer = cqasm::v3x::default_analyzer(); + auto result = analyzer.analyze_string("version 3.0; qubit[2] q; H q[0]; CNOT q[0], q[1]; measure q", ""); + std::cout << result.to_json(); +} diff --git a/recipes/libqasm/config.yml b/recipes/libqasm/config.yml new file mode 100644 index 0000000000000..9948b2cad2840 --- /dev/null +++ b/recipes/libqasm/config.yml @@ -0,0 +1,5 @@ +versions: + "0.6.6": + folder: all + "0.6.5": + folder: all diff --git a/recipes/librdkafka/all/conandata.yml b/recipes/librdkafka/all/conandata.yml index bf7c468b0c4c1..5b70b2f07d19f 100644 --- a/recipes/librdkafka/all/conandata.yml +++ b/recipes/librdkafka/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.0": + url: "https://github.com/edenhill/librdkafka/archive/v2.4.0.tar.gz" + sha256: "d645e47d961db47f1ead29652606a502bdd2a880c85c1e060e94eea040f1a19a" "2.3.0": url: "https://github.com/edenhill/librdkafka/archive/v2.3.0.tar.gz" sha256: "2d49c35c77eeb3d42fa61c43757fcbb6a206daa560247154e60642bcdcc14d12" @@ -12,6 +15,13 @@ sources: url: "https://github.com/edenhill/librdkafka/archive/v1.9.2.tar.gz" sha256: "3fba157a9f80a0889c982acdd44608be8a46142270a389008b22d921be1198ad" patches: + "2.4.0": + - patch_file: patches/0001-Change-library-names-1-9-1.patch + patch_description: "find_package conan packages" + patch_type: "conan" + - patch_file: patches/0002-Change-library-targets-and-result-variables-2-3-0.patch + patch_description: "refer conan package names" + patch_type: "conan" "2.3.0": - patch_file: patches/0001-Change-library-names-1-9-1.patch patch_description: "find_package conan packages" diff --git a/recipes/librdkafka/all/conanfile.py b/recipes/librdkafka/all/conanfile.py index cca10bb2c76c2..90bfc657a8ab8 100644 --- a/recipes/librdkafka/all/conanfile.py +++ b/recipes/librdkafka/all/conanfile.py @@ -1,8 +1,7 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file -from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.gnu import PkgConfigDeps import os @@ -110,11 +109,6 @@ def generate(self): def build(self): apply_conandata_patches(self) - # There are references to libcrypto.lib and libssl.lib in rdkafka_ssl.c for versions >= 1.8.0 - if is_msvc(self) and self.settings.build_type == "Debug" and self.options.get_safe("ssl", False): - rdkafka_ssl_path = os.path.join(self.source_folder, "src", "rdkafka_ssl.c") - replace_in_file(self, rdkafka_ssl_path, "libcrypto.lib", "libcryptod.lib") - replace_in_file(self, rdkafka_ssl_path, "libssl.lib", "libssld.lib") cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/librdkafka/config.yml b/recipes/librdkafka/config.yml index edafdb9b6c2ac..d9d5e85da2bcf 100644 --- a/recipes/librdkafka/config.yml +++ b/recipes/librdkafka/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.0": + folder: all "2.3.0": folder: all "2.2.0": diff --git a/recipes/libressl/all/conandata.yml b/recipes/libressl/all/conandata.yml index 8d70158fca32f..c4fc1016c6f77 100644 --- a/recipes/libressl/all/conandata.yml +++ b/recipes/libressl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.9.1": + url: "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.9.1.tar.gz" + sha256: "6da0b954695f7ee62b03f64200a8a4f02af93717b60cce04ab6c8df262c07a51" "3.5.3": url: "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.5.3.tar.gz" sha256: "3ab5e5eaef69ce20c6b170ee64d785b42235f48f2e62b095fca5d7b6672b8b28" diff --git a/recipes/libressl/all/conanfile.py b/recipes/libressl/all/conanfile.py index 83b9b2abeb131..01fe7dba222cd 100644 --- a/recipes/libressl/all/conanfile.py +++ b/recipes/libressl/all/conanfile.py @@ -88,6 +88,7 @@ def package(self): cmake.install() rm(self, "*.cmake", os.path.join(self.package_folder, "include")) rmdir(self, os.path.join(self.package_folder, "include", "CMakeFiles")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) diff --git a/recipes/libressl/config.yml b/recipes/libressl/config.yml index bfca6d19b58d7..10de737dfb8f5 100644 --- a/recipes/libressl/config.yml +++ b/recipes/libressl/config.yml @@ -1,4 +1,6 @@ versions: + "3.9.1": + folder: all "3.5.3": folder: all "3.5.2": diff --git a/recipes/librhash/all/CMakeLists.txt b/recipes/librhash/all/CMakeLists.txt new file mode 100644 index 0000000000000..5a8989c04fb68 --- /dev/null +++ b/recipes/librhash/all/CMakeLists.txt @@ -0,0 +1,48 @@ +# Based on https://github.com/rhash/RHash/pull/103 +cmake_minimum_required(VERSION 3.15) +project(rhash LANGUAGES C) + +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../version.h" versionfile) +string(REGEX MATCH "#define VERSION \"([0-9]*)\.([0-9]*)\.([0-9]*)\"" _ ${versionfile}) +set(RHASH_VERSION_MAJOR ${CMAKE_MATCH_1}) +set(RHASH_VERSION_MINOR ${CMAKE_MATCH_2}) +set(RHASH_VERSION_PATCH ${CMAKE_MATCH_3}) +set(RHASH_VERSION "${RHASH_VERSION_MAJOR}.${RHASH_VERSION_MINOR}.${RHASH_VERSION_PATCH}") + +option(USE_OPENSSL "Enable OpenSSL (optimized hash functions) support" ON) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + +# Get the list of source files from the Makefile +# https://github.com/rhash/RHash/blob/v1.4.4/librhash/Makefile#L6 +file(READ Makefile MAKEFILE_CONTENTS) +if("${MAKEFILE_CONTENTS}" MATCHES "SOURCES *= *([^\n]+)") + string(REPLACE " " ";" SOURCE_FILES ${CMAKE_MATCH_1}) +else() + message(FATAL_ERROR "SOURCES line not found in Makefile") +endif() + +add_library(rhash ${SOURCE_FILES}) + +if(USE_OPENSSL) + find_package(OpenSSL REQUIRED) + target_link_libraries(rhash OpenSSL::Crypto) + target_compile_definitions(rhash PUBLIC USE_OPENSSL) +endif() + +if(MSVC) + target_compile_definitions(rhash PRIVATE _CRT_SECURE_NO_DEPRECATE) +endif() + +set_target_properties(rhash PROPERTIES + COMPILE_DEFINITIONS IN_RHASH + DEFINE_SYMBOL RHASH_EXPORTS + VERSION ${RHASH_VERSION} + SOVERSION ${RHASH_VERSION_MAJOR}) + +install(TARGETS rhash + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +install(FILES "rhash.h" "rhash_torrent.h" DESTINATION include) diff --git a/recipes/librhash/all/conandata.yml b/recipes/librhash/all/conandata.yml index 7551a33f27039..86c6f3d9822c3 100644 --- a/recipes/librhash/all/conandata.yml +++ b/recipes/librhash/all/conandata.yml @@ -1,11 +1,10 @@ sources: + "1.4.4": + url: "https://downloads.sourceforge.net/project/rhash/rhash/1.4.4/rhash-1.4.4-src.tar.gz" + sha256: "8e7d1a8ccac0143c8fe9b68ebac67d485df119ea17a613f4038cda52f84ef52a" "1.4.2": url: "https://downloads.sourceforge.net/project/rhash/rhash/1.4.2/rhash-1.4.2-src.tar.gz" sha256: "600d00f5f91ef04194d50903d3c79412099328c42f28ff43a0bdb777b00bec62" "1.3.9": url: "https://downloads.sourceforge.net/project/rhash/rhash/1.3.9/rhash-1.3.9-src.tar.gz" sha256: "42b1006f998adb189b1f316bf1a60e3171da047a85c4aaded2d0d26c1476c9f6" -patches: - "1.4.2": - - patch_file: "patches/0001-1.4.2-fix-compiler-detection.patch" - base_path: "source_subfolder" diff --git a/recipes/librhash/all/conanfile.py b/recipes/librhash/all/conanfile.py index 5528b9c183b00..a7af280fa7f51 100644 --- a/recipes/librhash/all/conanfile.py +++ b/recipes/librhash/all/conanfile.py @@ -1,17 +1,23 @@ -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.tools.cmake import CMakeToolchain, CMakeDeps, CMake +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" class LibRHashConan(ConanFile): name = "librhash" description = "Great utility for computing hash sums" - topics = ("rhash", "hash", "checksum") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "http://rhash.sourceforge.net/" - license = "MIT" + topics = ("rhash", "hash", "checksum") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,98 +30,64 @@ class LibRHashConan(ConanFile): "with_openssl": True, } - exports_sources = "patches/*" - _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): + copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src", "librhash")) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_openssl: - self.requires("openssl/1.1.1q") - - def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - - def validate(self): - if self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration("Visual Studio is not supported") + self.requires("openssl/[>=1.1 <4]") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - if self.settings.compiler in ("apple-clang", ): - if self.settings.arch in ("armv7", ): - self._autotools.link_flags.append("-arch armv7") - elif self.settings.arch in ("armv8", ): - self._autotools.link_flags.append("-arch arm64") - vars = self._autotools.vars - conf_args = [ - # librhash's configure script does not understand `--enable-opt1=yes` - "--enable-openssl" if self.options.with_openssl else "--disable-openssl", - "--disable-gettext", - # librhash's configure script is custom and does not understand "--bindir=${prefix}/bin" arguments - "--prefix={}".format(tools.unix_path(self.package_folder)), - "--bindir={}".format(tools.unix_path(os.path.join(self.package_folder, "bin"))), - "--libdir={}".format(tools.unix_path(os.path.join(self.package_folder, "lib"))), - # the configure script does not use CPPFLAGS, so add it to CFLAGS/CXXFLAGS - "--extra-cflags={}".format("{} {}".format(vars["CFLAGS"], vars["CPPFLAGS"])), - "--extra-ldflags={}".format(vars["LDFLAGS"]), - ] - if self.options.shared: - conf_args.extend(["--enable-lib-shared", "--disable-lib-static"]) - else: - conf_args.extend(["--disable-lib-shared", "--enable-lib-static"]) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - with tools.environment_append({ - "BUILD_TARGET": tools.get_gnu_triplet(str(self.settings.os), str(self.settings.arch), str(self.settings.compiler)), - }): - self._autotools.configure(args=conf_args, use_default_install_dirs=False, build=False, host=False) - return self._autotools + @property + def _xversion(self): + # https://github.com/rhash/RHash/blob/v1.4.4/configure#L339 + version = Version(self.version) + return f"0x{version.major.value:02x}{version.minor.value:02x}{version.patch.value:02x}{0:02x}" + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["USE_OPENSSL"] = self.options.with_openssl + tc.preprocessor_definitions["RHASH_XVERSION"] = self._xversion + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with tools.chdir(self._source_subfolder): - autotools = self._configure_autotools() - autotools.make() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "librhash")) + cmake.build() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with tools.chdir(self._source_subfolder): - autotools = self._configure_autotools() - autotools.install() - autotools.make(target="install-lib-headers") - with tools.chdir("librhash"): - if self.options.shared: - autotools.make(target="install-so-link") - tools.rmdir(os.path.join(self.package_folder, "bin")) - tools.rmdir(os.path.join(self.package_folder, "etc")) - tools.rmdir(os.path.join(self.package_folder, "share")) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() def package_info(self): + self.cpp_info.set_property("cmake_file_name", "LibRHash") + self.cpp_info.set_property("cmake_target_name", "LibRHash::LibRHash") + self.cpp_info.set_property("pkg_config_name", "librhash") + self.cpp_info.libs = ["rhash"] + self.cpp_info.defines.append(f"RHASH_XVERSION={self._xversion}") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "LibRHash" self.cpp_info.names["cmake_find_package_multi"] = "LibRHash" - self.cpp_info.names["pkg_config"] = "librhash" - self.cpp_info.libs = ["rhash"] diff --git a/recipes/librhash/all/patches/0001-1.4.2-fix-compiler-detection.patch b/recipes/librhash/all/patches/0001-1.4.2-fix-compiler-detection.patch deleted file mode 100644 index f6e51246e4dea..0000000000000 --- a/recipes/librhash/all/patches/0001-1.4.2-fix-compiler-detection.patch +++ /dev/null @@ -1,29 +0,0 @@ -Revert compiler detection to state of 1.3.9 - ---- configure -+++ configure -@@ -513,14 +513,9 @@ - CC_TMP="$CC" - test -n "$OPT_CC" && OTHER_CC= || OTHER_CC="gcc cc" - for CC in "$CC_TMP" $OTHER_CC; do -- cc_name_tmp= - if run_cmd "$CC -v"; then - cc_name_tmp=$($CC -v 2>&1 | tail -n 1 | cut -d ' ' -f 1) -- elif run_cmd "$CC --version"; then -- cc_name_tmp=$($CC --version 2>&1 | head -n 1 | cut -d ' ' -f 1) -- fi -- if test -n "${cc_name_tmp}"; then -- if echo "$cc_name_tmp" | grep -q "gcc"; then -+ if test "$cc_name_tmp" = "gcc"; then - cc_name=$cc_name_tmp - start_check "$CC version" - cc_vendor=gnu -@@ -544,7 +539,7 @@ - finish_check "$cc_name $cc_version" - break - fi -- if echo "$cc_name_tmp" | grep -q "clang"; then -+ if $CC -v 2>&1 | grep -q "clang"; then - start_check "$CC version" - cc_vendor=clang - cc_version=$($CC -dumpversion 2>&1) diff --git a/recipes/librhash/all/test_package/CMakeLists.txt b/recipes/librhash/all/test_package/CMakeLists.txt index 80f208bb6a15a..f1b9a5e0be249 100644 --- a/recipes/librhash/all/test_package/CMakeLists.txt +++ b/recipes/librhash/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(LibRHash CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/librhash/all/test_package/conanfile.py b/recipes/librhash/all/test_package/conanfile.py index 2c7657d70d5d9..ef5d7042163ec 100644 --- a/recipes/librhash/all/test_package/conanfile.py +++ b/recipes/librhash/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 SolaceTestConan(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) @@ -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/librhash/all/test_v1_package/CMakeLists.txt b/recipes/librhash/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/librhash/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/librhash/all/test_v1_package/conanfile.py b/recipes/librhash/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2c7657d70d5d9 --- /dev/null +++ b/recipes/librhash/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class SolaceTestConan(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/librhash/config.yml b/recipes/librhash/config.yml index 24eb5d89c9135..334d34ca8c5c1 100644 --- a/recipes/librhash/config.yml +++ b/recipes/librhash/config.yml @@ -1,4 +1,6 @@ versions: + 1.4.4: + folder: all 1.4.2: folder: all 1.3.9: diff --git a/recipes/libsecret/all/conandata.yml b/recipes/libsecret/all/conandata.yml index 55e19d25249c5..66c4f8677d553 100644 --- a/recipes/libsecret/all/conandata.yml +++ b/recipes/libsecret/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.21.4": + url: "https://download.gnome.org/sources/libsecret/0.21/libsecret-0.21.4.tar.xz" + sha256: "163d08d783be6d4ab9a979ceb5a4fecbc1d9660d3c34168c581301cd53912b20" "0.20.5": url: "https://download.gnome.org/sources/libsecret/0.20/libsecret-0.20.5.tar.xz" sha256: "3fb3ce340fcd7db54d87c893e69bfc2b1f6e4d4b279065ffe66dac9f0fd12b4d" diff --git a/recipes/libsecret/all/conanfile.py b/recipes/libsecret/all/conanfile.py index db4251a471dac..2090a9010ba96 100644 --- a/recipes/libsecret/all/conanfile.py +++ b/recipes/libsecret/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, rmdir from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain +from conan.tools.scm import Version import os required_conan_version = ">=1.60.0 <2.0 || >=2.0.6" @@ -24,57 +25,60 @@ class LibsecretConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "with_libgcrypt": [True, False], + "crypto": [False, "libgcrypt", "gnutls"], + "with_libgcrypt": [True, False, "deprecated"], } default_options = { "shared": False, "fPIC": True, - "with_libgcrypt": True, + "crypto": "libgcrypt", + "with_libgcrypt": "deprecated", } - @property - def _use_gcrypt(self): - return self.options.get_safe("with_libgcrypt", False) - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC if self.settings.os != "Linux": # libgcrypt recipe is currently only available on Linux - del self.options.with_libgcrypt + self.options.crypto = False def configure(self): if self.options.shared: self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + if self.options.with_libgcrypt != "deprecated": + self.output.warning(f"The '{self.ref}:with_libgcrypt' option is deprecated. Use '{self.ref}:crypto' instead.") def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.78.1", transitive_headers=True, transitive_libs=True) - if self._use_gcrypt: - self.requires("libgcrypt/1.8.4") + self.requires("glib/2.78.3", transitive_headers=True, transitive_libs=True) + if self.options.get_safe("crypto") == "libgcrypt": + self.requires("libgcrypt/1.10.3") + elif self.options.get_safe("crypto") == "gnutls": + self.requires("gnutls/3.8.2") def validate(self): if self.settings.os == "Windows": - raise ConanInvalidConfiguration( - "libsecret recipe is not yet compatible with Windows." - ) + raise ConanInvalidConfiguration(f"{self.ref} recipe is not yet compatible with Windows.") + if self.options.crypto == "gnutls" and Version(self.version) < "0.21.2": + raise ConanInvalidConfiguration(f"{self.ref} does not support GnuTLS before version 0.21.2. Use -o '&:crypto=libgcrypt' instead.") + + def package_id(self): + del self.info.options.with_libgcrypt def build_requirements(self): - self.tool_requires("meson/1.2.3") + self.tool_requires("meson/1.4.1") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.2.0") self.tool_requires("glib/") - if self.settings.os == "Macos": + if is_apple_os(self): # 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") + self.tool_requires("gettext/0.22.5") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -86,7 +90,10 @@ def generate(self): tc.project_options["introspection"] = "false" tc.project_options["manpage"] = "false" tc.project_options["gtk_doc"] = "false" - tc.project_options["gcrypt"] = "true" if self._use_gcrypt else "false" + if Version(self.version) >= "0.21.2": + tc.project_options["crypto"] = str(self.options.crypto) if self.options.crypto else "disabled" + else: + tc.project_options["gcrypt"] = "true" if self.options.crypto == "libgcrypt" else "false" tc.generate() deps = PkgConfigDeps(self) deps.generate() @@ -106,8 +113,10 @@ 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", "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")] self.cpp_info.libs = ["secret-1"] + self.cpp_info.requires = ["glib::glib-2.0", "glib::gobject-2.0", "glib::gio-2.0"] + if self.options.get_safe("crypto") == "libgcrypt": + self.cpp_info.requires.append("libgcrypt::libgcrypt") + elif self.options.get_safe("crypto") == "gnutls": + self.cpp_info.requires.append("gnutls::gnutls") diff --git a/recipes/libsecret/all/test_package/CMakeLists.txt b/recipes/libsecret/all/test_package/CMakeLists.txt index 0158ca54705aa..12e42237d500c 100644 --- a/recipes/libsecret/all/test_package/CMakeLists.txt +++ b/recipes/libsecret/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(libsecret REQUIRED CONFIG) diff --git a/recipes/libsecret/config.yml b/recipes/libsecret/config.yml index 470f4b110022f..f624806eaea4d 100644 --- a/recipes/libsecret/config.yml +++ b/recipes/libsecret/config.yml @@ -1,4 +1,6 @@ versions: + "0.21.4": + folder: all "0.20.5": folder: all "0.20.4": diff --git a/recipes/libselinux/all/conandata.yml b/recipes/libselinux/all/conandata.yml index 7387838ec6a10..6ec0dbf8b0f22 100644 --- a/recipes/libselinux/all/conandata.yml +++ b/recipes/libselinux/all/conandata.yml @@ -40,6 +40,15 @@ patches: base_path: libselinux-3.6 patch_description: "Fix a missing #include " patch_type: "portability" + - patch_file: patches/0004-libsepol-src-Makefile-fix-reallocarray-detection.patch + patch_description: "libsepol/src/Makefile: fix reallocarray detection" + patch_source: "https://lore.kernel.org/selinux/20240108210314.339682-1-fontaine.fabrice@gmail.com/" + patch_type: "portability" + base_path: libsepol-3.6 + - patch_file: patches/0005-libselinux-libsepol-Add-CFLAGS-and-LDFLAGS.patch + patch_description: "libselinux, libsepol: Add CFLAGS and LDFLAGS to Makefile checks" + patch_source: "https://lore.kernel.org/selinux/20240313224806.2859045-1-jwcart2@gmail.com/T/#u" + patch_type: "portability" "3.3": - patch_file: patches/0003-fix-link-pcre.patch base_path: libselinux-3.3 diff --git a/recipes/libselinux/all/conanfile.py b/recipes/libselinux/all/conanfile.py index 11d688ce34c15..19bf1f194402c 100644 --- a/recipes/libselinux/all/conanfile.py +++ b/recipes/libselinux/all/conanfile.py @@ -2,6 +2,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rename, replace_in_file, save from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps @@ -62,7 +63,7 @@ def validate(self): def build_requirements(self): self.tool_requires("flex/2.6.4") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.2.0") def source(self): for download in self.conan_data["sources"][self.version]: @@ -87,7 +88,10 @@ def generate(self): sepol_lib_folder = os.path.join(self._sepol_source_folder, "src") tc.extra_ldflags.append(f"-L{sepol_lib_folder}") tc.make_args.append("USE_PCRE2=y") - tc.generate() + env = tc.environment() + if cross_building(self): + env.append_path("PKG_CONFIG_LIBDIR", self.generators_folder) + tc.generate(env=env) def build(self): apply_conandata_patches(self) diff --git a/recipes/libselinux/all/patches/0004-libsepol-src-Makefile-fix-reallocarray-detection.patch b/recipes/libselinux/all/patches/0004-libsepol-src-Makefile-fix-reallocarray-detection.patch new file mode 100644 index 0000000000000..c9a5ee550ab55 --- /dev/null +++ b/recipes/libselinux/all/patches/0004-libsepol-src-Makefile-fix-reallocarray-detection.patch @@ -0,0 +1,48 @@ +From a520f972bce9ec267f4e76b729bc3b7c1bdf13e6 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Mon, 8 Jan 2024 22:03:14 +0100 +Subject: [PATCH 1/3] libsepol/src/Makefile: fix reallocarray detection + +Pass LDFLAGS when checking for reallocarray to avoid the following +static build failure with musl raised since version 3.4 and +https://github.com/SELinuxProject/selinux/commit/f0a5f6e33084bd83d409bb7c932256139f471e71 +because -static is not passed when checking for reallocarray: + +/home/autobuild/autobuild/instance-9/output-1/host/bin/armeb-buildroot-linux-musleabi-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -g0 -static -I. -I../include -D_GNU_SOURCE -I../cil/include -fPIC -c -o assertion.o assertion.c +In file included from assertion.c:28: +private.h:88:21: error: static declaration of 'reallocarray' follows non-static declaration + 88 | static inline void* reallocarray(void *ptr, size_t nmemb, size_t size) { + | ^~~~~~~~~~~~ +In file included from ../include/sepol/policydb/mls_types.h:35, + from ../include/sepol/policydb/context.h:23, + from ../include/sepol/policydb/policydb.h:62, + from assertion.c:24: +/home/autobuild/autobuild/instance-9/output-1/host/armeb-buildroot-linux-musleabi/sysroot/usr/include/stdlib.h:150:7: note: previous declaration of 'reallocarray' with type 'void *(void *, size_t, size_t)' {aka 'void *(void *, unsigned int, unsigned int)'} + 150 | void *reallocarray (void *, size_t, size_t); + | ^~~~~~~~~~~~ + +Fixes: + - http://autobuild.buildroot.org/results/0170032548a38e2c991d62dc5823808458ad03b3 + +Signed-off-by: Fabrice Fontaine +Acked-by: James Carter +--- +src/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index d80a941f..16b9bd5e 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -31,7 +31,7 @@ endif + + # check for reallocarray(3) availability + H := \# +-ifeq (yes,$(shell printf '${H}define _GNU_SOURCE\n${H}include \nint main(void){void*p=reallocarray(NULL, 1, sizeof(char));return 0;}' | $(CC) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) ++ifeq (yes,$(shell printf '${H}define _GNU_SOURCE\n${H}include \nint main(void){void*p=reallocarray(NULL, 1, sizeof(char));return 0;}' | $(CC) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) + override CFLAGS += -DHAVE_REALLOCARRAY + endif + +-- +2.44.0 + diff --git a/recipes/libselinux/all/patches/0005-libselinux-libsepol-Add-CFLAGS-and-LDFLAGS.patch b/recipes/libselinux/all/patches/0005-libselinux-libsepol-Add-CFLAGS-and-LDFLAGS.patch new file mode 100644 index 0000000000000..bea3664ddd66d --- /dev/null +++ b/recipes/libselinux/all/patches/0005-libselinux-libsepol-Add-CFLAGS-and-LDFLAGS.patch @@ -0,0 +1,61 @@ +[PATCH] libselinux, libsepol: Add CFLAGS and LDFLAGS to Makefile checks +@ 2024-03-13 22:48 James Carter + 0 siblings, 0 replies; only message in thread +From: James Carter @ 2024-03-13 22:48 UTC (permalink / raw) + To: selinux; +Cc: jordan, winfried_mb2, James Carter + +In libselinux there is an availability check for strlcpy() and +in both libselinux and libsepol there are availability checks for +reallocarray() in the src Makfiles. CFLAGS and LDFLAGS are needed +for cross-compiling, but, unfortunately, the default CFLAGS cause +all of these availability checks to fail to compile because of +compilationerrors (rather than just the function not being available). + +Add CFLAGS and LDFLAGS to the availibility checks, update the checks +so that a compilation error will only happen if the function being +checked for is not available, and make checks for the same function +the same in both libselinux and libsepol. + +Suggested-by: Jordan Williams +Suggested-by: Winfried Dobbe +Signed-off-by: James Carter +--- + libselinux/src/Makefile | 4 ++-- + libsepol/src/Makefile | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/libselinux-3.6/src/Makefile b/libselinux-3.6/src/Makefile +index d3b981fc..41cfbdca 100644 +--- a/libselinux-3.6/src/Makefile ++++ b/libselinux-3.6/src/Makefile +@@ -104,13 +104,13 @@ override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS) + + # check for strlcpy(3) availability + H := \# +-ifeq (yes,$(shell printf '${H}include \nint main(void){char*d,*s;strlcpy(d, s, 0);return 0;}' | $(CC) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) ++ifeq (yes,$(shell printf '${H}include \nint main(void){char d[2];const char *s="a";return (size_t)strlcpy(d,s,sizeof(d))>=sizeof(d);}' | $(CC) $(CFLAGS) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) + override CFLAGS += -DHAVE_STRLCPY + endif + + # check for reallocarray(3) availability + H := \# +-ifeq (yes,$(shell printf '${H}include \nint main(void){reallocarray(NULL, 0, 0);return 0;}' | $(CC) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) ++ifeq (yes,$(shell printf '${H}include \nint main(void){return reallocarray(NULL,0,0)==NULL;}' | $(CC) $(CFLAGS) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) + override CFLAGS += -DHAVE_REALLOCARRAY + endif + +diff --git a/libsepol-3.6/src/Makefile b/libsepol-3.6/src/Makefile +index 16b9bd5e..7b0e8446 100644 +--- a/libsepol-3.6/src/Makefile ++++ b/libsepol-3.6/src/Makefile +@@ -31,7 +31,7 @@ endif + + # check for reallocarray(3) availability + H := \# +-ifeq (yes,$(shell printf '${H}define _GNU_SOURCE\n${H}include \nint main(void){void*p=reallocarray(NULL, 1, sizeof(char));return 0;}' | $(CC) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) ++ifeq (yes,$(shell printf '${H}include \nint main(void){return reallocarray(NULL,0,0)==NULL;}' | $(CC) $(CFLAGS) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) + override CFLAGS += -DHAVE_REALLOCARRAY + endif + +-- +2.44.0 diff --git a/recipes/libsndio/all/conandata.yml b/recipes/libsndio/all/conandata.yml new file mode 100644 index 0000000000000..17fe5ab522e62 --- /dev/null +++ b/recipes/libsndio/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.9.0": + "source": + url: "https://github.com/ratchov/sndio/archive/refs/tags/v1.9.0.tar.gz" + sha256: "4e8d77069b651d7c4bb2a50ba49004bd7fcfdfec1516f88a76457f831c17a546" + "license": + url: "https://raw.githubusercontent.com/ratchov/sndio/e10e4f836b88f8d5ea2864845e3712f560e6bed6/LICENSE" + sha256: "4ae392ab9cfbf2d6ac8522f5f4b025685d60c824979fad783aaf72d55165730f" diff --git a/recipes/libsndio/all/conanfile.py b/recipes/libsndio/all/conanfile.py new file mode 100644 index 0000000000000..adf05fa3505c4 --- /dev/null +++ b/recipes/libsndio/all/conanfile.py @@ -0,0 +1,157 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import chdir, copy, get, rmdir, replace_in_file, download +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.scm import Version +from conan.tools.build import cross_building +import os + +required_conan_version = ">=1.53.0" + + +class LibsndioConan(ConanFile): + name = "libsndio" + license = "ISC" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sndio.org/" + topics = ("sndio", "sound", "audio", "midi") + description = ("A small audio and MIDI framework that provides a lightweight audio & MIDI server " + "and a user-space API to access either the server or the hardware directly in a uniform way.") + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_alsa": [True, False] + } + default_options = { + "with_alsa": True, + } + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration(f"Unsupported OS for {self.ref}") + + if self.options.with_alsa and not self.dependencies["libalsa"].options.get_safe("shared", False): + raise ConanInvalidConfiguration(f"{self.ref} requires libalsa to be built as a shared library") + + def requirements(self): + if self.options.get_safe("with_alsa"): + self.requires("libalsa/1.2.10", options={"shared": True}) + + def build_requirements(self): + self.tool_requires("libtool/2.4.7") + + def source(self): + get(self, **self.conan_data["sources"][self.version]["source"], strip_root=True) + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE") + + # Remove all targets other than libsndio + lines = [ + "cd sndiod && ${MAKE} install", + "cd sndioctl && ${MAKE} install", + "cd aucat && ${MAKE} install", + "cd midicat && ${MAKE} install", + "cd sndiod && ${MAKE}", + "cd sndioctl && ${MAKE}", + "cd aucat && ${MAKE}", + "cd midicat && ${MAKE}" + ] + for line in lines: + replace_in_file(self, os.path.join(self.source_folder, "Makefile.in"), line, "") + + def generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + + # Inject requires env vars in build scope + # It's required in case of native build when there is AutotoolsDeps & at least one dependency which might be shared, because configure tries to run a test executable + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + + # Set expected config + tc.configure_args.append("--datadir=${prefix}/res") + + # Bundled `configure` script does not support these options, so remove + exclusions = ["--enable-shared", "--disable-shared", "--disable-static", "--enable-static", "--sbindir", "--oldincludedir"] + tc.configure_args = [arg for arg in tc.configure_args if not any(exclusion in arg for exclusion in exclusions)] + + # Add alsa support + if self.options.get_safe("with_alsa"): + tc.configure_args.append("--enable-alsa") + else: + tc.configure_args.append("--disable-alsa") + + # The original project source has a hand-written `configure` script that does not expose + # many hooks for specifying additional build flags and library dependencies. Because the script is + # not auto-generated with Autotools, the standard Conan workflow of using AutoolsDeps is not possible. + # The one hook the script does provide is a command line arg: `CC=*|CFLAGS=*|LDFLAGS=*|AR=*)`. + # We use this to inject the various flags, paths, and libraries that the Conan dependency tree specifies. + dep_cflags = [] + dep_ldflags = [] + for dependency in reversed(self.dependencies.host.topological_sort.values()): + deps_cpp_info = dependency.cpp_info.aggregated_components() + + dep_cflags.extend(deps_cpp_info.cflags + deps_cpp_info.defines) + for path in deps_cpp_info.includedirs: + dep_cflags.append(f"-I{path}") + + dep_ldflags.extend(deps_cpp_info.sharedlinkflags + deps_cpp_info.exelinkflags) + for path in deps_cpp_info.libdirs: + dep_ldflags.append(f"-L{path}") + for lib in deps_cpp_info.libs + deps_cpp_info.system_libs: + dep_ldflags.append(f"-l{lib}") + + cflags = ' '.join([flag for flag in dep_cflags]) + ldflags = ' '.join([flag for flag in dep_ldflags]) + tc.configure_args.extend([ + f"CFLAGS={cflags}", + f"LDFLAGS={ldflags}" + ]) + + tc.generate() + + tc = AutotoolsDeps(self) + tc.generate() + + def build(self): + autotools = Autotools(self) + if Version(self.version) > "1.2.4": + autotools.configure() + autotools.make() + else: + with chdir(self, self.source_folder): + autotools.configure() + autotools.make() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) > "1.2.4": + autotools = Autotools(self) + autotools.install() + else: + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "sndio") + self.cpp_info.set_property("cmake_target_name", "sndio::sndio") + self.cpp_info.set_property("pkg_config_name", "sndio") + self.cpp_info.libs = ["sndio"] + self.cpp_info.system_libs = ["dl", "m", "rt"] + + # TODO: to remove in conan v2? + self.cpp_info.names["cmake_find_package"] = "sndio" + self.cpp_info.names["cmake_find_package_multi"] = "sndio" + self.cpp_info.names["pkg_config"] = "sndio" diff --git a/recipes/libsndio/all/test_package/CMakeLists.txt b/recipes/libsndio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..29d5d52c61281 --- /dev/null +++ b/recipes/libsndio/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(sndio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE sndio::sndio) diff --git a/recipes/libsndio/all/test_package/conanfile.py b/recipes/libsndio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libsndio/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/libsndio/all/test_package/test_package.c b/recipes/libsndio/all/test_package/test_package.c new file mode 100644 index 0000000000000..03387869c0a9d --- /dev/null +++ b/recipes/libsndio/all/test_package/test_package.c @@ -0,0 +1,24 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + int ch; + unsigned mode = SIO_PLAY | SIO_REC; + struct sio_hdl *hdl; + + hdl = sio_open(NULL, mode, 0); + if (hdl == NULL) { + fprintf(stderr, "sio_open() failed, but test is ok\n"); + exit(0); + } else { + printf("sio_open() success" ); + } + sio_close(hdl); + return 0; +} diff --git a/recipes/libsndio/config.yml b/recipes/libsndio/config.yml new file mode 100644 index 0000000000000..95efce85442dd --- /dev/null +++ b/recipes/libsndio/config.yml @@ -0,0 +1,3 @@ +versions: + "1.9.0": + folder: "all" diff --git a/recipes/libsrtp/all/conandata.yml b/recipes/libsrtp/all/conandata.yml index d7ca622cbdb82..04f0998b86517 100644 --- a/recipes/libsrtp/all/conandata.yml +++ b/recipes/libsrtp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.6.0": + url: "https://github.com/cisco/libsrtp/archive/v2.6.0.tar.gz" + sha256: "bf641aa654861be10570bfc137d1441283822418e9757dc71ebb69a6cf84ea6b" "2.5.0": url: "https://github.com/cisco/libsrtp/archive/v2.5.0.tar.gz" sha256: "8a43ef8e9ae2b665292591af62aa1a4ae41e468b6d98d8258f91478735da4e09" diff --git a/recipes/libsrtp/all/conanfile.py b/recipes/libsrtp/all/conanfile.py index 8a081d12ab6ba..38334eef95695 100644 --- a/recipes/libsrtp/all/conanfile.py +++ b/recipes/libsrtp/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import collect_libs, copy, get, save, rmdir from conan.tools.scm import Version +from conan.tools.env import VirtualBuildEnv import os required_conan_version = ">=1.53.0" @@ -14,10 +15,10 @@ class LibsrtpRecipe(ConanFile): "Protocol (SRTP), the Universal Security Transform (UST), and a supporting" "cryptographic kernel." ) - topics = ("srtp",) - homepage = "https://github.com/cisco/libsrtp" - url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cisco/libsrtp" + topics = ("srtp",) package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -48,21 +49,34 @@ def requirements(self): if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") + def build_requirements(self): + if Version(self.version) >= "2.6.0": + self.tool_requires("cmake/[>=3.21 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) tc.variables["ENABLE_OPENSSL"] = self.options.with_openssl - tc.variables["TEST_APPS"] = False + if Version(self.version) < "2.6.0": + tc.variables["TEST_APPS"] = False + else: + tc.variables["LIBSRTP_TEST_APPS"] = False if Version(self.version) < "2.4.0": # Relocatable shared libs on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - if Version(self.version) >= "2.5.0": + if "2.5.0" <= Version(self.version) < "2.6.0": tc.cache_variables["BUILD_WITH_WARNINGS"] = False + if "2.6.0" <= Version(self.version): + tc.cache_variables["ENABLE_WARNINGS"] = False + tc.cache_variables["ENABLE_WARNINGS_AS_ERRORS"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) deps.generate() + venv = VirtualBuildEnv(self) + venv.generate(scope="build") def _patch_sources(self): save(self, os.path.join(self.source_folder, "CMakeLists.txt"), diff --git a/recipes/libsrtp/config.yml b/recipes/libsrtp/config.yml index 0abd910fd2126..8daa9e28d8c53 100644 --- a/recipes/libsrtp/config.yml +++ b/recipes/libsrtp/config.yml @@ -1,4 +1,6 @@ versions: + "2.6.0": + folder: all "2.5.0": folder: all "2.4.2": diff --git a/recipes/libssh/all/conandata.yml b/recipes/libssh/all/conandata.yml new file mode 100644 index 0000000000000..87451579acb9c --- /dev/null +++ b/recipes/libssh/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "0.10.6": + url: "https://www.libssh.org/files/0.10/libssh-0.10.6.tar.xz" + sha256: "1861d498f5b6f1741b6abc73e608478491edcf9c9d4b6630eef6e74596de9dc1" +patches: + "0.10.6": + - patch_file: patches/0.10.6-0001-fix-cmake.patch + patch_description: "cmake: fix OpenSSL compatibility checks, fix ZLIB targets" + patch_type: "conan" + - patch_file: patches/0.10.6-0002-fix-cmake.patch + patch_description: "cmake: fix MbedTLS and GCrypt compatibility" + patch_type: "conan" + - patch_file: patches/0.10.6-0003-fix-mbedtls-private-struct.patch + patch_description: "Fix mbedTLS issues caused by v3 API changes" + patch_type: "bugfix" + patch_source: "https://gitlab.com/libssh/libssh-mirror/-/merge_requests/480" diff --git a/recipes/libssh/all/conanfile.py b/recipes/libssh/all/conanfile.py new file mode 100644 index 0000000000000..048a5fb46c2ed --- /dev/null +++ b/recipes/libssh/all/conanfile.py @@ -0,0 +1,125 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +import os + + +required_conan_version = ">=1.54.0" + + +class LibSSHRecipe(ConanFile): + name = "libssh" + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.libssh.org/" + description = "multiplatform C library implementing the SSHv2 protocol on client and server side" + topics = ("ssh", "shell", "ssh2", "connection") + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zlib": [True, False], + "crypto_backend": ["openssl", "gcrypt", "mbedtls"], + "with_symbol_versioning": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + "crypto_backend": "openssl", + "with_symbol_versioning": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.with_symbol_versioning + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.crypto_backend =="openssl": + self.requires("openssl/[>=1.1 <4]") + elif self.options.crypto_backend == "gcrypt": + self.requires("libgcrypt/1.8.4") + elif self.options.crypto_backend == "mbedtls": + self.requires("mbedtls/3.6.0") + + def validate(self): + if self.options.crypto_backend == "mbedtls" and not self.dependencies["mbedtls"].options.enable_threading: + raise ConanInvalidConfiguration(f"{self.ref} requires '-o mbedtls/*:enable_threading=True' when using '-o libssh/*:crypto_backend=mbedtls'") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CLIENT_TESTING"] = False + tc.variables["SERVER_TESTING"] = False + tc.variables["WITH_EXAMPLES"] = False + tc.variables["WITH_GCRYPT"] = self.options.crypto_backend == "gcrypt" + tc.variables["WITH_GSSAPI"] = False + tc.variables["WITH_MBEDTLS"] = self.options.crypto_backend == "mbedtls" + tc.variables["WITH_NACL"] = False + tc.variables["WITH_SYMBOL_VERSIONING"] = self.options.get_safe("with_symbol_versioning", True) + tc.variables["WITH_ZLIB"] = self.options.with_zlib + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["ssh"] + if not self.options.shared: + self.cpp_info.defines.append("LIBSSH_STATIC=ON") + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["ws2_32", "iphlpapi"]) + + self.cpp_info.set_property("cmake_file_name", "libssh") + # target and alias names defined at: + # ssh https://git.libssh.org/projects/libssh.git/tree/src/CMakeLists.txt?h=libssh-0.10.6#n351 + # ssh::ssh https://git.libssh.org/projects/libssh.git/tree/src/CMakeLists.txt?h=libssh-0.10.6#n371 + # ssh-static https://git.libssh.org/projects/libssh.git/tree/src/CMakeLists.txt?h=libssh-0.10.6#n413 + # ssh::static https://git.libssh.org/projects/libssh.git/tree/src/CMakeLists.txt?h=libssh-0.10.6#n428 + self.cpp_info.set_property("cmake_target_name", "ssh::ssh") + self.cpp_info.set_property( + "cmake_target_aliases", + ["ssh"] if self.options.shared else ["ssh", "ssh-static", "ssh::static"], + ) + # pkg-config defined at https://git.libssh.org/projects/libssh.git/tree/CMakeLists.txt?h=libssh-0.10.6#n124 + self.cpp_info.set_property("pkg_config_name", "libssh") + diff --git a/recipes/libssh/all/patches/0.10.6-0001-fix-cmake.patch b/recipes/libssh/all/patches/0.10.6-0001-fix-cmake.patch new file mode 100644 index 0000000000000..22ccde99a9073 --- /dev/null +++ b/recipes/libssh/all/patches/0.10.6-0001-fix-cmake.patch @@ -0,0 +1,110 @@ +diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake +index 9de10225..6f881775 100644 +--- a/ConfigureChecks.cmake ++++ b/ConfigureChecks.cmake +@@ -101,41 +101,41 @@ if (OPENSSL_FOUND) + check_include_file(openssl/ecdsa.h HAVE_OPENSSL_ECDSA_H) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_KDF_CTX_new_id HAVE_OPENSSL_EVP_KDF_CTX_NEW_ID) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_KDF_CTX_new HAVE_OPENSSL_EVP_KDF_CTX_NEW) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(FIPS_mode HAVE_OPENSSL_FIPS_MODE) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(RAND_priv_bytes HAVE_OPENSSL_RAND_PRIV_BYTES) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_DigestSign HAVE_OPENSSL_EVP_DIGESTSIGN) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_DigestVerify HAVE_OPENSSL_EVP_DIGESTVERIFY) + + check_function_exists(OPENSSL_ia32cap_loc HAVE_OPENSSL_IA32CAP_LOC) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_symbol_exists(EVP_PKEY_ED25519 "openssl/evp.h" FOUND_OPENSSL_ED25519) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_chacha20 HAVE_OPENSSL_EVP_CHACHA20) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_symbol_exists(EVP_PKEY_POLY1305 "openssl/evp.h" HAVE_OPENSSL_EVP_POLY1305) + + if (HAVE_OPENSSL_EVP_DIGESTSIGN AND HAVE_OPENSSL_EVP_DIGESTVERIFY AND +@@ -144,7 +144,7 @@ if (OPENSSL_FOUND) + endif() + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_symbol_exists(EVP_PKEY_X25519 "openssl/evp.h" HAVE_OPENSSL_X25519) + + unset(CMAKE_REQUIRED_INCLUDES) +@@ -494,7 +494,7 @@ if (WITH_PKCS11_URI) + message(FATAL_ERROR "PKCS #11 is not supported for mbedcrypto") + set(WITH_PKCS11_URI 0) + endif() +- if (HAVE_OPENSSL AND NOT OPENSSL_VERSION VERSION_GREATER_EQUAL "1.1.1") ++ if (HAVE_OPENSSL AND NOT OpenSSL_VERSION VERSION_GREATER_EQUAL "1.1.1") + message(FATAL_ERROR "PKCS #11 requires at least OpenSSL 1.1.1") + set(WITH_PKCS11_URI 0) + endif() +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 807313b5..91f85094 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -17,7 +17,7 @@ if (OPENSSL_CRYPTO_LIBRARIES) + + set(LIBSSH_LINK_LIBRARIES + ${LIBSSH_LINK_LIBRARIES} +- ${OPENSSL_CRYPTO_LIBRARIES} ++ OpenSSL::Crypto + ) + endif (OPENSSL_CRYPTO_LIBRARIES) + +@@ -46,12 +46,12 @@ endif() + if (WITH_ZLIB) + set(LIBSSH_PRIVATE_INCLUDE_DIRS + ${LIBSSH_PRIVATE_INCLUDE_DIRS} +- ${ZLIB_INCLUDE_DIR} ++ ${ZLIB_INCLUDE_DIRS} + ) + + set(LIBSSH_LINK_LIBRARIES + ${LIBSSH_LINK_LIBRARIES} +- ${ZLIB_LIBRARY} ++ ${ZLIB_LIBRARIES} + ) + endif (WITH_ZLIB) + +@@ -257,7 +257,7 @@ else (WITH_GCRYPT) + chachapoly.c + ) + endif (NOT (HAVE_OPENSSL_EVP_CHACHA20 AND HAVE_OPENSSL_EVP_POLY1305)) +- if(OPENSSL_VERSION VERSION_LESS "1.1.0") ++ if(OpenSSL_VERSION VERSION_LESS "1.1.0") + set(libssh_SRCS ${libssh_SRCS} libcrypto-compat.c) + endif() + endif (WITH_GCRYPT) diff --git a/recipes/libssh/all/patches/0.10.6-0002-fix-cmake.patch b/recipes/libssh/all/patches/0.10.6-0002-fix-cmake.patch new file mode 100644 index 0000000000000..53b9b66c536c7 --- /dev/null +++ b/recipes/libssh/all/patches/0.10.6-0002-fix-cmake.patch @@ -0,0 +1,123 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a64b7708..6647076b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -48,15 +48,15 @@ if (WITH_ZLIB) + endif (WITH_ZLIB) + + if (WITH_GCRYPT) +- find_package(GCrypt 1.5.0 REQUIRED) +- if (NOT GCRYPT_FOUND) ++ find_package(libgcrypt 1.5.0 REQUIRED) ++ if (NOT libgcrypt_FOUND) + message(FATAL_ERROR "Could not find GCrypt") +- endif (NOT GCRYPT_FOUND) ++ endif (NOT libgcrypt_FOUND) + elseif(WITH_MBEDTLS) + find_package(MbedTLS REQUIRED) +- if (NOT MBEDTLS_FOUND) ++ if (NOT MbedTLS_FOUND) + message(FATAL_ERROR "Could not find mbedTLS") +- endif (NOT MBEDTLS_FOUND) ++ endif (NOT MbedTLS_FOUND) + else (WITH_GCRYPT) + find_package(OpenSSL 1.0.1) + if (OPENSSL_FOUND) +@@ -66,13 +66,13 @@ else (WITH_GCRYPT) + set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY}) + endif (NOT DEFINED OPENSSL_CRYPTO_LIBRARIES) + else (OPENSSL_FOUND) +- find_package(GCrypt) +- if (NOT GCRYPT_FOUND) ++ find_package(libgcrypt) ++ if (NOT libgcrypt_FOUND) + find_package(MbedTLS) +- if (NOT MBEDTLS_FOUND) ++ if (NOT MbedTLS_FOUND) + message(FATAL_ERROR "Could not find OpenSSL, GCrypt or mbedTLS") +- endif (NOT MBEDTLS_FOUND) +- endif (NOT GCRYPT_FOUND) ++ endif (NOT MbedTLS_FOUND) ++ endif (NOT libgcrypt_FOUND) + endif (OPENSSL_FOUND) + endif(WITH_GCRYPT) + +diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake +index 6f881775..12585117 100644 +--- a/ConfigureChecks.cmake ++++ b/ConfigureChecks.cmake +@@ -267,27 +267,27 @@ if (OPENSSL_FOUND) + set(HAVE_LIBCRYPTO 1) + endif (OPENSSL_FOUND) + +-if (GCRYPT_FOUND) ++if (libgcrypt_FOUND) + set(HAVE_LIBGCRYPT 1) +- if (GCRYPT_VERSION VERSION_GREATER "1.4.6") ++ if (libgcrypt_VERSION VERSION_GREATER "1.4.6") + set(HAVE_GCRYPT_ECC 1) + set(HAVE_ECC 1) +- endif (GCRYPT_VERSION VERSION_GREATER "1.4.6") +- if (NOT GCRYPT_VERSION VERSION_LESS "1.7.0") ++ endif (libgcrypt_VERSION VERSION_GREATER "1.4.6") ++ if (NOT libgcrypt_VERSION VERSION_LESS "1.7.0") + set(HAVE_GCRYPT_CHACHA_POLY 1) +- endif (NOT GCRYPT_VERSION VERSION_LESS "1.7.0") +-endif (GCRYPT_FOUND) ++ endif (NOT libgcrypt_VERSION VERSION_LESS "1.7.0") ++endif (libgcrypt_FOUND) + +-if (MBEDTLS_FOUND) ++if (MbedTLS_FOUND) + set(HAVE_LIBMBEDCRYPTO 1) + set(HAVE_ECC 1) + +- set(CMAKE_REQUIRED_INCLUDES "${MBEDTLS_INCLUDE_DIR}/mbedtls") ++ set(CMAKE_REQUIRED_INCLUDES "${MbedTLS_INCLUDE_DIR}/mbedtls") + check_include_file(chacha20.h HAVE_MBEDTLS_CHACHA20_H) + check_include_file(poly1305.h HAVE_MBEDTLS_POLY1305_H) + unset(CMAKE_REQUIRED_INCLUDES) + +-endif (MBEDTLS_FOUND) ++endif (MbedTLS_FOUND) + + if (CMAKE_USE_PTHREADS_INIT) + set(HAVE_PTHREAD 1) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 91f85094..839271ad 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -21,27 +21,13 @@ if (OPENSSL_CRYPTO_LIBRARIES) + ) + endif (OPENSSL_CRYPTO_LIBRARIES) + +-if (MBEDTLS_CRYPTO_LIBRARY) +- set(LIBSSH_PRIVATE_INCLUDE_DIRS +- ${LIBSSH_PRIVATE_INCLUDE_DIRS} +- ${MBEDTLS_INCLUDE_DIR} +- ) +- set(LIBSSH_LINK_LIBRARIES +- ${LIBSSH_LINK_LIBRARIES} +- ${MBEDTLS_CRYPTO_LIBRARY} +- ) +-endif (MBEDTLS_CRYPTO_LIBRARY) +- +-if (GCRYPT_LIBRARIES) +- set(LIBSSH_PRIVATE_INCLUDE_DIRS +- ${LIBSSH_PRIVATE_INCLUDE_DIRS} +- ${GCRYPT_INCLUDE_DIR} +- ) ++if (TARGET MbedTLS::mbedcrypto) ++ list(APPEND LIBSSH_LINK_LIBRARIES MbedTLS::mbedcrypto) ++endif () + +- set(LIBSSH_LINK_LIBRARIES +- ${LIBSSH_LINK_LIBRARIES} +- ${GCRYPT_LIBRARIES}) +-endif() ++if (TARGET libgcrypt::libgcrypt) ++ list(APPEND LIBSSH_LINK_LIBRARIES libgcrypt::libgcrypt) ++endif () + + if (WITH_ZLIB) + set(LIBSSH_PRIVATE_INCLUDE_DIRS diff --git a/recipes/libssh/all/patches/0.10.6-0003-fix-mbedtls-private-struct.patch b/recipes/libssh/all/patches/0.10.6-0003-fix-mbedtls-private-struct.patch new file mode 100644 index 0000000000000..b71b2c3e3e4ee --- /dev/null +++ b/recipes/libssh/all/patches/0.10.6-0003-fix-mbedtls-private-struct.patch @@ -0,0 +1,13 @@ +diff --git a/src/libmbedcrypto.c b/src/libmbedcrypto.c +index caa3b6e9..69910a24 100644 +--- a/src/libmbedcrypto.c ++++ b/src/libmbedcrypto.c +@@ -119,7 +119,7 @@ int hmac_update(HMACCTX c, const void *data, size_t len) + int hmac_final(HMACCTX c, unsigned char *hashmacbuf, size_t *len) + { + int rc; +- *len = (unsigned int)mbedtls_md_get_size(c->md_info); ++ *len = (unsigned int)mbedtls_md_get_size(c->MBEDTLS_PRIVATE(md_info)); + rc = !mbedtls_md_hmac_finish(c, hashmacbuf); + mbedtls_md_free(c); + SAFE_FREE(c); diff --git a/recipes/libssh/all/test_package/CMakeLists.txt b/recipes/libssh/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..028fc38762145 --- /dev/null +++ b/recipes/libssh/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES C) + +find_package(libssh CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ssh) diff --git a/recipes/libssh/all/test_package/conanfile.py b/recipes/libssh/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libssh/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/libssh/all/test_package/test_package.c b/recipes/libssh/all/test_package/test_package.c new file mode 100644 index 0000000000000..a6b34889b0652 --- /dev/null +++ b/recipes/libssh/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +int main(int argc, char *argv[]) { + ssh_session session = ssh_new(); + if (session == NULL) { + return -1; + } + + return 0; +} diff --git a/recipes/libssh/config.yml b/recipes/libssh/config.yml new file mode 100644 index 0000000000000..e9995a4dcd5e9 --- /dev/null +++ b/recipes/libssh/config.yml @@ -0,0 +1,3 @@ +versions: + "0.10.6": + folder: all diff --git a/recipes/libstudxml/1.1.x/conanfile.py b/recipes/libstudxml/1.1.x/conanfile.py index 42db9e71046d4..f5228bce1c824 100644 --- a/recipes/libstudxml/1.1.x/conanfile.py +++ b/recipes/libstudxml/1.1.x/conanfile.py @@ -38,7 +38,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0", transitive_headers=True, transitive_libs=True) + self.requires("expat/[>=2.6.2 <3]", transitive_headers=True, transitive_libs=True) def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/libsvtav1/all/conandata.yml b/recipes/libsvtav1/all/conandata.yml index fcb9aa5c7563f..6f34d5b9aab65 100644 --- a/recipes/libsvtav1/all/conandata.yml +++ b/recipes/libsvtav1/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.0": + url: "https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v2.1.0/SVT-AV1-v2.1.0.tar.gz" + sha256: "72a076807544f3b269518ab11656f77358284da7782cece497781ab64ed4cb8a" "1.7.0": url: "https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v1.7.0/SVT-AV1-v1.7.0.tar.gz" sha256: "ce0973584f1a187aa4abf63f509ff8464397120878e322a3153f87e9c161fc4f" diff --git a/recipes/libsvtav1/all/conanfile.py b/recipes/libsvtav1/all/conanfile.py index 881442bca3f0b..93ab47914aaa4 100644 --- a/recipes/libsvtav1/all/conanfile.py +++ b/recipes/libsvtav1/all/conanfile.py @@ -9,11 +9,11 @@ class SVTAV1Conan(ConanFile): name = "libsvtav1" - license = "BSD-3-Clause" description = "An AV1-compliant software encoder/decoder library" - topics = "av1", "codec", "encoder", "decoder", "video" - homepage = "https://gitlab.com/AOMediaCodec/SVT-AV1" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.com/AOMediaCodec/SVT-AV1" + topics = ("av1", "codec", "encoder", "decoder", "video") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -21,12 +21,14 @@ class SVTAV1Conan(ConanFile): "fPIC": [True, False], "build_encoder": [True, False], "build_decoder": [True, False], + "minimal_build": [True, False], } default_options = { "shared": False, "fPIC": True, "build_encoder": True, "build_decoder": True, + "minimal_build": False, } def export_sources(self): @@ -35,6 +37,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") + if Version(self.version) < "2.0.0": + del self.options.minimal_build def configure(self): if self.options.shared: @@ -63,6 +67,7 @@ def generate(self): tc.variables["USE_EXTERNAL_CPUINFO"] = True if self.settings.arch in ("x86", "x86_64"): tc.variables["ENABLE_NASM"] = True + tc.variables["MINIMAL_BUILD"] = self.options.get_safe("minimal_build", False) tc.generate() deps = CMakeDeps(self) deps.generate() diff --git a/recipes/libsvtav1/all/test_package/CMakeLists.txt b/recipes/libsvtav1/all/test_package/CMakeLists.txt index 57e131a83ee08..c3bbcf04d632f 100644 --- a/recipes/libsvtav1/all/test_package/CMakeLists.txt +++ b/recipes/libsvtav1/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(libsvtav1 REQUIRED CONFIG) diff --git a/recipes/libsvtav1/config.yml b/recipes/libsvtav1/config.yml index c8fea3589a745..efc6420082e04 100644 --- a/recipes/libsvtav1/config.yml +++ b/recipes/libsvtav1/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.0": + folder: all "1.7.0": folder: all "1.6.0": diff --git a/recipes/libsystemd/all/conandata.yml b/recipes/libsystemd/all/conandata.yml index e7dd7400914db..28098a76fd075 100644 --- a/recipes/libsystemd/all/conandata.yml +++ b/recipes/libsystemd/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "255.7": + url: "https://github.com/systemd/systemd-stable/archive/v255.7.tar.gz" + sha256: "da29f2490c192ca743511098b1d15e385b1b5e7744979661dc30514c1ac61f0e" "255.2": url: "https://github.com/systemd/systemd-stable/archive/v255.2.tar.gz" sha256: "ba7354a742dc9a8bb7dbeaa40cbf7cf2ca84f506d5b7ae5ab8d14c8eecb7aca0" @@ -14,25 +17,11 @@ sources: "253.6": url: "https://github.com/systemd/systemd-stable/archive/v253.6.tar.gz" sha256: "a0aebcfaa2e001a4d846691631d1722c4cfa1a175e4ea62db6edca0ea3cf1e3e" - "252.12": - url: "https://github.com/systemd/systemd-stable/archive/v252.12.tar.gz" - sha256: "c6c249d65b3aff0a2b99410f430f404068c74a7cd96b63f482c933afd7288112" - "251.18": - url: "https://github.com/systemd/systemd-stable/archive/v251.18.tar.gz" - sha256: "aaa5eca2dcf3fda242ed6816a00a83c91762b44ef3c76ee4eb8476a592c38f7f" - "249.16": - url: "https://github.com/systemd/systemd-stable/archive/v249.16.tar.gz" - sha256: "e6c8a686023ef0ce402f4abde42245e3ada661e000c4811dc16c8cd9b4c6d885" - "248.12": - url: "https://github.com/systemd/systemd-stable/archive/v248.12.tar.gz" - sha256: "d0826453439363b57a4f092ae078b128a95e87047281a79e8b136116ab83abc9" - "247.13": - url: "https://github.com/systemd/systemd-stable/archive/v247.13.tar.gz" - sha256: "0958bfcebf3ed4e451f6cc49802f338fcc80eb4fe4f0cf5cb5b1b90fa62e5f47" - "246.16": - url: "https://github.com/systemd/systemd-stable/archive/v246.16.tar.gz" - sha256: "b69f9940d65870f090269a28f1047a633d4b80d0001e091d53a031dd40a822d2" patches: + "255.7": + - patch_file: "patches/251.18/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" "255.2": - patch_file: "patches/251.18/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" @@ -74,47 +63,3 @@ patches: patch_source: "https://patch-diff.githubusercontent.com/raw/systemd/systemd/pull/29538" patch_description: "fixes cross-compilation by passing necessary compiler arguments to generator scripts" patch_type: "portability" - "252.12": - - patch_file: "patches/248.12/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.18/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" - "251.18": - - patch_file: "patches/248.12/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.18/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" - "249.16": - - patch_file: "patches/248.12/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/249.16/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" - "248.12": - - patch_file: "patches/248.12/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/247.13/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" - "247.13": - - patch_file: "patches/247.13/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" - "246.16": - - patch_file: "patches/246.16/0001-Drop-bundled-copy-of-linux-if_arp.h.patch" - patch_description: "fix build error with Linux headers >= 5.14 by removing a bundled copy of it" - patch_type: "portability" - patch_source: "https://github.com/systemd/systemd-stable/commit/06dea04b38ce506c1436cd4fef9bf9919a34f441" - - patch_file: "patches/246.16/0002-meson.build-change-operator-combining-bools-from-to-.patch" - patch_description: "allow to build with meson >= 0.60.0 by fixing syntax error" - patch_type: "bugfix" - patch_source: "https://github.com/systemd/systemd-stable/commit/3d0666d9091dd097022f02fae79890b5746285c1" - - patch_file: "patches/246.16/0003-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" diff --git a/recipes/libsystemd/all/conanfile.py b/recipes/libsystemd/all/conanfile.py index 047032ef9a2e3..2f7cbdaadba28 100644 --- a/recipes/libsystemd/all/conanfile.py +++ b/recipes/libsystemd/all/conanfile.py @@ -11,7 +11,7 @@ from conan.tools.meson import Meson, MesonToolchain from conan.tools.scm import Version -required_conan_version = ">=1.60.0" +required_conan_version = ">=1.64.0" class LibsystemdConan(ConanFile): @@ -52,13 +52,19 @@ def configure(self): def layout(self): basic_layout(self, src_folder="src") + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", # gcc 5 is failing + "clang": "10" + } + def requirements(self): self.requires("libcap/2.69") self.requires("libmount/2.39.2") - if Version(self.version) >= "251.18": - self.requires("libxcrypt/4.4.36") + self.requires("libxcrypt/4.4.36") if self.options.with_selinux: - self.requires("libselinux/3.5") + self.requires("libselinux/3.6") if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_xz: @@ -69,9 +75,14 @@ def requirements(self): def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration("Only Linux supported") + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if Version(self.version) >= "255.0" and minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires {str(self.settings.compiler)} >= {minimum_version}." + ) def build_requirements(self): - self.tool_requires("meson/1.3.0") + self.tool_requires("meson/1.4.0") self.tool_requires("m4/1.4.19") self.tool_requires("gperf/3.1") if not self.conf.get("tools.gnu:pkg_config", check_type=str): @@ -134,14 +145,10 @@ def generate(self): "libiptc", "elfutils", "repart", "homed", "importd", "acl", "dns-over-tls", "log-trace"] - if Version(self.version) >= "247.1": - unrelated.append("oomd") - if Version(self.version) >= "248.1": - unrelated.extend(["sysext", "nscd"]) - if Version(self.version) >= "251.1": - unrelated.append("link-boot-shared") - if Version(self.version) >= "252.1": - unrelated.append("link-journalctl-shared") + unrelated.append("oomd") + unrelated.extend(["sysext", "nscd"]) + unrelated.append("link-boot-shared") + unrelated.append("link-journalctl-shared") if Version(self.version) < "254.7": unrelated.extend(["gnu-efi", "valgrind"]) else: @@ -150,9 +157,10 @@ def generate(self): for opt in unrelated: tc.project_options[opt] = "false" - # 'rootprefix' is unused during libsystemd packaging but systemd > v247 - # build files require 'prefix' to be a subdirectory of 'rootprefix'. - tc.project_options["rootprefix"] = self.package_folder + if Version(self.version) < "255": + # 'rootprefix' is unused during libsystemd packaging but systemd > v247 + # build files require 'prefix' to be a subdirectory of 'rootprefix'. + tc.project_options["rootprefix"] = "/" # Since, Conan 1.64 # There are a few places in libsystemd where pkgconfig dependencies are # not used in compile time and only used in link time. And because of diff --git a/recipes/libsystemd/all/patches/246.16/0001-Drop-bundled-copy-of-linux-if_arp.h.patch b/recipes/libsystemd/all/patches/246.16/0001-Drop-bundled-copy-of-linux-if_arp.h.patch deleted file mode 100644 index cb77bf0883880..0000000000000 --- a/recipes/libsystemd/all/patches/246.16/0001-Drop-bundled-copy-of-linux-if_arp.h.patch +++ /dev/null @@ -1,223 +0,0 @@ -From 00ff923c28498dad77c1705c3699a21bcc941329 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= -Date: Wed, 15 Sep 2021 16:33:05 +0200 -Subject: [PATCH 1/2] Drop bundled copy of linux/if_arp.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -As far as I can see, we use this to get a list of ARPHRD_* defines (used in -particular for Type= in .link files). If we drop our copy, and build against -old kernel headers, the user will have a shorter list of types available. This -seems OK, and I don't think it's worth carrying our own version of this file -just to have newest possible entries. - -7c5b9952c4f6e2b72f90edbe439982528b7cf223 recently updated this file, but we'd -have to update it every time the kernel adds new entries. But if we look at -the failure carefully: - -src/basic/arphrd-from-name.gperf:65:16: error: ‘ARPHRD_MCTP’ undeclared (first use in this function); did you mean ‘ARPHRD_FCPP’? - 65 | MCTP, ARPHRD_MCTP - | ^~ - | ARPHRD_FCPP - -we see that the list we were generating was from the system headers, so it was -only as good as the system headers anyway, without the newer entries in our -bundled copy, if there were any. So let's make things simpler by always using -system headers. - -And if somebody wants to fix things so that we always have the newest list, -then we should just generate and store the converted list, not the full header. - -(cherry picked from commit e7f46ee3ae1cc66a94b293957721d68dc09d7449) ---- - src/basic/linux/if_arp.h | 164 --------------------------------------- - src/basic/meson.build | 1 - - 2 files changed, 165 deletions(-) - delete mode 100644 src/basic/linux/if_arp.h - -diff --git a/src/basic/linux/if_arp.h b/src/basic/linux/if_arp.h -deleted file mode 100644 -index c3cc5a9e5e..0000000000 ---- a/src/basic/linux/if_arp.h -+++ /dev/null -@@ -1,164 +0,0 @@ --/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ --/* -- * INET An implementation of the TCP/IP protocol suite for the LINUX -- * operating system. INET is implemented using the BSD Socket -- * interface as the means of communication with the user level. -- * -- * Global definitions for the ARP (RFC 826) protocol. -- * -- * Version: @(#)if_arp.h 1.0.1 04/16/93 -- * -- * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988 -- * Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source. -- * Ross Biro -- * Fred N. van Kempen, -- * Florian La Roche, -- * Jonathan Layes -- * Arnaldo Carvalho de Melo ARPHRD_HWX25 -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License -- * as published by the Free Software Foundation; either version -- * 2 of the License, or (at your option) any later version. -- */ --#ifndef _UAPI_LINUX_IF_ARP_H --#define _UAPI_LINUX_IF_ARP_H -- --#include -- --/* ARP protocol HARDWARE identifiers. */ --#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */ --#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */ --#define ARPHRD_EETHER 2 /* Experimental Ethernet */ --#define ARPHRD_AX25 3 /* AX.25 Level 2 */ --#define ARPHRD_PRONET 4 /* PROnet token ring */ --#define ARPHRD_CHAOS 5 /* Chaosnet */ --#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */ --#define ARPHRD_ARCNET 7 /* ARCnet */ --#define ARPHRD_APPLETLK 8 /* APPLEtalk */ --#define ARPHRD_DLCI 15 /* Frame Relay DLCI */ --#define ARPHRD_ATM 19 /* ATM */ --#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */ --#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734 */ --#define ARPHRD_EUI64 27 /* EUI-64 */ --#define ARPHRD_INFINIBAND 32 /* InfiniBand */ -- --/* Dummy types for non ARP hardware */ --#define ARPHRD_SLIP 256 --#define ARPHRD_CSLIP 257 --#define ARPHRD_SLIP6 258 --#define ARPHRD_CSLIP6 259 --#define ARPHRD_RSRVD 260 /* Notional KISS type */ --#define ARPHRD_ADAPT 264 --#define ARPHRD_ROSE 270 --#define ARPHRD_X25 271 /* CCITT X.25 */ --#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */ --#define ARPHRD_CAN 280 /* Controller Area Network */ --#define ARPHRD_PPP 512 --#define ARPHRD_CISCO 513 /* Cisco HDLC */ --#define ARPHRD_HDLC ARPHRD_CISCO --#define ARPHRD_LAPB 516 /* LAPB */ --#define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */ --#define ARPHRD_RAWHDLC 518 /* Raw HDLC */ --#define ARPHRD_RAWIP 519 /* Raw IP */ -- --#define ARPHRD_TUNNEL 768 /* IPIP tunnel */ --#define ARPHRD_TUNNEL6 769 /* IP6IP6 tunnel */ --#define ARPHRD_FRAD 770 /* Frame Relay Access Device */ --#define ARPHRD_SKIP 771 /* SKIP vif */ --#define ARPHRD_LOOPBACK 772 /* Loopback device */ --#define ARPHRD_LOCALTLK 773 /* Localtalk device */ --#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface */ --#define ARPHRD_BIF 775 /* AP1000 BIF */ --#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4 */ --#define ARPHRD_IPDDP 777 /* IP over DDP tunneller */ --#define ARPHRD_IPGRE 778 /* GRE over IP */ --#define ARPHRD_PIMREG 779 /* PIMSM register interface */ --#define ARPHRD_HIPPI 780 /* High Performance Parallel Interface */ --#define ARPHRD_ASH 781 /* Nexus 64Mbps Ash */ --#define ARPHRD_ECONET 782 /* Acorn Econet */ --#define ARPHRD_IRDA 783 /* Linux-IrDA */ --/* ARP works differently on different FC media .. so */ --#define ARPHRD_FCPP 784 /* Point to point fibrechannel */ --#define ARPHRD_FCAL 785 /* Fibrechannel arbitrated loop */ --#define ARPHRD_FCPL 786 /* Fibrechannel public loop */ --#define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */ -- /* 787->799 reserved for fibrechannel media types */ --#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ --#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ --#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ --#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ --#define ARPHRD_IEEE802154 804 --#define ARPHRD_IEEE802154_MONITOR 805 /* IEEE 802.15.4 network monitor */ -- --#define ARPHRD_PHONET 820 /* PhoNet media type */ --#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ --#define ARPHRD_CAIF 822 /* CAIF media type */ --#define ARPHRD_IP6GRE 823 /* GRE over IPv6 */ --#define ARPHRD_NETLINK 824 /* Netlink header */ --#define ARPHRD_6LOWPAN 825 /* IPv6 over LoWPAN */ --#define ARPHRD_VSOCKMON 826 /* Vsock monitor header */ -- --#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ --#define ARPHRD_NONE 0xFFFE /* zero header length */ -- --/* ARP protocol opcodes. */ --#define ARPOP_REQUEST 1 /* ARP request */ --#define ARPOP_REPLY 2 /* ARP reply */ --#define ARPOP_RREQUEST 3 /* RARP request */ --#define ARPOP_RREPLY 4 /* RARP reply */ --#define ARPOP_InREQUEST 8 /* InARP request */ --#define ARPOP_InREPLY 9 /* InARP reply */ --#define ARPOP_NAK 10 /* (ATM)ARP NAK */ -- -- --/* ARP ioctl request. */ --struct arpreq { -- struct sockaddr arp_pa; /* protocol address */ -- struct sockaddr arp_ha; /* hardware address */ -- int arp_flags; /* flags */ -- struct sockaddr arp_netmask; /* netmask (only for proxy arps) */ -- char arp_dev[IFNAMSIZ]; --}; -- --struct arpreq_old { -- struct sockaddr arp_pa; /* protocol address */ -- struct sockaddr arp_ha; /* hardware address */ -- int arp_flags; /* flags */ -- struct sockaddr arp_netmask; /* netmask (only for proxy arps) */ --}; -- --/* ARP Flag values. */ --#define ATF_COM 0x02 /* completed entry (ha valid) */ --#define ATF_PERM 0x04 /* permanent entry */ --#define ATF_PUBL 0x08 /* publish entry */ --#define ATF_USETRAILERS 0x10 /* has requested trailers */ --#define ATF_NETMASK 0x20 /* want to use a netmask (only -- for proxy entries) */ --#define ATF_DONTPUB 0x40 /* don't answer this addresses */ -- --/* -- * This structure defines an ethernet arp header. -- */ -- --struct arphdr { -- __be16 ar_hrd; /* format of hardware address */ -- __be16 ar_pro; /* format of protocol address */ -- unsigned char ar_hln; /* length of hardware address */ -- unsigned char ar_pln; /* length of protocol address */ -- __be16 ar_op; /* ARP opcode (command) */ -- --#if 0 -- /* -- * Ethernet looks like this : This bit is variable sized however... -- */ -- unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */ -- unsigned char ar_sip[4]; /* sender IP address */ -- unsigned char ar_tha[ETH_ALEN]; /* target hardware address */ -- unsigned char ar_tip[4]; /* target IP address */ --#endif -- --}; -- -- --#endif /* _UAPI_LINUX_IF_ARP_H */ -diff --git a/src/basic/meson.build b/src/basic/meson.build -index ae01beaeaa..feb4e75b74 100644 ---- a/src/basic/meson.build -+++ b/src/basic/meson.build -@@ -95,7 +95,6 @@ basic_sources = files(''' - linux/fou.h - linux/if.h - linux/if_addr.h -- linux/if_arp.h - linux/if_bonding.h - linux/if_bridge.h - linux/if_ether.h --- -2.37.2 - diff --git a/recipes/libsystemd/all/patches/246.16/0002-meson.build-change-operator-combining-bools-from-to-.patch b/recipes/libsystemd/all/patches/246.16/0002-meson.build-change-operator-combining-bools-from-to-.patch deleted file mode 100644 index 8ad824a0820d5..0000000000000 --- a/recipes/libsystemd/all/patches/246.16/0002-meson.build-change-operator-combining-bools-from-to-.patch +++ /dev/null @@ -1,34 +0,0 @@ -From eda62b3f67ce3ae5d1ddf281034a66bcf6c74933 Mon Sep 17 00:00:00 2001 -From: Dan Streetman -Date: Fri, 3 Sep 2021 12:43:33 -0400 -Subject: [PATCH 2/2] meson.build: change operator combining bools from + to - and - -upstream meson stopped allowing combining boolean with the plus -operator, and now requires using the logical and operator - -reference: -https://github.com/mesonbuild/meson/commit/43302d3296baff6aeaf8e03f5d701b0402e37a6c - -Fixes: #20632 -(cherry picked from commit c29537f39e4f413a6cbfe9669fa121bdd6d8b36f) ---- - meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 77da8a4504..3754e89c24 100644 ---- a/meson.build -+++ b/meson.build -@@ -40,7 +40,7 @@ conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path) - - want_ossfuzz = get_option('oss-fuzz') - want_libfuzzer = get_option('llvm-fuzz') --if want_ossfuzz + want_libfuzzer > 1 -+if want_ossfuzz and want_libfuzzer - error('only one of oss-fuzz or llvm-fuzz can be specified') - endif - --- -2.37.2 - diff --git a/recipes/libsystemd/all/patches/246.16/0003-Remove-dependency-from-coreutils.patch b/recipes/libsystemd/all/patches/246.16/0003-Remove-dependency-from-coreutils.patch deleted file mode 100644 index 9aa5388102343..0000000000000 --- a/recipes/libsystemd/all/patches/246.16/0003-Remove-dependency-from-coreutils.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 39d419d89e069213ec3bce9390df26de68f41135 Mon Sep 17 00:00:00 2001 -From: Sergey Bobrenok -Date: Thu, 18 Aug 2022 21:51:58 +0300 -Subject: [PATCH] Remove dependency from coreutils - -In a conan recipe we already know the relative path to the source directory. We -can simply replace '@CONAN_SRC_REL_PATH@' with the actual path there. ---- - meson.build | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/meson.build b/meson.build -index 77da8a4504..08560292a1 100644 ---- a/meson.build -+++ b/meson.build -@@ -33,9 +33,7 @@ substs.set('PROJECT_VERSION', meson.project_version(), - # the wrong result when systemd is being built as a meson subproject - project_source_root = meson.current_source_dir() - project_build_root = meson.current_build_dir() --relative_source_path = run_command('realpath', -- '--relative-to=@0@'.format(project_build_root), -- project_source_root).stdout().strip() -+relative_source_path = @CONAN_SRC_REL_PATH@ - conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path) - - want_ossfuzz = get_option('oss-fuzz') --- -2.37.2 - diff --git a/recipes/libsystemd/all/patches/247.13/0001-Remove-dependency-from-coreutils.patch b/recipes/libsystemd/all/patches/247.13/0001-Remove-dependency-from-coreutils.patch deleted file mode 100644 index 4114c124814c8..0000000000000 --- a/recipes/libsystemd/all/patches/247.13/0001-Remove-dependency-from-coreutils.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 2dbb0fe320ca75e7e2be6eba8b5fe6fe07a1ece1 Mon Sep 17 00:00:00 2001 -From: Sergey Bobrenok -Date: Thu, 18 Aug 2022 21:51:58 +0300 -Subject: [PATCH] Remove dependency from coreutils - -In a conan recipe we already know the relative path to the source directory. We -can simply replace '@CONAN_SRC_REL_PATH@' with the actual path there. ---- - meson.build | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/meson.build b/meson.build -index 177cd4fb66..869c2352f6 100644 ---- a/meson.build -+++ b/meson.build -@@ -33,9 +33,7 @@ substs.set('PROJECT_VERSION', meson.project_version(), - # the wrong result when systemd is being built as a meson subproject - project_source_root = meson.current_source_dir() - project_build_root = meson.current_build_dir() --relative_source_path = run_command('realpath', -- '--relative-to=@0@'.format(project_build_root), -- project_source_root).stdout().strip() -+relative_source_path = @CONAN_SRC_REL_PATH@ - conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path) - - conf.set('BUILD_MODE', 'BUILD_MODE_' + get_option('mode').to_upper(), - -base-commit: bb47600aeb38c68c857fbf0ee5f66c3144dd81ce --- -2.40.1 - diff --git a/recipes/libsystemd/all/patches/248.12/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch b/recipes/libsystemd/all/patches/248.12/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch deleted file mode 100644 index b040e39278226..0000000000000 --- a/recipes/libsystemd/all/patches/248.12/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch +++ /dev/null @@ -1,32 +0,0 @@ -From e8ff65fb110f1a1118ab709fe41e1c3dff0b3c40 Mon Sep 17 00:00:00 2001 -From: Sergey Bobrenok -Date: Wed, 17 Aug 2022 22:31:13 +0300 -Subject: [PATCH] missing_syscalls.py: Replace unicode with ascii - -In some system configurations 'find_program('missing_syscalls.py')' may -fail with error: - 'ascii' codec can't decode byte 0xe2 in position 615: ordinal not in range(128) - Unusable script 'src/basic/missing_syscalls.py' - Program missing_syscalls.py found: NO ---- - src/basic/missing_syscalls.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/basic/missing_syscalls.py b/src/basic/missing_syscalls.py -index 1bfa31ba37..cc353fe723 100644 ---- a/src/basic/missing_syscalls.py -+++ b/src/basic/missing_syscalls.py -@@ -32,7 +32,7 @@ def dictify(f): - - @dictify - def parse_syscall_table(filename): -- print(f'Reading {filename}…') -+ print(f'Reading {filename}...') - for line in open(filename): - items = line.split() - if len(items) >= 2: - -base-commit: 786df410b1cb3a2294c9a5d118c958525e7439e6 --- -2.40.1 - diff --git a/recipes/libsystemd/all/patches/249.16/0001-Remove-dependency-from-coreutils.patch b/recipes/libsystemd/all/patches/249.16/0001-Remove-dependency-from-coreutils.patch deleted file mode 100644 index 1df9689ea3a32..0000000000000 --- a/recipes/libsystemd/all/patches/249.16/0001-Remove-dependency-from-coreutils.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 08ad698a1b3f7c1caf9dac54c68c2878c664ceec Mon Sep 17 00:00:00 2001 -From: Sergey Bobrenok -Date: Thu, 18 Aug 2022 21:51:58 +0300 -Subject: [PATCH] Remove dependency from coreutils - -In a conan recipe we already know the relative path to the source directory. We -can simply replace '@CONAN_SRC_REL_PATH@' with the actual path there. ---- - meson.build | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/meson.build b/meson.build -index ece21fbd10..aefc82513e 100644 ---- a/meson.build -+++ b/meson.build -@@ -25,9 +25,7 @@ conf.set('PROJECT_VERSION', meson.project_version(), - # the wrong result when systemd is being built as a meson subproject - project_source_root = meson.current_source_dir() - project_build_root = meson.current_build_dir() --relative_source_path = run_command('realpath', -- '--relative-to=@0@'.format(project_build_root), -- project_source_root).stdout().strip() -+relative_source_path = @CONAN_SRC_REL_PATH@ - conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path) - - conf.set10('BUILD_MODE_DEVELOPER', get_option('mode') == 'developer', - -base-commit: 358552f75f0ef03af2d6d0ba0f5423f17eab7f84 --- -2.40.1 - diff --git a/recipes/libsystemd/config.yml b/recipes/libsystemd/config.yml index 84d8505540435..9218790a9e1ee 100644 --- a/recipes/libsystemd/config.yml +++ b/recipes/libsystemd/config.yml @@ -1,4 +1,6 @@ versions: + "255.7": + folder: all "255.2": folder: all "255": @@ -9,15 +11,3 @@ versions: folder: all "253.6": folder: all - "252.12": - folder: all - "251.18": - folder: all - "249.16": - folder: all - "248.12": - folder: all - "247.13": - folder: all - "246.16": - folder: all diff --git a/recipes/libtorrent/all/conandata.yml b/recipes/libtorrent/all/conandata.yml index c7cf929c7aa2c..f3e1e6a5c8ef1 100644 --- a/recipes/libtorrent/all/conandata.yml +++ b/recipes/libtorrent/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.10": + url: "https://github.com/arvidn/libtorrent/releases/download/v2.0.10/libtorrent-rasterbar-2.0.10.tar.gz" + sha256: "fc935b8c1daca5c0a4d304bff59e64e532be16bb877c012aea4bda73d9ca885d" "2.0.9": url: "https://github.com/arvidn/libtorrent/releases/download/v2.0.9/libtorrent-rasterbar-2.0.9.tar.gz" sha256: "90cd92b6061c5b664840c3d5e151d43fedb24f5b2b24e14425ffbb884ef1798e" diff --git a/recipes/libtorrent/all/conanfile.py b/recipes/libtorrent/all/conanfile.py index f21e595615c63..35190c929ad49 100644 --- a/recipes/libtorrent/all/conanfile.py +++ b/recipes/libtorrent/all/conanfile.py @@ -187,9 +187,9 @@ def package_info(self): self.cpp_info.components["libtorrent-rasterbar"].requires.append("libiconv::libiconv") if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["dl", "pthread"] + self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["dl", "pthread", "m"] elif self.settings.os == "Windows": - self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["wsock32", "ws2_32", "iphlpapi", "dbghelp"] + self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["wsock32", "ws2_32", "iphlpapi", "dbghelp", "mswsock"] elif self.settings.os == "Macos": self.cpp_info.components["libtorrent-rasterbar"].frameworks = ["CoreFoundation", "SystemConfiguration"] diff --git a/recipes/libtorrent/config.yml b/recipes/libtorrent/config.yml index dd7ddb590b4ae..debcafe432f02 100644 --- a/recipes/libtorrent/config.yml +++ b/recipes/libtorrent/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.10": + folder: "all" "2.0.9": folder: "all" "2.0.8": diff --git a/recipes/libunwind/all/conandata.yml b/recipes/libunwind/all/conandata.yml index 642e7bcf9b975..efd030d0bf16c 100644 --- a/recipes/libunwind/all/conandata.yml +++ b/recipes/libunwind/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.1": + url: "https://github.com/libunwind/libunwind/releases/download/v1.8.1/libunwind-1.8.1.tar.gz" + sha256: "ddf0e32dd5fafe5283198d37e4bf9decf7ba1770b6e7e006c33e6df79e6a6157" "1.8.0": url: "https://github.com/libunwind/libunwind/releases/download/v1.8.0/libunwind-1.8.0.tar.gz" sha256: "b6b3df40a0970c8f2865fb39aa2af7b5d6f12ad6c5774e266ccca4d6b8b72268" diff --git a/recipes/libunwind/all/conanfile.py b/recipes/libunwind/all/conanfile.py index 002c9bf613f23..d96b4cec23a07 100644 --- a/recipes/libunwind/all/conanfile.py +++ b/recipes/libunwind/all/conanfile.py @@ -2,7 +2,14 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import cross_building from conan.tools.env import VirtualRunEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.files import ( + apply_conandata_patches, + copy, + export_conandata_patches, + get, + rm, + rmdir, +) from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps from conan.tools.layout import basic_layout @@ -11,6 +18,7 @@ required_conan_version = ">=1.53.0" + class LiunwindConan(ConanFile): name = "libunwind" description = "Manipulate the preserved state of each call-frame and resume the execution at any point." @@ -59,7 +67,9 @@ def requirements(self): def validate(self): if self.settings.os not in ["Linux", "FreeBSD"]: - raise ConanInvalidConfiguration("libunwind is only supported on Linux and FreeBSD") + raise ConanInvalidConfiguration( + "libunwind is only supported on Linux and FreeBSD" + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -71,15 +81,17 @@ def generate(self): tc = AutotoolsToolchain(self) yes_no = lambda v: "yes" if v else "no" - tc.configure_args.extend([ - f"--enable-coredump={yes_no(self.options.coredump)}", - f"--enable-ptrace={yes_no(self.options.ptrace)}", - f"--enable-setjmp={yes_no(self.options.setjmp)}", - f"--enable-minidebuginfo={yes_no(self.options.minidebuginfo)}", - f"--enable-zlibdebuginfo={yes_no(self.options.zlibdebuginfo)}", - "--disable-tests", - "--disable-documentation", - ]) + tc.configure_args.extend( + [ + f"--enable-coredump={yes_no(self.options.coredump)}", + f"--enable-ptrace={yes_no(self.options.ptrace)}", + f"--enable-setjmp={yes_no(self.options.setjmp)}", + f"--enable-minidebuginfo={yes_no(self.options.minidebuginfo)}", + f"--enable-zlibdebuginfo={yes_no(self.options.zlibdebuginfo)}", + "--disable-tests", + "--disable-documentation", + ] + ) tc.generate() tc = AutotoolsDeps(self) @@ -92,7 +104,12 @@ def build(self): autotools.make() def package(self): - copy(self, pattern="COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy( + self, + pattern="COPYING", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + ) autotools = Autotools(self) autotools.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) @@ -102,8 +119,10 @@ def package(self): # As this seems to be unnecessary for the conan package. # rename the real file to libunwind_generic, lib_ext = "so" if self.options.shared else "a" - symlink_path = os.path.join(self.package_folder, "lib", f"libunwind-generic.{lib_ext}") - source_path = os.path.realpath(symlink_path) + symlink_path = os.path.join( + self.package_folder, "lib", f"libunwind-generic.{lib_ext}" + ) + source_path = os.path.realpath(symlink_path) rm(self, os.path.basename(symlink_path), os.path.dirname(symlink_path)) shutil.copy(source_path, symlink_path) @@ -116,18 +135,26 @@ def package_info(self): self.cpp_info.components["unwind"].requires.append("zlib::zlib") if self.settings.os == "Linux": self.cpp_info.components["unwind"].system_libs.append("pthread") - self.cpp_info.components["generic"].set_property("pkg_config_name", "libunwind-generic") + self.cpp_info.components["generic"].set_property( + "pkg_config_name", "libunwind-generic" + ) self.cpp_info.components["generic"].libs = ["unwind-generic"] self.cpp_info.components["generic"].requires = ["unwind"] if self.options.ptrace: - self.cpp_info.components["ptrace"].set_property("pkg_config_name", "libunwind-ptrace") + self.cpp_info.components["ptrace"].set_property( + "pkg_config_name", "libunwind-ptrace" + ) self.cpp_info.components["ptrace"].libs = ["unwind-ptrace"] self.cpp_info.components["ptrace"].requires = ["generic", "unwind"] if self.options.setjmp: - self.cpp_info.components["setjmp"].set_property("pkg_config_name", "libunwind-setjmp") + self.cpp_info.components["setjmp"].set_property( + "pkg_config_name", "libunwind-setjmp" + ) self.cpp_info.components["setjmp"].libs = ["unwind-setjmp"] self.cpp_info.components["setjmp"].requires = ["unwind"] if self.options.coredump: - self.cpp_info.components["coredump"].set_property("pkg_config_name", "libunwind-coredump") + self.cpp_info.components["coredump"].set_property( + "pkg_config_name", "libunwind-coredump" + ) self.cpp_info.components["coredump"].libs = ["unwind-coredump"] self.cpp_info.components["coredump"].requires = ["generic", "unwind"] diff --git a/recipes/libunwind/config.yml b/recipes/libunwind/config.yml index 272599e8759c3..2132c142d0b3f 100644 --- a/recipes/libunwind/config.yml +++ b/recipes/libunwind/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.1": + folder: all "1.8.0": folder: all "1.7.2": diff --git a/recipes/liburing/all/conandata.yml b/recipes/liburing/all/conandata.yml index 48e308169639a..f516fa5c32370 100644 --- a/recipes/liburing/all/conandata.yml +++ b/recipes/liburing/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.6": + url: "https://github.com/axboe/liburing/archive/liburing-2.6.tar.gz" + sha256: "682f06733e6db6402c1f904cbbe12b94942a49effc872c9e01db3d7b180917cc" "2.5": url: "https://github.com/axboe/liburing/archive/liburing-2.5.tar.gz" sha256: "456f5f882165630f0dc7b75e8fd53bd01a955d5d4720729b4323097e6e9f2a98" @@ -20,34 +23,37 @@ sources: "0.7": url: "https://github.com/axboe/liburing/archive/liburing-0.7.tar.gz" sha256: "8e2842cfe947f3a443af301bdd6d034455536c38a455c7a700d0c1ad165a7543" - patches: - "0.7": - - patch_file: "patches/liburing-0.7-disable_samples_and_tests.patch" + "2.6": + - patch_file: "patches/liburing-2.4-disable_samples_and_tests.patch" patch_description: "Disable tests and samples as it might not work while cross-compiling" patch_type: "conan" - "2.0": - - patch_file: "patches/liburing-2.0-disable_samples_and_tests.patch" + "2.5": + - patch_file: "patches/liburing-2.4-disable_samples_and_tests.patch" patch_description: "Disable tests and samples as it might not work while cross-compiling" patch_type: "conan" - "2.1": - - patch_file: "patches/0001-liburing-2.1-memfd-create.patch" - - patch_file: "patches/liburing-2.0-disable_samples_and_tests.patch" + "2.4": + - patch_file: "patches/liburing-2.4-disable_samples_and_tests.patch" patch_description: "Disable tests and samples as it might not work while cross-compiling" patch_type: "conan" - "2.2": + "2.3": - patch_file: "patches/liburing-2.2-disable_samples_and_tests.patch" patch_description: "Disable tests and samples as it might not work while cross-compiling" patch_type: "conan" - "2.3": + "2.2": - patch_file: "patches/liburing-2.2-disable_samples_and_tests.patch" patch_description: "Disable tests and samples as it might not work while cross-compiling" patch_type: "conan" - "2.4": - - patch_file: "patches/liburing-2.4-disable_samples_and_tests.patch" + "2.1": + - patch_file: "patches/0001-liburing-2.1-memfd-create.patch" + - patch_file: "patches/liburing-2.0-disable_samples_and_tests.patch" patch_description: "Disable tests and samples as it might not work while cross-compiling" patch_type: "conan" - "2.5": - - patch_file: "patches/liburing-2.4-disable_samples_and_tests.patch" + "2.0": + - patch_file: "patches/liburing-2.0-disable_samples_and_tests.patch" + patch_description: "Disable tests and samples as it might not work while cross-compiling" + patch_type: "conan" + "0.7": + - patch_file: "patches/liburing-0.7-disable_samples_and_tests.patch" patch_description: "Disable tests and samples as it might not work while cross-compiling" patch_type: "conan" diff --git a/recipes/liburing/all/conanfile.py b/recipes/liburing/all/conanfile.py index c90a304cde4c7..512644ac2e579 100644 --- a/recipes/liburing/all/conanfile.py +++ b/recipes/liburing/all/conanfile.py @@ -11,14 +11,14 @@ class Liburing(ConanFile): name = "liburing" - license = "GPL-2.0-or-later" - homepage = "https://github.com/axboe/liburing" - url = "https://github.com/conan-io/conan-center-index" description = ("helpers to setup and teardown io_uring instances, and also a simplified interface for " "applications that don't need (or want) to deal with the full kernel side implementation.") + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/axboe/liburing" topics = ("asynchronous-io", "async", "kernel") - settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "fPIC": [True, False], "shared": [True, False], @@ -53,8 +53,7 @@ def validate(self): # FIXME: use kernel version of build/host machine. # kernel version should be encoded in profile if self.settings.os != "Linux": - raise ConanInvalidConfiguration( - "liburing is supported only on linux") + raise ConanInvalidConfiguration(f"{self.ref} is supported only on linux") def layout(self): basic_layout(self, src_folder='src') diff --git a/recipes/liburing/config.yml b/recipes/liburing/config.yml index d47042c99f1bb..72a1f513df458 100644 --- a/recipes/liburing/config.yml +++ b/recipes/liburing/config.yml @@ -1,4 +1,6 @@ versions: + "2.6": + folder: all "2.5": folder: all "2.4": diff --git a/recipes/libva/all/conandata.yml b/recipes/libva/all/conandata.yml index da7a69068bfd9..b9410dc0ab2cf 100644 --- a/recipes/libva/all/conandata.yml +++ b/recipes/libva/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.21.0": + url: "https://github.com/intel/libva/archive/refs/tags/2.21.0.tar.gz" + sha256: "f7c3fffef3f04eb146e036dad2587d852bfb70e4926d014bf437244915ef7425" "2.20.0": url: "https://github.com/intel/libva/archive/refs/tags/2.20.0.tar.gz" sha256: "117f8d658a5fc9ea406ca80a3eb4ae1d70b15a54807c9ed77199c812bed73b60" diff --git a/recipes/libva/all/conanfile.py b/recipes/libva/all/conanfile.py index 4020db9e7c63e..d92edb9da1d88 100644 --- a/recipes/libva/all/conanfile.py +++ b/recipes/libva/all/conanfile.py @@ -1,15 +1,16 @@ +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain -import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.60.0 <2 || >=2.0.6" class PackageConan(ConanFile): @@ -37,6 +38,10 @@ class PackageConan(ConanFile): "with_win32": True, } + @property + def _has_build_profile(self): + return hasattr(self, "settings_build") + def export_sources(self): export_conandata_patches(self) @@ -76,9 +81,9 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} can not be built without at least one backend dev files.") def build_requirements(self): - if self.options.get_safe("with_wayland"): - self.tool_requires("wayland/1.22.0") - self.tool_requires("meson/1.3.1") + if self.options.get_safe("with_wayland") and self._has_build_profile: + self.tool_requires("wayland/") + self.tool_requires("meson/1.3.2") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/2.1.0") @@ -90,14 +95,30 @@ def generate(self): tc.project_options["disable_drm"] = not self.options.get_safe("with_drm") for opt in ['with_x11', 'with_glx', 'with_wayland', 'with_win32']: tc.project_options[opt] = "yes" if self.options.get_safe(opt) else "no" + tc.project_options["build.pkg_config_path"] = self.generators_folder tc.generate() - tc = PkgConfigDeps(self) - tc.generate() + pkg_config_deps = PkgConfigDeps(self) + if self.options.get_safe("with_wayland") and self._has_build_profile: + pkg_config_deps.build_context_activated = ["wayland"] + pkg_config_deps.build_context_suffix = {"wayland": "_BUILD"} + pkg_config_deps.generate() tc = VirtualBuildEnv(self) tc.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + if self.options.get_safe("with_wayland") and self._has_build_profile: + # Patch the build system to use the pkg-config files generated for the build context. + meson_build_file = os.path.join(self.source_folder, "meson.build") + replace_in_file( + self, + meson_build_file, + "wayland_scanner_dep = dependency('wayland-scanner',", + "wayland_scanner_dep = dependency('wayland-scanner_BUILD',", + ) + + def build(self): + self._patch_sources() meson = Meson(self) meson.configure() meson.build() diff --git a/recipes/libva/all/test_package/conanfile.py b/recipes/libva/all/test_package/conanfile.py index abc9920da73b3..d0b998814a4e8 100644 --- a/recipes/libva/all/test_package/conanfile.py +++ b/recipes/libva/all/test_package/conanfile.py @@ -8,6 +8,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/libva/config.yml b/recipes/libva/config.yml index bb6ad1a3e3dc2..d0c85671c9e11 100644 --- a/recipes/libva/config.yml +++ b/recipes/libva/config.yml @@ -1,3 +1,5 @@ versions: + "2.21.0": + folder: all "2.20.0": folder: all diff --git a/recipes/libvault/all/conandata.yml b/recipes/libvault/all/conandata.yml index fad4071cba2ec..bfc950b624ab9 100644 --- a/recipes/libvault/all/conandata.yml +++ b/recipes/libvault/all/conandata.yml @@ -1,23 +1,4 @@ sources: - "0.52.0": - url: "https://github.com/abedra/libvault/archive/refs/tags/0.52.0.zip" - sha256: 49058ac9a1d3d1d08ac165f5f7b50e3a2a2ab0d3f9b8bb8194fa7a8de36edcf8 - "0.51.0": - url: "https://github.com/abedra/libvault/archive/refs/tags/0.51.0.zip" - sha256: 570ccc6451cf8e93b1c585bbf6ab5212ff9290b3a9b477752cf0651414b3d026 - "0.48.0": - url: "https://github.com/abedra/libvault/archive/0.48.0.zip" - sha256: 0a42be282ff0aff77b68cb7238014aa762df5c6b62e4d3561878874ca3760489 -patches: - "0.52.0": - - patch_file: "patches/0.52.0-0001-fix-cmake.patch" - patch_type: "conan" - patch_description: "use libcurl from conan center" - "0.51.0": - - patch_file: "patches/0.51.0-0001-fix-cmake.patch" - patch_type: "conan" - patch_description: "use libcurl from conan center" - "0.48.0": - - patch_file: "patches/0.48.0-0001-fix-cmake.patch" - patch_type: "conan" - patch_description: "use libcurl from conan center" + "0.59.0": + url: "https://github.com/abedra/libvault/archive/refs/tags/0.59.0.zip" + sha256: 668e71e1689f6142735387989042945e42fd6e0483f223ce3a08121887a335ce diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 408c16f6dbb3b..98c9c4d3f5c6b 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -5,7 +5,8 @@ from conan.tools.apple import is_apple_os from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.files import copy, get, rmdir, replace_in_file +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version required_conan_version = ">=1.54.0" @@ -33,8 +34,19 @@ class LibvaultConan(ConanFile): def _mac_os_minimum_required_version(self): return "10.15" - def export_sources(self): - export_conandata_patches(self) + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7.0", + "apple-clang": "12", + } def config_options(self): if self.settings.os == "Windows": @@ -49,29 +61,18 @@ def layout(self): def requirements(self): # public header VaultClient.h includes curl/curl.h and use several functions - self.requires("libcurl/[>=7.78.0 <9]", transitive_headers=True, transitive_libs=True) + self.requires("libcurl/[>=7.78.0 <9]", transitive_headers=True) def validate(self): - compiler = str(self.settings.compiler) - compiler_version = Version(self.settings.compiler.version.value) - - minimum_compiler_version = { - "Visual Studio": "16", - "msvc": "192", - "gcc": "8", - "clang": "7.0", - "apple-clang": "12", - } - - minimum_cpp_standard = 17 - - if compiler in minimum_compiler_version and \ - compiler_version < minimum_compiler_version[compiler]: + 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.name} requires a compiler that supports at least C++{minimum_cpp_standard}. " - f"{compiler} {compiler_version} is not supported.") + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) - if compiler == "clang" and self.settings.compiler.libcxx in ["libstdc++", "libstdc++11"] and self.settings.compiler.version == "11": + if self.settings.compiler == "clang" and self.settings.compiler.libcxx in ["libstdc++", "libstdc++11"] and self.settings.compiler.version == "11": raise ConanInvalidConfiguration("clang 11 with libstdc++ is not supported due to old libstdc++ missing C++17 support") if is_apple_os(self): @@ -80,9 +81,6 @@ def validate(self): raise ConanInvalidConfiguration( "Macos Mojave (10.14) and earlier cannot to be built because C++ standard library too old.") - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, minimum_cpp_standard) - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -91,12 +89,24 @@ def generate(self): tc.variables["ENABLE_TEST"] = False tc.variables["ENABLE_INTEGRATION_TEST"] = False tc.variables["ENABLE_COVERAGE"] = False + tc.variables["LINK_CURL"] = True + tc.variables["CMAKE_OSX_DEPLOYMENT_TARGET"] = self._mac_os_minimum_required_version + + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + tc = CMakeDeps(self) tc.generate() - deps = CMakeDeps(self) - deps.generate() + + def _patch_sources(self): + # INFO: https://github.com/abedra/libvault/pull/123 + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "target_link_libraries(vault curl)", + "target_link_libraries(vault CURL::libcurl)") def build(self): - apply_conandata_patches(self) + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -112,6 +122,7 @@ def package_info(self): self.cpp_info.libs = ["vault"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": self.cpp_info.system_libs.append("stdc++fs") diff --git a/recipes/libvault/all/patches/0.48.0-0001-fix-cmake.patch b/recipes/libvault/all/patches/0.48.0-0001-fix-cmake.patch deleted file mode 100644 index df2816ee6d88d..0000000000000 --- a/recipes/libvault/all/patches/0.48.0-0001-fix-cmake.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,10 +1,6 @@ - cmake_minimum_required(VERSION 3.12) - project(vault VERSION 0.48.0 DESCRIPTION "Vault library for C++") - --set(CMAKE_CXX_STANDARD 17) --set(CMAKE_CXX_STANDARD_REQUIRED ON) --set(CMAKE_CXX_EXTENSIONS OFF) --set(CMAKE_CXX_FLAGS_DEBUG --coverage) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - - option(ENABLE_TEST "Enable tests?" ON) -@@ -14,12 +10,7 @@ option(LINK_CURL "Link curl library for vault" OFF) - option(BUILD_SHARED_LIBS "Build vault as a shared library" ON) - option(INSTALL "Run install targets" ON) - --find_package(CURL) --if (CURL_FOUND) -- include_directories(${CURL_INCLUDE_DIR}) --else (CURL_FOUND) -- message(FATAL_ERROR "CURL not found") --endif (CURL_FOUND) -+find_package(CURL REQUIRED) - - include(GNUInstallDirs) - include_directories("${PROJECT_SOURCE_DIR}/lib") -@@ -120,9 +111,11 @@ set_target_properties(vault PROPERTIES - - target_include_directories(vault PRIVATE src) - --if(LINK_CURL) -- target_link_libraries(vault curl) --endif(LINK_CURL) -+target_link_libraries(vault PUBLIC CURL::libcurl) -+target_compile_features(vault PUBLIC cxx_std_17) -+if(WIN32) -+ set_target_properties(vault PROPERTIES RUNTIME_OUTPUT_NAME "VaultClient") -+endif() - - if (ENABLE_COVERAGE) - target_link_libraries(vault gcov) diff --git a/recipes/libvault/all/patches/0.51.0-0001-fix-cmake.patch b/recipes/libvault/all/patches/0.51.0-0001-fix-cmake.patch deleted file mode 100644 index 2ff417c356ac8..0000000000000 --- a/recipes/libvault/all/patches/0.51.0-0001-fix-cmake.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,9 +1,6 @@ - cmake_minimum_required(VERSION 3.12) - project(vault VERSION 0.51.0 DESCRIPTION "Vault library for C++") - --set(CMAKE_CXX_STANDARD 17) --set(CMAKE_CXX_STANDARD_REQUIRED ON) --set(CMAKE_CXX_EXTENSIONS OFF) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - - option(ENABLE_TEST "Enable tests?" ON) -@@ -13,12 +10,7 @@ option(LINK_CURL "Link curl library for vault" OFF) - option(BUILD_SHARED_LIBS "Build vault as a shared library" ON) - option(INSTALL "Run install targets" ON) - --find_package(CURL) --if (CURL_FOUND) -- include_directories(${CURL_INCLUDE_DIR}) --else (CURL_FOUND) -- message(FATAL_ERROR "CURL not found") --endif (CURL_FOUND) -+find_package(CURL REQUIRED) - - include(GNUInstallDirs) - include_directories("${PROJECT_SOURCE_DIR}/lib") -@@ -119,9 +111,11 @@ set_target_properties(vault PROPERTIES - - target_include_directories(vault PRIVATE src) - --if(LINK_CURL) -- target_link_libraries(vault curl) --endif(LINK_CURL) -+target_link_libraries(vault PUBLIC CURL::libcurl) -+target_compile_features(vault PUBLIC cxx_std_17) -+if(WIN32) -+ set_target_properties(vault PROPERTIES RUNTIME_OUTPUT_NAME "VaultClient") -+endif() - - if (ENABLE_COVERAGE) - target_link_libraries(vault gcov) diff --git a/recipes/libvault/all/patches/0.52.0-0001-fix-cmake.patch b/recipes/libvault/all/patches/0.52.0-0001-fix-cmake.patch deleted file mode 100644 index 70b3ab582fcdc..0000000000000 --- a/recipes/libvault/all/patches/0.52.0-0001-fix-cmake.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,9 +1,6 @@ - cmake_minimum_required(VERSION 3.12) - project(vault VERSION 0.52.0 DESCRIPTION "Vault library for C++") - --set(CMAKE_CXX_STANDARD 17) --set(CMAKE_CXX_STANDARD_REQUIRED ON) --set(CMAKE_CXX_EXTENSIONS OFF) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - - option(ENABLE_TEST "Enable tests?" ON) -@@ -13,12 +10,7 @@ option(LINK_CURL "Link curl library for vault" OFF) - option(BUILD_SHARED_LIBS "Build vault as a shared library" ON) - option(INSTALL "Run install targets" ON) - --find_package(CURL) --if (CURL_FOUND) -- include_directories(${CURL_INCLUDE_DIR}) --else (CURL_FOUND) -- message(FATAL_ERROR "CURL not found") --endif (CURL_FOUND) -+find_package(CURL REQUIRED) - - include(GNUInstallDirs) - include_directories("${PROJECT_SOURCE_DIR}/lib") -@@ -119,9 +111,11 @@ set_target_properties(vault PROPERTIES - - target_include_directories(vault PRIVATE src) - --if(LINK_CURL) -- target_link_libraries(vault curl) --endif(LINK_CURL) -+target_link_libraries(vault PUBLIC CURL::libcurl) -+target_compile_features(vault PUBLIC cxx_std_17) -+if(WIN32) -+ set_target_properties(vault PROPERTIES RUNTIME_OUTPUT_NAME "VaultClient") -+endif() - - if (ENABLE_COVERAGE) - target_link_libraries(vault gcov) diff --git a/recipes/libvault/config.yml b/recipes/libvault/config.yml index 327b1962634e5..06bedb729ed91 100644 --- a/recipes/libvault/config.yml +++ b/recipes/libvault/config.yml @@ -1,7 +1,3 @@ versions: - "0.52.0": - folder: "all" - "0.51.0": - folder: "all" - "0.48.0": + "0.59.0": folder: "all" diff --git a/recipes/libvips/all/conandata.yml b/recipes/libvips/all/conandata.yml index ebae63c90e5b2..ef20d5b718d8d 100644 --- a/recipes/libvips/all/conandata.yml +++ b/recipes/libvips/all/conandata.yml @@ -1,6 +1,6 @@ sources: "8.15.2": - url: "https://github.com/libvips/libvips/releases/download/v8.15.2a/vips-8.15.2.tar.xz" + url: "https://github.com/libvips/libvips/releases/download/v8.15.2/vips-8.15.2.tar.xz" sha256: "a2ab15946776ca7721d11cae3215f20f1f097b370ff580cd44fc0f19387aee84" "8.15.1": url: "https://github.com/libvips/libvips/releases/download/v8.15.1/vips-8.15.1.tar.xz" diff --git a/recipes/libvips/all/conanfile.py b/recipes/libvips/all/conanfile.py index 4e2008334f2bb..bad73d4834f39 100644 --- a/recipes/libvips/all/conanfile.py +++ b/recipes/libvips/all/conanfile.py @@ -126,7 +126,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") self.requires("glib/2.78.3", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_archive"): self.requires("libarchive/3.7.2") @@ -139,7 +139,7 @@ def requirements(self): if self.options.with_fftw: self.requires("fftw/3.3.10") if self.options.with_fontconfig: - self.requires("fontconfig/2.14.2") + self.requires("fontconfig/2.15.0") if self.options.with_heif: self.requires("libheif/1.16.2") if self.options.get_safe("with_highway"): @@ -147,7 +147,7 @@ def requirements(self): if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/3.0.1") + self.requires("libjpeg-turbo/3.0.2") elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.5") if self.options.with_jpeg_xl: @@ -159,15 +159,15 @@ def requirements(self): if self.options.with_matio: self.requires("matio/1.5.24") if self.options.with_openexr: - self.requires("openexr/3.2.1") + self.requires("openexr/3.2.3") if self.options.with_openjpeg: - self.requires("openjpeg/2.5.0") + self.requires("openjpeg/2.5.2") if self.options.with_pangocairo: self.requires("pango/1.50.10") if self.options.with_pdfium: self.requires("pdfium/95.0.4629") if self.options.with_png == "libpng": - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") elif self.options.with_png == "libspng": self.requires("libspng/0.7.4") if self.options.with_poppler: @@ -215,7 +215,7 @@ def validate(self): raise ConanInvalidConfiguration("librsvg recipe not available in conancenter yet") def build_requirements(self): - self.tool_requires("meson/1.3.0") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/2.1.0") if self.options.introspection: @@ -227,7 +227,7 @@ def build_requirements(self): # a different/incompatible libiconv than the one being exposed # in the runtime environment (DYLD_LIBRARY_PATH) # See https://github.com/conan-io/conan-center-index/pull/17502#issuecomment-1542492466 - self.tool_requires("gettext/0.21") + self.tool_requires("gettext/0.22.5") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libvpx/all/conandata.yml b/recipes/libvpx/all/conandata.yml index 6d2cd13499015..a3d16e2c79679 100644 --- a/recipes/libvpx/all/conandata.yml +++ b/recipes/libvpx/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.14.0": + url: "https://github.com/webmproject/libvpx/archive/refs/tags/v1.14.0.tar.gz" + sha256: "5f21d2db27071c8a46f1725928a10227ae45c5cd1cad3727e4aafbe476e321fa" "1.13.1": url: "https://github.com/webmproject/libvpx/archive/refs/tags/v1.13.1.tar.gz" sha256: "00dae80465567272abd077f59355f95ac91d7809a2d3006f9ace2637dd429d14" diff --git a/recipes/libvpx/all/conanfile.py b/recipes/libvpx/all/conanfile.py index e53344de221a5..3752a16f55fa7 100644 --- a/recipes/libvpx/all/conanfile.py +++ b/recipes/libvpx/all/conanfile.py @@ -103,7 +103,7 @@ def _target_name(self): compiler = f"vs{vc_version}" elif is_msvc(self): vc_version = str(self.settings.compiler.version) - vc_version = {"170": "11", "180": "12", "190": "14", "191": "15", "192": "16", "193": "17"}[vc_version] + vc_version = {"170": "11", "180": "12", "190": "14", "191": "15", "192": "16", "193": "17", "194": "17"}[vc_version] compiler = f"vs{vc_version}" elif self.settings.compiler in ["gcc", "clang", "apple-clang"]: compiler = 'gcc' diff --git a/recipes/libvpx/config.yml b/recipes/libvpx/config.yml index a39af33955838..e7a6e4fc3010b 100644 --- a/recipes/libvpx/config.yml +++ b/recipes/libvpx/config.yml @@ -1,4 +1,6 @@ versions: + "1.14.0": + folder: all "1.13.1": folder: all "1.11.0": diff --git a/recipes/libwebp/all/conandata.yml b/recipes/libwebp/all/conandata.yml index 0aaa6446c5482..a68caa1df2fd9 100644 --- a/recipes/libwebp/all/conandata.yml +++ b/recipes/libwebp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.0": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.4.0.tar.gz" + sha256: "61f873ec69e3be1b99535634340d5bde750b2e4447caa1db9f61be3fd49ab1e5" "1.3.2": url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.2.tar.gz" sha256: "2a499607df669e40258e53d0ade8035ba4ec0175244869d1025d460562aa09b4" @@ -12,6 +15,10 @@ sources: url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.1.0.tar.gz" sha256: "98a052268cc4d5ece27f76572a7f50293f439c17a98e67c4ea0c7ed6f50ef043" patches: + "1.4.0": + - patch_file: "patches/1.4.0-0001-fix-cmake.patch" + patch_description: "disable PIC, disable prefix library name on MSVC" + patch_type: "conan" "1.3.2": - patch_file: "patches/1.3.1-0001-fix-cmake.patch" patch_description: "disable PIC, disable prefix library name on MSVC" diff --git a/recipes/libwebp/all/patches/1.4.0-0001-fix-cmake.patch b/recipes/libwebp/all/patches/1.4.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..f819b1e43d235 --- /dev/null +++ b/recipes/libwebp/all/patches/1.4.0-0001-fix-cmake.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ad5e14c3..89c836f3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -60,7 +60,6 @@ if(WEBP_LINK_STATIC) + else() + set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + endif() +- set(CMAKE_POSITION_INDEPENDENT_CODE ON) + # vwebp does not compile on Ubuntu with static libraries so disabling it for + # now. + set(WEBP_BUILD_VWEBP OFF) +@@ -155,7 +154,7 @@ endif() + set(PTHREAD_LIBS ${CMAKE_THREAD_LIBS_INIT}) + set(INSTALLED_LIBRARIES) + +-if(MSVC) ++if(0) + # match the naming convention used by nmake + set(webp_libname_prefix "lib") + set(CMAKE_SHARED_LIBRARY_PREFIX "${webp_libname_prefix}") diff --git a/recipes/libwebp/config.yml b/recipes/libwebp/config.yml index e184761fe568e..c2fa30e005fdd 100644 --- a/recipes/libwebp/config.yml +++ b/recipes/libwebp/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.0": + folder: all "1.3.2": folder: all "1.3.1": diff --git a/recipes/libwebsockets/all/conandata.yml b/recipes/libwebsockets/all/conandata.yml index ed95c45ed0deb..8032d01c8d8b8 100644 --- a/recipes/libwebsockets/all/conandata.yml +++ b/recipes/libwebsockets/all/conandata.yml @@ -14,12 +14,3 @@ sources: "4.2.0": url: "https://github.com/warmcat/libwebsockets/archive/v4.2.0.tar.gz" sha256: "a57e9a4765dbcd4d880feba8089b43ed69995eaf10d5d61a07981d9ddd975f40" - "4.1.6": - url: "https://github.com/warmcat/libwebsockets/archive/v4.1.6.tar.gz" - sha256: "402e9a8df553c9cd2aff5d7a9758e9e5285bf3070c82539082864633db3deb83" - "4.1.4": - url: "https://github.com/warmcat/libwebsockets/archive/v4.1.4.tar.gz" - sha256: "00da77b4b89db3e0b1a2778f756f08d55d7f6b1632e18d981fc399c412866147" - "4.0.15": - url: "https://github.com/warmcat/libwebsockets/archive/v4.0.15.tar.gz" - sha256: "adce8152c3e802b8fe71b26d7252944944c49954ba6b5ba9fbb7fa5c4aad93dc" diff --git a/recipes/libwebsockets/all/conanfile.py b/recipes/libwebsockets/all/conanfile.py index 0fd0cf66a67ea..21f493452d927 100644 --- a/recipes/libwebsockets/all/conanfile.py +++ b/recipes/libwebsockets/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanException, ConanInvalidConfiguration from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps from conan.tools.files import get, replace_in_file, rmdir, copy, save, collect_libs -from conan.tools.microsoft import is_msvc +from conan.tools.microsoft import check_min_vs, is_msvc from conan.tools.scm import Version import os import textwrap @@ -30,6 +30,7 @@ class LibwebsocketsConan(ConanFile): "with_sqlite3": [True, False], "with_libmount": [True, False], "with_hubbub": [True, False], + "with_netlink": [True, False], "ssl_client_use_os_ca_certs": [True, False], # SSL support should make use of the OS-installed CA root certs "ssl_server_with_ecdh_cert": [True, False], # Include SSL server use ECDH certificate @@ -114,6 +115,7 @@ class LibwebsocketsConan(ConanFile): "with_sqlite3": False, "with_libmount": False, "with_hubbub": False, + "with_netlink": False, "ssl_client_use_os_ca_certs": True, "ssl_server_with_ecdh_cert": False, @@ -224,8 +226,7 @@ def requirements(self): self.requires("sqlite3/3.44.2") if self.options.with_ssl == "openssl": - # Cannot add the [>=1.1 <4] range, as it seems openssl3 makes it fail - self.requires("openssl/1.1.1w", transitive_headers=True) + self.requires("openssl/[>=1.1.1w <4]", transitive_headers=True) elif self.options.with_ssl == "mbedtls": self.requires("mbedtls/3.5.0") elif self.options.with_ssl == "wolfssl": @@ -235,12 +236,8 @@ def validate(self): if self.options.shared and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": # https://github.com/conan-io/conan-center-index/pull/5321#issuecomment-826367276 raise ConanInvalidConfiguration("{}/{} shared=True with gcc<5 does not build. Please submit a PR with a fix.".format(self.name, self.version)) - if Version(self.version) <= "4.0.15" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) >= "12": - raise ConanInvalidConfiguration("{}/{} with apple-clang>=12 does not build. Please submit a PR with a fix.".format(self.name, self.version)) if Version(self.version) >= "4.3.2": - if ("Visual" in str(self.settings.compiler.version) and Version(self.settings.compiler.version) < 16) or \ - ("msvc" == str(self.settings.compiler.version) and Version(self.settings.compiler.version) < 192): - raise ConanInvalidConfiguration ("{}/{} requires at least Visual Studio 2019".format(self.name, self.version)) + check_min_vs(self, "192") if self.options.with_hubbub: raise ConanInvalidConfiguration("Library hubbub not implemented (yet) in CCI") @@ -295,11 +292,16 @@ def generate(self): tc.variables["LWS_WITH_SHARED"] = self.options.shared tc.variables["LWS_WITH_STATIC"] = not self.options.shared tc.variables["LWS_WITH_SSL"] = bool(self.options.with_ssl) + tc.variables["LWS_WITH_NETLINK"] = self.options.with_netlink + + # Allow forwarding project targets to try_compile and derivatives + tc.variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = self.settings.build_type if self.options.with_ssl == "openssl": - tc.variables["LWS_OPENSSL_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("openssl")) - tc.variables["LWS_OPENSSL_INCLUDE_DIRS"] = self._cmakify_path_list(self.dependencies["openssl"].cpp_info.includedirs) - elif self.options.with_ssl == "mbedtls": + # Ensure find_package(OpenSSL) is called early + tc.variables["CMAKE_PROJECT_libwebsockets_INCLUDE"] = os.path.join(self.source_folder, "project_include.cmake").replace('\\','/') + + if self.options.with_ssl == "mbedtls": tc.variables["LWS_WITH_MBEDTLS"] = True tc.variables["LWS_MBEDTLS_LIBRARIES"] = self._cmakify_path_list(self._find_libraries("mbedtls")) tc.variables["LWS_MBEDTLS_INCLUDE_DIRS"] = self._cmakify_path_list(self.dependencies["mbedtls"].cpp_info.includedirs) @@ -417,9 +419,8 @@ def generate(self): tc.variables["LWS_WITH_ALSA"] = False tc.variables["LWS_WITH_GTK"] = False - if Version(self.version) >= "4.1.0": - tc.variables["LWS_WITH_SYS_SMD"] = self.settings.os != "Windows" - tc.variables["DISABLE_WERROR"] = True + tc.variables["LWS_WITH_SYS_SMD"] = self.settings.os != "Windows" + tc.variables["DISABLE_WERROR"] = True tc.generate() deps = CMakeDeps(self) @@ -432,16 +433,18 @@ def _patch_sources(self): "SET(CMAKE_INSTALL_NAME_DIR \"${CMAKE_INSTALL_PREFIX}/${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}\")", "", ) - if Version(self.version) == "4.0.15" and self.options.with_ssl: - replace_in_file(self, - cmakelists, - "list(APPEND LIB_LIST ws2_32.lib userenv.lib psapi.lib iphlpapi.lib)", - "list(APPEND LIB_LIST ws2_32.lib userenv.lib psapi.lib iphlpapi.lib crypt32.lib)" - ) - if Version(self.version) < "4.1.0": - replace_in_file(self, cmakelists, "-Werror", "") - if Version(self.version) >= "4.1.4": - replace_in_file(self, cmakelists, "add_compile_options(/W3 /WX)", "add_compile_options(/W3)") + + # Early call to find_package(OpenSSL) because its referenced in different places + if self.options.with_ssl == "openssl": + project_include_file = os.path.join(self.source_folder, "project_include.cmake") + save(self, project_include_file, 'find_package(OpenSSL REQUIRED)\nset(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})') + + # Prevent locating and copying OpenSSL binaries (not needed by the recipe) + replace_in_file(self, + os.path.join(self.source_folder, "cmake", "FindOpenSSLbins.cmake"), + "if(OPENSSL_FOUND)", "if(FALSE)") + + replace_in_file(self, cmakelists, "add_compile_options(/W3 /WX)", "add_compile_options(/W3)") def build(self): self._patch_sources() diff --git a/recipes/libwebsockets/all/test_package/test_package.c b/recipes/libwebsockets/all/test_package/test_package.c index e09bc89a8abe9..a76a8da0d85c5 100644 --- a/recipes/libwebsockets/all/test_package/test_package.c +++ b/recipes/libwebsockets/all/test_package/test_package.c @@ -4,89 +4,8 @@ #include "libwebsockets.h" -static struct lws *web_socket = NULL; - -#define EXAMPLE_RX_BUFFER_BYTES (10) - -static int callback_example( struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len ) -{ - switch( reason ) - { - case LWS_CALLBACK_CLIENT_ESTABLISHED: - lws_callback_on_writable( wsi ); - break; - - case LWS_CALLBACK_CLIENT_RECEIVE: - /* Handle incomming messages here. */ - break; - - case LWS_CALLBACK_CLIENT_WRITEABLE: - { - unsigned char buf[LWS_SEND_BUFFER_PRE_PADDING + EXAMPLE_RX_BUFFER_BYTES + LWS_SEND_BUFFER_POST_PADDING]; - unsigned char *p = &buf[LWS_SEND_BUFFER_PRE_PADDING]; - size_t n = sprintf( (char *)p, "%u", rand() ); - lws_write( wsi, p, n, LWS_WRITE_TEXT ); - break; - } - - case LWS_CALLBACK_CLOSED: - case LWS_CALLBACK_CLIENT_CONNECTION_ERROR: - web_socket = NULL; - break; - - default: - break; - } - - return 0; -} - -enum protocols -{ - PROTOCOL_EXAMPLE = 0, - PROTOCOL_COUNT -}; - -static struct lws_protocols protocols[] = -{ - { - "example-protocol", - callback_example, - 0, - EXAMPLE_RX_BUFFER_BYTES, - }, - { NULL, NULL, 0, 0 } /* terminator */ -}; - -int main( int argc, char *argv[] ) -{ - struct lws_context_creation_info info; - memset( &info, 0, sizeof(info) ); - - info.port = CONTEXT_PORT_NO_LISTEN; - info.protocols = protocols; - info.gid = -1; - info.uid = -1; - - struct lws_context *context = lws_create_context( &info ); - - /* Connect if we are not connected to the server. */ - struct lws_client_connect_info ccinfo = {0}; - ccinfo.context = context; - ccinfo.address = "localhost"; - ccinfo.port = 8000; - ccinfo.path = "/"; - ccinfo.host = lws_canonical_hostname( context ); - ccinfo.origin = "origin"; - ccinfo.protocol = protocols[PROTOCOL_EXAMPLE].name; - web_socket = lws_client_connect_via_info(&ccinfo); - - /* Send a random number to the server every second. */ - lws_callback_on_writable( web_socket ); - - lws_service( context, /* timeout_ms = */ 250 ); - - lws_context_destroy( context ); - +int main() { + const char* lws_version = lws_get_library_version(); + printf("libwebsocket version: %s\n", lws_version); return 0; } diff --git a/recipes/libwebsockets/config.yml b/recipes/libwebsockets/config.yml index f20bf16edc50b..35cfe962e4082 100644 --- a/recipes/libwebsockets/config.yml +++ b/recipes/libwebsockets/config.yml @@ -9,9 +9,3 @@ versions: folder: all "4.2.0": folder: all - "4.1.6": - folder: all - "4.1.4": - folder: all - "4.0.15": - folder: all diff --git a/recipes/libxlsxwriter/all/conandata.yml b/recipes/libxlsxwriter/all/conandata.yml index 44eb2bad3dada..2cd855a6df663 100644 --- a/recipes/libxlsxwriter/all/conandata.yml +++ b/recipes/libxlsxwriter/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.7": + url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.1.7.tar.gz" + sha256: "1f378e25d8bb5be258d3e04d3d24b8c23ff21bf206e6e206661844a96ca25eda" "1.1.5": url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.1.5.tar.gz" sha256: "12843587d591cf679e6ec63ecc629245befec2951736804a837696cdb5d61946" @@ -12,6 +15,10 @@ sources: url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.0.0.tar.gz" sha256: "8b353379333c323d14a9d265cd2491d3a6c0032c8d6ec2141f10b82ab66a087c" patches: + "1.1.7": + - patch_file: "patches/1.1.7-0001-fix-cmake.patch" + patch_description: "Fix CMake: robust dependencies discovery & avoid some hardcoded flags" + patch_type: "conan" "1.1.5": - patch_file: "patches/1.1.5-0001-fix-cmake.patch" patch_description: "Fix CMake: robust dependencies discovery & avoid some hardcoded flags" diff --git a/recipes/libxlsxwriter/all/patches/1.1.7-0001-fix-cmake.patch b/recipes/libxlsxwriter/all/patches/1.1.7-0001-fix-cmake.patch new file mode 100644 index 0000000000000..715f102673099 --- /dev/null +++ b/recipes/libxlsxwriter/all/patches/1.1.7-0001-fix-cmake.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0e855c7..f38f37a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -183,9 +183,9 @@ endif() + + if(NOT BUILD_SHARED_LIBS) + if(UNIX) +- set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++# set(CMAKE_POSITION_INDEPENDENT_CODE ON) + elseif(MINGW OR MSYS) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -static-libgcc -Wno-char-subscripts -Wno-long-long") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-char-subscripts -Wno-long-long") + list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS USE_FILE32API) + elseif(MSVC) + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Fd\"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb\"") +@@ -224,7 +224,7 @@ enable_language(CXX) + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + + # ZLIB +-find_package(ZLIB "1.0" REQUIRED) ++find_package(ZLIB REQUIRED CONFIG) + list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) + message("zlib version: " ${ZLIB_VERSION}) + +@@ -294,9 +294,11 @@ target_sources(${PROJECT_NAME} + PRIVATE ${LXW_SOURCES} + PUBLIC ${LXW_HEADERS} + ) +-target_link_libraries(${PROJECT_NAME} LINK_PUBLIC ${ZLIB_LIBRARIES} ${MINIZIP_LIBRARIES} ${LIB_CRYPTO} ${OPENSSL_CRYPTO_LIBRARY}) ++target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB minizip::minizip) ++if(USE_OPENSSL_MD5) ++ target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::Crypto) ++endif() + target_compile_definitions(${PROJECT_NAME} PRIVATE ${LXW_PRIVATE_COMPILE_DEFINITIONS}) +- + # /utf-8 needs VS2015 Update 2 or above. + # In CMake 3.7 and above, we can use (MSVC_VERSION GREATER_EQUAL 1900) here. + if(MSVC AND NOT (MSVC_VERSION LESS 1900)) diff --git a/recipes/libxlsxwriter/config.yml b/recipes/libxlsxwriter/config.yml index 4690b80fd5fb3..5eb935f412b85 100644 --- a/recipes/libxlsxwriter/config.yml +++ b/recipes/libxlsxwriter/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.7": + folder: "all" "1.1.5": folder: "all" "1.1.4": diff --git a/recipes/libxml2/all/conandata.yml b/recipes/libxml2/all/conandata.yml index a0070b6bc4a60..bd46bbf386371 100644 --- a/recipes/libxml2/all/conandata.yml +++ b/recipes/libxml2/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.12.7": + url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.7.tar.xz" + sha256: "24ae78ff1363a973e6d8beba941a7945da2ac056e19b53956aeb6927fd6cfb56" + "2.12.6": + url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.6.tar.xz" + sha256: "889c593a881a3db5fdd96cc9318c87df34eb648edfc458272ad46fd607353fbb" "2.12.5": url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.5.tar.xz" sha256: "a972796696afd38073e0f59c283c3a2f5a560b5268b4babc391b286166526b21" @@ -8,12 +14,9 @@ sources: "2.12.3": url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.3.tar.xz" sha256: "8c8f1092340a89ff32bc44ad5c9693aff9bc8a7a3e161bb239666e5d15ac9aaa" - "2.12.2": - url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.2.tar.xz" - sha256: "3f2e6464fa15073eb8f3d18602d54fafc489b7715171064615a40490c6be9f4f" - "2.12.1": - url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.1.tar.xz" - sha256: "8982b9ccdf7f456e30d8f7012d50858c6623e495333b6191def455c7e95427eb" + "2.11.8": + url: "https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.8.tar.xz" + sha256: "53961af1721b72246180cd844b7ddae36ea8e1e4e27b683567990a1ee78b02c1" "2.11.7": url: "https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.7.tar.xz" sha256: "fb27720e25eaf457f94fd3d7189bcf2626c6dccf4201553bc8874d50e3560162" @@ -32,9 +35,6 @@ sources: "2.9.14": url: "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.14.tar.xz" sha256: "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee" - "2.9.13": - url: "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.13.tar.xz" - sha256: "276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e" "2.9.12": url: "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.12.tar.xz" sha256: "28a92f6ab1f311acf5e478564c49088ef0ac77090d9c719bbc5d518f1fe62eb9" diff --git a/recipes/libxml2/config.yml b/recipes/libxml2/config.yml index 1c968c066198a..512940bc70e6f 100644 --- a/recipes/libxml2/config.yml +++ b/recipes/libxml2/config.yml @@ -1,13 +1,15 @@ versions: + "2.12.7": + folder: all + "2.12.6": + folder: all "2.12.5": folder: all "2.12.4": folder: all "2.12.3": folder: all - "2.12.2": - folder: all - "2.12.1": + "2.11.8": folder: all "2.11.7": folder: all @@ -21,8 +23,6 @@ versions: folder: all "2.9.14": folder: all - "2.9.13": - folder: all "2.9.12": folder: all "2.9.10": diff --git a/recipes/libxslt/all/conanfile.py b/recipes/libxslt/all/conanfile.py index 711c11f5938b0..ebed177675bb0 100644 --- a/recipes/libxslt/all/conanfile.py +++ b/recipes/libxslt/all/conanfile.py @@ -62,7 +62,7 @@ def layout(self): def requirements(self): if Version(self.version) >= "1.1.39": # see https://github.com/conan-io/conan-center-index/pull/16205#discussion_r1149570846 - self.requires("libxml2/2.12.3", transitive_headers=True, transitive_libs=True) + self.requires("libxml2/[>=2.12.5 <3]", transitive_headers=True, transitive_libs=True) else: self.requires("libxml2/2.11.6", transitive_headers=True, transitive_libs=True) diff --git a/recipes/libyang/all/conandata.yml b/recipes/libyang/all/conandata.yml new file mode 100644 index 0000000000000..f8459393ddff0 --- /dev/null +++ b/recipes/libyang/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.1.148": + url: "https://github.com/CESNET/libyang/archive/refs/tags/v2.1.148.tar.gz" + sha256: "77a0aaaeb3df720aeb70d6896e32e2c2be099d48df73e3cfb52567051af3e44b" diff --git a/recipes/libyang/all/conanfile.py b/recipes/libyang/all/conanfile.py new file mode 100644 index 0000000000000..2567464f94618 --- /dev/null +++ b/recipes/libyang/all/conanfile.py @@ -0,0 +1,82 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.files import get, rmdir, copy +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.53.0" + + +class LibYangConan(ConanFile): + name = "libyang" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + description = "YANG data modeling language library" + homepage = "https://github.com/CESNET/libyang" + topics = ("yang", "bsd", "netconf", "restconf", "yin") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], + "fPIC": [True, False]} + default_options = { + "shared": False, + "fPIC": True + } + + + def validate(self): + # TODO For Windows support: https://github.com/CESNET/libyang?tab=readme-ov-file#windows-build-requirements + # CMake Error at CMakeLists.txt:386 (find_package): + # By not providing "Findpthreads.cmake" in CMAKE_MODULE_PATH this project has + if self.settings.os == "Windows": + raise ConanInvalidConfiguration( + f"{self.ref} Conan recipe is not prepared to work on Windows. Contributions are welcome.") + + def requirements(self): + self.requires("pcre2/10.42", transitive_headers=True) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_TESTS"] = False + tc.variables["ENABLE_VALGRIND_TESTS"] = False + tc.variables["ENABLE_STATIC"] = not self.options.shared + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, + os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + # move *.yang files from /share to /res + copy(self, "*.yang", os.path.join(self.package_folder, "share"), + os.path.join(self.package_folder, "res", "share")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "LibYANG") + self.cpp_info.libs = ["yang"] + self.cpp_info.resdirs = ["res"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "dl", "m"]) diff --git a/recipes/libyang/all/test_package/CMakeLists.txt b/recipes/libyang/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2a5a447e67b6b --- /dev/null +++ b/recipes/libyang/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package C) + +find_package(LibYANG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libyang::libyang) diff --git a/recipes/libyang/all/test_package/conanfile.py b/recipes/libyang/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ec1844a785913 --- /dev/null +++ b/recipes/libyang/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libyang/all/test_package/test_package.c b/recipes/libyang/all/test_package/test_package.c new file mode 100644 index 0000000000000..b892125a1218e --- /dev/null +++ b/recipes/libyang/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include + +int main() +{ + struct ly_ctx *ctx = NULL; + if ( ly_ctx_new( NULL, 0, &ctx ) ) + { + return 1; + } + return 0; +} diff --git a/recipes/libyang/config.yml b/recipes/libyang/config.yml new file mode 100644 index 0000000000000..78864b67abe0f --- /dev/null +++ b/recipes/libyang/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1.148": + folder: "all" diff --git a/recipes/lielab/all/conandata.yml b/recipes/lielab/all/conandata.yml new file mode 100644 index 0000000000000..c60b643ebb70e --- /dev/null +++ b/recipes/lielab/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.0": + url: "https://github.com/sandialabs/Lielab/archive/refs/tags/v0.4.0.tar.gz" + sha256: "5CABF2D31D7D38EEEF525ADEE5D22C0359E9C043884D4AB5FBA219D3CB217A5C" diff --git a/recipes/lielab/all/conanfile.py b/recipes/lielab/all/conanfile.py new file mode 100644 index 0000000000000..ecc16c01755a9 --- /dev/null +++ b/recipes/lielab/all/conanfile.py @@ -0,0 +1,83 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake +from conan.tools.files import copy, get, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.52.0" + +class LielabConan(ConanFile): + name = "lielab" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sandialabs/Lielab" + description = "Lielab is a C++ library for numerical Lie-theory: Lie groups," \ + " Lie algebras, homogeneous manifolds, and various functions and algorithms" \ + " on these spaces." + topics = ("Lie-theory", "Lie-group", "Lie-algebra", "numerical", "header-only") + package_type = "header-library" + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + + no_copy_source = True + + def requirements(self): + self.requires("eigen/3.4.0") + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "apple-clang": "13.1", + "Visual Studio": "17", + "msvc": "193", + } + + 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 build_requirements(self): + self.tool_requires("cmake/[>=3.23 <4]") + + 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["LIELAB_INSTALL_LIBRARY"] = True + tc.variables["LIELAB_BUILD_TESTS"] = False + tc.variables["LIELAB_BUILD_PYTHON"] = False + tc.generate() + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.configure() + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "Lielab") + self.cpp_info.set_property("cmake_target_name", "Lielab::Lielab") + + self.cpp_info.names["cmake_find_package"] = "Lielab" + self.cpp_info.names["cmake_find_package_multi"] = "Lielab" + + def package_id(self): + self.info.clear() + diff --git a/recipes/lielab/all/test_package/CMakeLists.txt b/recipes/lielab/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c13d8b918525c --- /dev/null +++ b/recipes/lielab/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Lielab REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Lielab::Lielab) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/lielab/all/test_package/conanfile.py b/recipes/lielab/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/lielab/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/lielab/all/test_package/test_package.cpp b/recipes/lielab/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..81a29ab2a8a75 --- /dev/null +++ b/recipes/lielab/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include +#include + + +int main(void) { + std::cout << "Lielab v" << Lielab::VERSION << std::endl; + std::cout << Lielab::AUTHOR << std::endl; + std::cout << Lielab::LOCATION << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/lielab/config.yml b/recipes/lielab/config.yml new file mode 100644 index 0000000000000..da269653d6e6b --- /dev/null +++ b/recipes/lielab/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.0": + folder: "all" diff --git a/recipes/lightgbm/all/conandata.yml b/recipes/lightgbm/all/conandata.yml index 53438b1b2b9ba..8355ba2b45e51 100644 --- a/recipes/lightgbm/all/conandata.yml +++ b/recipes/lightgbm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.3.0": + url: "https://github.com/microsoft/LightGBM/archive/refs/tags/v4.3.0.tar.gz" + sha256: "9e5a88bc231addfe4a0e57aa5ceb157f045103cd69ad8c2f393ef941ef52a9ac" "4.2.0": url: "https://github.com/microsoft/LightGBM/archive/refs/tags/v4.2.0.tar.gz" sha256: "4b2df6e3c5fa345a2fac6cefff65dd08cbe2fa4717cd8335c2a58c1a0c7c6b02" diff --git a/recipes/lightgbm/all/conanfile.py b/recipes/lightgbm/all/conanfile.py index cae89a9218102..e84bccaa188bb 100644 --- a/recipes/lightgbm/all/conanfile.py +++ b/recipes/lightgbm/all/conanfile.py @@ -6,6 +6,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, replace_in_file, export_conandata_patches, apply_conandata_patches from conan.tools.microsoft import is_msvc +from conan.tools.env import VirtualBuildEnv from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -65,6 +66,10 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) + def build_requirements(self): + if Version(self.version) >= "4.3.0": + self.tool_requires("cmake/[>=3.18 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -78,8 +83,10 @@ def generate(self): tc.cache_variables["APPLE_OUTPUT_DYLIB"] = True tc.variables["_MAJOR_VERSION"] = Version(self.version).major tc.generate() - tc = CMakeDeps(self) - tc.generate() + deps = CMakeDeps(self) + deps.generate() + venv = VirtualBuildEnv(self) + venv.generate(scope="build") def _patch_sources(self): apply_conandata_patches(self) diff --git a/recipes/lightgbm/config.yml b/recipes/lightgbm/config.yml index 5160a2bc07bab..e59972b46cebb 100644 --- a/recipes/lightgbm/config.yml +++ b/recipes/lightgbm/config.yml @@ -1,4 +1,6 @@ versions: + "4.3.0": + folder: all "4.2.0": folder: all "4.1.0": diff --git a/recipes/limereport/all/conandata.yml b/recipes/limereport/all/conandata.yml new file mode 100644 index 0000000000000..a6aa17992b336 --- /dev/null +++ b/recipes/limereport/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.7.4": + url: "https://github.com/fralx/LimeReport/archive/refs/tags/1.7.4.tar.gz" + sha256: 5e16ffa4f1f6c9175ef00be95029d5dda57287236ef8529582e1df1366c8dc30 diff --git a/recipes/limereport/all/conanfile.py b/recipes/limereport/all/conanfile.py new file mode 100644 index 0000000000000..60455f5993eb1 --- /dev/null +++ b/recipes/limereport/all/conanfile.py @@ -0,0 +1,119 @@ +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import copy, get, replace_in_file +from conan.tools.build import check_min_cppstd +from conan import ConanFile +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + + +class LimereportConan(ConanFile): + name = "limereport" + description = "Report generator for Qt Framework" + homepage = "https://limereport.ru" + topics = ("limereport", "pdf", "report","qt") + license = "LGPL-3.0", "GPL-3.0" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zint": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_zint": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "8", + "apple-clang": "9.1", + } + + @property + def _qt_version_major(self): + return Version(self.dependencies["qt"].ref.version).major + + 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): + # QString included in Irglobal.h and Limereport expects be running Qt on customer side + self.requires("qt/[>=5.15 <7]", transitive_headers=True, transitive_libs=True) + if self.options.with_zint: + self.requires("zint/2.10.0") + + 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 not (self.dependencies["qt"].options.qtdeclarative): + raise ConanInvalidConfiguration(f"{self.ref} requires -o='qt/*:qtdeclarative=True'") + if not (self.dependencies["qt"].options.qtsvg and self.dependencies["qt"].options.qttools): + raise ConanInvalidConfiguration(f"{self.ref} requires -o='qt/*:qtsvg=True' and -o='qt/*:qttools=True'") + if self.options.with_zint and not self.dependencies["zint"].options.with_qt: + raise ConanInvalidConfiguration(f"{self.ref} option with_zint=True requires -o 'zint/*:with_qt=True'") + + 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.cache_variables["LIMEREPORT_STATIC"] = not self.options.shared + if is_msvc(self): + tc.variables["WINDOWS_BUILD"] = True + tc.cache_variables["USE_QT6"] = self._qt_version_major == 6 + tc.cache_variables["ENABLE_ZINT"] = self.options.with_zint + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + # Avoid using vendozied zint + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(3rdparty)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = [f"limereport-qt{self._qt_version_major}"] + self.cpp_info.requires = ["qt::qtCore", "qt::qtWidgets", "qt::qtQml", "qt::qtXml", "qt::qtSql", + "qt::qtPrintSupport", "qt::qtSvg", "qt::qtUiTools"] + if self.options.with_zint: + self.cpp_info.requires.append("zint::zint") + if self.options.shared: + self.cpp_info.defines.append("LIMEREPORT_IMPORTS") diff --git a/recipes/limereport/all/test_package/CMakeLists.txt b/recipes/limereport/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..08e6667600f91 --- /dev/null +++ b/recipes/limereport/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(limereport CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} limereport::limereport) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/limereport/all/test_package/conanfile.py b/recipes/limereport/all/test_package/conanfile.py new file mode 100644 index 0000000000000..76ff27872680a --- /dev/null +++ b/recipes/limereport/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.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/limereport/all/test_package/test_package.cpp b/recipes/limereport/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a10ab64ab7245 --- /dev/null +++ b/recipes/limereport/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include + +int main(int argc, char* argv[]) +{ + auto report = new LimeReport::ReportEngine(); + + std::cout << "limereport: " << report->reportName().toStdString() << std::endl; + std::cout << "LIMEREPORT_VERSION_STR: " << LIMEREPORT_VERSION_STR << std::endl; + + delete report; + return EXIT_SUCCESS; +} diff --git a/recipes/limereport/config.yml b/recipes/limereport/config.yml new file mode 100644 index 0000000000000..41f47d462d189 --- /dev/null +++ b/recipes/limereport/config.yml @@ -0,0 +1,3 @@ +versions: + "1.7.4": + folder: "all" diff --git a/recipes/llama-cpp/all/conandata.yml b/recipes/llama-cpp/all/conandata.yml index 9a540abd27e25..83cccb6e8a1a6 100644 --- a/recipes/llama-cpp/all/conandata.yml +++ b/recipes/llama-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "b3040": + url: "https://github.com/ggerganov/llama.cpp/archive/refs/tags/b3040.tar.gz" + sha256: "020e040139660eb40113503bb1057d5387677d249b990e008e04821532f7cd62" "b2038": url: "https://github.com/ggerganov/llama.cpp/archive/refs/tags/b2038.tar.gz" sha256: "a55bc75f5c76624cabfd9ea5e045f76597411231cb6fc231f2a0bff6287ab13b" diff --git a/recipes/llama-cpp/all/test_package/conanfile.py b/recipes/llama-cpp/all/test_package/conanfile.py index 7bb00fd3fe796..6cd089d783d39 100644 --- a/recipes/llama-cpp/all/test_package/conanfile.py +++ b/recipes/llama-cpp/all/test_package/conanfile.py @@ -2,7 +2,7 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout, CMake +from conan.tools.cmake import CMake, cmake_layout class TestPackageConan(ConanFile): @@ -23,5 +23,5 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindir, "test_package ./models/ggml-vocab-llama.gguf 'Hello World'") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/llama-cpp/all/test_package/test_package.cpp b/recipes/llama-cpp/all/test_package/test_package.cpp index a87c31b0d652c..1201d51a3f7ee 100644 --- a/recipes/llama-cpp/all/test_package/test_package.cpp +++ b/recipes/llama-cpp/all/test_package/test_package.cpp @@ -1,41 +1,8 @@ -#include "common.h" #include "llama.h" +#include +int main() { + llama_model_params params = llama_model_default_params(); + std::cout << "Main GPU: " << params.main_gpu << std::endl; -#include -#include -#include -#include - -// from https://github.com/ggerganov/llama.cpp/tree/master/examples/tokenize - -int main(int argc, char ** argv) { - if (argc < 2 || argv[1][0] == '-') { - printf("usage: %s MODEL_PATH PROMPT [--ids]\n" , argv[0]); - return 1; - } - - const char * model_path = argv[1]; - const char * prompt = argv[2]; - - - llama_backend_init(false); - - llama_model_params model_params = llama_model_default_params(); - model_params.vocab_only = true; - llama_model * model = llama_load_model_from_file(model_path, model_params); - - llama_context_params ctx_params = llama_context_default_params(); - llama_context * ctx = llama_new_context_with_model(model, ctx_params); - - const bool add_bos = llama_should_add_bos_token(model); - - std::vector tokens; - - tokens = ::llama_tokenize(model, prompt, add_bos, true); - - for (int i = 0; i < (int) tokens.size(); i++) { - printf("%6d -> '%s'\n", tokens[i], llama_token_to_piece(ctx, tokens[i]).c_str()); - } - - return 0; + return 0; } diff --git a/recipes/llama-cpp/config.yml b/recipes/llama-cpp/config.yml index 139b1481c0979..9893609aaeaea 100644 --- a/recipes/llama-cpp/config.yml +++ b/recipes/llama-cpp/config.yml @@ -1,3 +1,5 @@ versions: + "b3040": + folder: "all" "b2038": folder: "all" diff --git a/recipes/llvm-openmp/all/conanfile.py b/recipes/llvm-openmp/all/conanfile.py index a885645ea3471..c1412f45efbaa 100644 --- a/recipes/llvm-openmp/all/conanfile.py +++ b/recipes/llvm-openmp/all/conanfile.py @@ -16,12 +16,9 @@ class LLVMOpenMpConan(ConanFile): name = "llvm-openmp" - description = ("The OpenMP (Open Multi-Processing) specification " - "is a standard for a set of compiler directives, " - "library routines, and environment variables that " - "can be used to specify shared memory parallelism " - "in Fortran and C/C++ programs. This is the LLVM " - "implementation.") + description = ("The OpenMP (Open Multi-Processing) specification is a standard for a set of compiler directives, " + "library routines, and environment variables that can be used to specify shared memory parallelism " + "in Fortran and C/C++ programs. This is the LLVM implementation.") license = "Apache-2.0 WITH LLVM-exception" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/llvm/llvm-project/blob/main/openmp" diff --git a/recipes/lmdb/all/conandata.yml b/recipes/lmdb/all/conandata.yml index 34b1aee159c75..3d8d01ecc53e6 100644 --- a/recipes/lmdb/all/conandata.yml +++ b/recipes/lmdb/all/conandata.yml @@ -1,7 +1,10 @@ sources: + "0.9.32": + url: "https://git.openldap.org/openldap/openldap/-/archive/LMDB_0.9.32/openldap-LMDB_0.9.32.tar.gz" + sha256: "c0937223bba3c37c896809883a3c9b43049354578b239d6ed2476236a87f40c9" "0.9.31": url: "https://git.openldap.org/openldap/openldap/-/archive/LMDB_0.9.31/openldap-LMDB_0.9.31.tar.gz" - sha256: "d35d4f6f46313d62fd342c9dcbf574432919ce5e802d2b6cbe2ebd549821e5c4" + sha256: "f7aecdd1bcc69fb32bb33d8544cfe50f8e9e916f366d598a268e1f43ee9c7603" "0.9.29": url: "https://git.openldap.org/openldap/openldap/-/archive/LMDB_0.9.29/openldap-LMDB_0.9.29.tar.gz" - sha256: "d4c668167a2d703ef91db733b4069b8b74dbc374405855be6626b45e2a7e2dd3" + sha256: "e4d9f32dba4e15fcc66e0085a03432ff40a8065848d352ea47b1cb717e7369a4" diff --git a/recipes/lmdb/config.yml b/recipes/lmdb/config.yml index 3c0c6966f556b..0014799ccef1f 100644 --- a/recipes/lmdb/config.yml +++ b/recipes/lmdb/config.yml @@ -1,4 +1,6 @@ "versions": + "0.9.32": + "folder": "all" "0.9.31": "folder": "all" "0.9.29": diff --git a/recipes/lodepng/all/test_package/bees.png b/recipes/lodepng/all/test_package/bees.png deleted file mode 100644 index 11640c7488fb1..0000000000000 Binary files a/recipes/lodepng/all/test_package/bees.png and /dev/null differ diff --git a/recipes/lodepng/all/test_package/conanfile.py b/recipes/lodepng/all/test_package/conanfile.py index f6238eccc60b7..0a6bc68712d90 100644 --- a/recipes/lodepng/all/test_package/conanfile.py +++ b/recipes/lodepng/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - bees = os.path.join(self.source_folder, "bees.png") - self.run(f"{bin_path} {bees}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/lodepng/all/test_package/test_package.cpp b/recipes/lodepng/all/test_package/test_package.cpp index 744f347b97c7b..9f83682fff5cd 100644 --- a/recipes/lodepng/all/test_package/test_package.cpp +++ b/recipes/lodepng/all/test_package/test_package.cpp @@ -1,31 +1,12 @@ #include -#include -#include -#include - #include "lodepng.h" int main(int argc, const char *argv[]) { - if (argc < 2) { - std::cerr << "Need at least one argument\n"; - } - std::ifstream stream(argv[1], std::ios::in | std::ios::binary); - std::vector data((std::istreambuf_iterator(stream)), std::istreambuf_iterator()); - - std::cout << "file name " << argv[1] << "\n"; - std::cout << "file size " << data.size() << " bytes\n"; - - std::vector decoded; - unsigned width = 0, height = 0; - unsigned error = lodepng::decode(decoded, width, height, data); - if (error != 0) { - std::cerr << "lodepng::decode returned with error code " << error << "\n"; - return 1; - } - std::cout << "image size: " << width << " x " << height << " pixels.\n"; + LodePNGCompressSettings compress_settings; + lodepng_compress_settings_init(&compress_settings); - stream.close(); + printf("compress_settings.btype = %d\n", compress_settings.btype); return 0; } diff --git a/recipes/lodepng/all/test_v1_package/conanfile.py b/recipes/lodepng/all/test_v1_package/conanfile.py index 4441530a937ba..38f4483872d47 100644 --- a/recipes/lodepng/all/test_v1_package/conanfile.py +++ b/recipes/lodepng/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - bees = os.path.join(self.source_folder, os.pardir, "test_package", "bees.png") - self.run(f"{bin_path} {bees}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 6e4b69d1303a5..5f5b6f75de86a 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -1,23 +1,46 @@ sources: + "1.2.0": + url: "https://archive.apache.org/dist/logging/log4cxx/1.2.0/apache-log4cxx-1.2.0.tar.gz" + sha256: "09f4748aa5675ef5c0770bedbf5e00488668933c5a935a43ac5b85be2436c48a" "1.1.0": url: "https://archive.apache.org/dist/logging/log4cxx/1.1.0/apache-log4cxx-1.1.0.tar.gz" sha256: "1fc7d82697534184bc0f757348d969d24852b948f63d6b17283fd1ee29c2c28a" + "0.13.0": + url: "https://archive.apache.org/dist/logging/log4cxx/0.13.0/apache-log4cxx-0.13.0.tar.gz" + sha256: "4e5be64b6b1e6de8525f8b87635270b81f772a98902d20d7ac646fdf1ac08284" "0.12.1": url: "https://archive.apache.org/dist/logging/log4cxx/0.12.1/apache-log4cxx-0.12.1.tar.gz" sha256: "7bea5cb477f0e31c838f0e1f4f498cc3b30c2eae74703ddda923e7e8c2268d22" - "0.12.0": - url: "https://archive.apache.org/dist/logging/log4cxx/0.12.0/apache-log4cxx-0.12.0.tar.gz" - sha256: "bd5b5009ca914c8fa7944b92ea6b4ca6fb7d146f65d526f21bf8b3c6a0520e44" patches: + "1.2.0": + - patch_file: "patches/1.2.0-0001-find-apr.patch" + patch_description: "use cci's package name" + patch_type: "conan" "1.1.0": - patch_file: "patches/1.1.0-0001-find-apr.patch" patch_description: "use cci's package name" patch_type: "conan" - "0.12.1": - - patch_file: "patches/0.12.0-0001-find-apr.patch" - patch_description: "use cci's package name" + "0.13.0": + - patch_file: "patches/0.13.0-0001-find-apr.patch" patch_type: "conan" - "0.12.0": - - patch_file: "patches/0.12.0-0001-find-apr.patch" + patch_description: "Use conan generated apr, apr-util target names" + - patch_file: "patches/0.13.0-0001-logchar-type.patch" + patch_type: "bugfix" + patch_description: "Prevent compilation errors when with_wchar_t=False" + patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" + - patch_file: "patches/0.13.0-0001-visual-studio-15.patch" + patch_type: "bugfix" + patch_description: "Prevent Visual Studio 2017 compilation error" + patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" + - patch_file: "patches/0.13.0-0001-fix-static-library-compilation.patch" + patch_type: "bugfix" + patch_description: "Prevent compilation error when shared=False" + patch_source: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" + "0.12.1": + - patch_file: "patches/0.12.1-0001-find-apr.patch" patch_description: "use cci's package name" patch_type: "conan" + - patch_file: "patches/0.12.1-0001-logchar-type.patch" + patch_type: "bugfix" + patch_description: "Prevent compilation errors when with_wchar_t=False" + patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index f7fedd1522a39..2a819c7258550 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -24,15 +24,44 @@ class Log4cxxConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "char_type": ["utf-8", "wchar_t", "unichar"], + "char_encoding": ["utf-8", "locale"], + "with_networking": [True, False], + "with_wchar_t": [True, False], + "with_fmt_layout": [True, False], + "with_odbc_appender": [True, False], + "with_multiprocess_rolling_file_appender": [True, False], + "with_smtp_appender": [True, False], + "with_qt": [True, False], + } + options_description = { + "char_type": "The log4cxx internal character type (selects the std::basic_string template parameter used by log4cxx::LogString)", + "char_encoding": "The external character set used when writing to files", + "with_networking": "Include appenders that use network i/o", + "with_wchar_t": "Include wchar_t API methods in class interfaces", + "with_fmt_layout": "Include the log4cxx::FMTLayout class that uses libfmt to layout messages", + "with_odbc_appender": "Include the log4cxx::ODBCAppender that sends log events to a database", + "with_multiprocess_rolling_file_appender": "Include the appender that allows multiple applications to log to the same file", + "with_smtp_appender": "Include the appender that sends an e-mail when a specific logging event occurs", + "with_qt": "Allow QString values in the LOG4CXX_WARN, LOG4CXX_INFO, LOG4CXX_DEBUG etc. macros", } default_options = { "shared": False, "fPIC": True, + "char_type": "utf-8", + "char_encoding": "utf-8", + "with_networking": True, + "with_wchar_t": False, + "with_fmt_layout": False, + "with_odbc_appender": False, + "with_multiprocess_rolling_file_appender": False, + "with_smtp_appender": False, + "with_qt": False, } @property def _min_cppstd(self): - return 17 + return 11 @property def _compilers_minimum_version(self): @@ -49,7 +78,14 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + self.options.rm_safe("fPIC") + self.options.rm_safe("with_smtp_appender") # *nix only + elif Version(self.version) <= "1.0.0": # SMTP appender is broken in version 0.12 through 1.0.0 + self.options.rm_safe("with_smtp_appender") + if Version(self.version) < "1.0.0": + self.options.rm_safe("with_multiprocess_rolling_file_appender") + self.options.rm_safe("with_networking") + self.options.rm_safe("with_fmt_layout") def configure(self): if self.options.shared: @@ -61,17 +97,31 @@ def layout(self): def requirements(self): self.requires("apr/1.7.4") self.requires("apr-util/1.6.1") - self.requires("expat/2.5.0") - if self.settings.os != "Windows": + if self.options.get_safe("with_odbc_appender") and self.settings.os != "Windows": self.requires("odbc/2.3.11") + if self.options.get_safe("with_smtp_appender"): + self.requires("libesmtp/1.1.0") + if self.options.get_safe("with_fmt_layout"): + self.requires("fmt/10.2.1") + if self.options.get_safe("with_qt"): + self.requires("qt/[~5.15]") def validate(self): - # TODO: if compiler doesn't support C++17, boost can be used instead - 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 a compiler that supports at least C++{self._min_cppstd}") + if Version(self.version) < "1.0.0" or self.options.get_safe("with_multiprocess_rolling_file_appender"): + # TODO: if compiler doesn't support C++17, boost can be used instead + if Version(self.version) < "1.0.0": + self.output.info(f"Version {self.version} requires C++17. log4cxx version 1.x does not.") + else: + self.output.info("multiprocess rolling file appender requires C++17.") + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + compiler_version = Version(self.settings.compiler.version) + if compiler_version < minimum_version: + raise ConanInvalidConfiguration(f"{self.settings.compiler} {compiler_version} does not support C++17: {minimum_version} required.") + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "17") + + def _patch_sources(self): + apply_conandata_patches(self) def build_requirements(self): if self.settings.os != "Windows": @@ -79,15 +129,23 @@ def build_requirements(self): self.tool_requires("pkgconf/2.0.3") def source(self): - # OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: - # 'src\\test\\resources\\output\\xyz\\:' - pattern = "*[!:]" - get(self, **self.conan_data["sources"][self.version], strip_root=True, pattern=pattern) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) - tc.cache_variables["BUILD_TESTING"] = False - tc.cache_variables["LOG4CXX_INSTALL_PDB"] = False + tc.variables["BUILD_TESTING"] = False + tc.variables["LOG4CXX_INSTALL_PDB"] = False + if Version(self.version) >= "1.0.0": + tc.variables["LOG4CXX_NETWORKING_SUPPORT"] = self.options.with_networking + tc.variables["LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER"] = self.options.with_multiprocess_rolling_file_appender + tc.variables["ENABLE_FMT_LAYOUT"] = self.options.with_fmt_layout + if Version(self.version) > "1.0.0" and self.settings.os != "Windows": + tc.variables["LOG4CXX_ENABLE_ESMTP"] = self.options.with_smtp_appender + tc.variables["LOG4CXX_ENABLE_ODBC"] = self.options.with_odbc_appender + tc.variables["LOG4CXX_CHAR"] = self.options.char_type + tc.variables["LOG4CXX_CHARSET"] = self.options.char_encoding + tc.variables["LOG4CXX_WCHAR_T"] = self.options.with_wchar_t + tc.variables["LOG4CXX_QT_SUPPORT"] = self.options.with_qt tc.generate() tc = CMakeDeps(self) tc.generate() @@ -141,3 +199,4 @@ def package_info(self): # TODO: to remove in conan v2 once cmake_find_package* & pkg_config 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/log4cxx/all/patches/0.12.0-0001-find-apr.patch b/recipes/log4cxx/all/patches/0.12.1-0001-find-apr.patch similarity index 100% rename from recipes/log4cxx/all/patches/0.12.0-0001-find-apr.patch rename to recipes/log4cxx/all/patches/0.12.1-0001-find-apr.patch diff --git a/recipes/log4cxx/all/patches/0.12.1-0001-logchar-type.patch b/recipes/log4cxx/all/patches/0.12.1-0001-logchar-type.patch new file mode 100644 index 0000000000000..a59e3639553ae --- /dev/null +++ b/recipes/log4cxx/all/patches/0.12.1-0001-logchar-type.patch @@ -0,0 +1,21 @@ +--- a/src/main/include/CMakeLists.txt ++++ b/src/main/include/CMakeLists.txt +@@ -22,9 +22,18 @@ endif() + + if(${LOG4CXX_CHAR} STREQUAL "unichar") + set(LOGCHAR_IS_UNICHAR 1) ++ set(LOGCHAR_IS_WCHAR 0) ++ set(LOGCHAR_IS_UTF8 0) + elseif(${LOG4CXX_CHAR} STREQUAL "wchar_t") + set(LOGCHAR_IS_WCHAR 1) ++ set(LOGCHAR_IS_UNICHAR 0) ++ set(LOGCHAR_IS_UTF8 0) ++elseif(${LOG4CXX_CHAR} STREQUAL "utf-8") ++ set(LOGCHAR_IS_UNICHAR 0) ++ set(LOGCHAR_IS_WCHAR 0) ++ set(LOGCHAR_IS_UTF8 1) + endif() ++ + option(LOG4CXX_WCHAR_T "Enable wchar_t API methods" ON) + option(LOG4CXX_UNICHAR "Enable UniChar API methods" OFF) + set(INIT_IOS_BASE 0) diff --git a/recipes/log4cxx/all/patches/0.13.0-0001-find-apr.patch b/recipes/log4cxx/all/patches/0.13.0-0001-find-apr.patch new file mode 100644 index 0000000000000..174331cfd2a57 --- /dev/null +++ b/recipes/log4cxx/all/patches/0.13.0-0001-find-apr.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,10 +41,12 @@ if(NOT BUILD_SHARED_LIBS) + endif() + + # Find Apache Runtime +-find_package(APR REQUIRED) ++find_package(apr REQUIRED) ++set(APR_LIBRARIES apr::apr) + + # Find Apache Runtime Utilities +-find_package(APR-Util REQUIRED) ++find_package(apr-util REQUIRED) ++set(APR_UTIL_LIBRARIES apr-util::apr-util) + + find_package( Threads REQUIRED ) + diff --git a/recipes/log4cxx/all/patches/0.13.0-0001-fix-static-library-compilation.patch b/recipes/log4cxx/all/patches/0.13.0-0001-fix-static-library-compilation.patch new file mode 100644 index 0000000000000..53bcabf38e8da --- /dev/null +++ b/recipes/log4cxx/all/patches/0.13.0-0001-fix-static-library-compilation.patch @@ -0,0 +1,12 @@ +--- a/src/main/cpp/threadutility.cpp ++++ b/src/main/cpp/threadutility.cpp +@@ -16,6 +16,9 @@ + */ + + #include "log4cxx/helpers/threadutility.h" ++#if !defined(LOG4CXX) ++ #define LOG4CXX 1 ++#endif + #include "log4cxx/private/log4cxx_private.h" + #include "log4cxx/helpers/loglog.h" + diff --git a/recipes/log4cxx/all/patches/0.13.0-0001-logchar-type.patch b/recipes/log4cxx/all/patches/0.13.0-0001-logchar-type.patch new file mode 100644 index 0000000000000..cb4669d6873b4 --- /dev/null +++ b/recipes/log4cxx/all/patches/0.13.0-0001-logchar-type.patch @@ -0,0 +1,44 @@ +diff --git a/src/main/cpp/threadutility.cpp b/src/main/cpp/threadutility.cpp +index c14c12fd..057ecd86 100644 +--- a/src/main/cpp/threadutility.cpp ++++ b/src/main/cpp/threadutility.cpp +@@ -113,11 +113,13 @@ void ThreadUtility::threadStartedNameThread(LogString threadName, + std::thread::id /*threadId*/, + std::thread::native_handle_type nativeHandle){ + #if LOG4CXX_HAS_PTHREAD_SETNAME +- if( pthread_setname_np( static_cast( nativeHandle ), threadName.c_str() ) < 0 ){ +- LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") ); ++ LOG4CXX_ENCODE_CHAR(sthreadName, threadName); ++ if (pthread_setname_np(static_cast(nativeHandle), sthreadName.c_str()) < 0) { ++ LOGLOG_ERROR(LOG4CXX_STR("unable to set thread name")); + } + #elif LOG4CXX_HAS_SETTHREADDESCRIPTION +- HRESULT hr = SetThreadDescription(static_cast(nativeHandle), threadName.c_str()); ++ LOG4CXX_ENCODE_WCHAR(wthreadName, threadName); ++ HRESULT hr = SetThreadDescription(static_cast(nativeHandle), wthreadName.c_str()); + if(FAILED(hr)){ + LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") ); + } +diff --git a/src/main/include/CMakeLists.txt b/src/main/include/CMakeLists.txt +index e31443fb..32122e41 100644 +--- a/src/main/include/CMakeLists.txt ++++ b/src/main/include/CMakeLists.txt +@@ -39,9 +39,18 @@ endif() + + if(${LOG4CXX_CHAR} STREQUAL "unichar") + set(LOGCHAR_IS_UNICHAR 1) ++ set(LOGCHAR_IS_WCHAR 0) ++ set(LOGCHAR_IS_UTF8 0) + elseif(${LOG4CXX_CHAR} STREQUAL "wchar_t") + set(LOGCHAR_IS_WCHAR 1) ++ set(LOGCHAR_IS_UNICHAR 0) ++ set(LOGCHAR_IS_UTF8 0) ++elseif(${LOG4CXX_CHAR} STREQUAL "utf-8") ++ set(LOGCHAR_IS_UNICHAR 0) ++ set(LOGCHAR_IS_WCHAR 0) ++ set(LOGCHAR_IS_UTF8 1) + endif() ++ + option(LOG4CXX_WCHAR_T "Enable wchar_t API methods" ON) + option(LOG4CXX_UNICHAR "Enable UniChar API methods" OFF) + set(INIT_IOS_BASE 0) diff --git a/recipes/log4cxx/all/patches/0.13.0-0001-visual-studio-15.patch b/recipes/log4cxx/all/patches/0.13.0-0001-visual-studio-15.patch new file mode 100644 index 0000000000000..0c491ee579c3b --- /dev/null +++ b/recipes/log4cxx/all/patches/0.13.0-0001-visual-studio-15.patch @@ -0,0 +1,52 @@ +diff --git a/src/main/cpp/threadutility.cpp b/src/main/cpp/threadutility.cpp +index b57ab66..ef48704 100644 +--- a/src/main/cpp/threadutility.cpp ++++ b/src/main/cpp/threadutility.cpp +@@ -27,7 +27,11 @@ + #include + #endif + +-using log4cxx::helpers::ThreadUtility; ++namespace log4cxx ++{ ++namespace helpers ++{ ++ + + struct ThreadUtility::priv_data{ + priv_data(){ +@@ -36,9 +40,9 @@ struct ThreadUtility::priv_data{ + start_post = nullptr; + } + +- log4cxx::helpers::ThreadStartPre start_pre; +- log4cxx::helpers::ThreadStarted started; +- log4cxx::helpers::ThreadStartPost start_post; ++ ThreadStartPre start_pre; ++ ThreadStarted started; ++ ThreadStartPost start_post; + }; + + #if LOG4CXX_HAS_PTHREAD_SIGMASK +@@ -138,14 +142,18 @@ void ThreadUtility::postThreadUnblockSignals(){ + } + + +-log4cxx::helpers::ThreadStartPre ThreadUtility::preStartFunction(){ ++ThreadStartPre ThreadUtility::preStartFunction(){ + return m_priv->start_pre; + } + +-log4cxx::helpers::ThreadStarted ThreadUtility::threadStartedFunction(){ ++ThreadStarted ThreadUtility::threadStartedFunction(){ + return m_priv->started; + } + +-log4cxx::helpers::ThreadStartPost ThreadUtility::postStartFunction(){ ++ThreadStartPost ThreadUtility::postStartFunction(){ + return m_priv->start_post; + } ++ ++} //namespace helpers ++} //namespace log4cxx ++ diff --git a/recipes/log4cxx/all/patches/1.2.0-0001-find-apr.patch b/recipes/log4cxx/all/patches/1.2.0-0001-find-apr.patch new file mode 100644 index 0000000000000..03f1b1478ec0e --- /dev/null +++ b/recipes/log4cxx/all/patches/1.2.0-0001-find-apr.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 61c0479..6ac3e77 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,16 +51,18 @@ endif() + + # Find Apache Runtime + option(APR_STATIC "Link to the APR static library" OFF) +-find_package(APR REQUIRED) ++find_package(apr REQUIRED) ++set(APR_LIBRARIES apr::apr) + + # Find Apache Runtime Utilities + option(APU_STATIC "Link to the APR-Util static library" OFF) +-find_package(APR-Util REQUIRED) ++find_package(apr-util REQUIRED) ++set(APR_UTIL_LIBRARIES apr-util::apr-util) + + find_package( Threads REQUIRED ) + + # Find expat for XML parsing +-find_package(EXPAT REQUIRED) ++find_package(EXPAT REQUIRED MODULE) + if(TARGET EXPAT::EXPAT) + set(EXPAT_LIBRARIES EXPAT::EXPAT) + elseif(TARGET expat::expat) diff --git a/recipes/log4cxx/all/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt index a9ec878c74ebe..da8e02ac1cd82 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -4,5 +4,6 @@ project(test_package LANGUAGES CXX) find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} log4cxx) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) +target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) +target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx ) diff --git a/recipes/log4cxx/all/test_package/conanfile.py b/recipes/log4cxx/all/test_package/conanfile.py index 382876561a203..c27e4673f4ff9 100644 --- a/recipes/log4cxx/all/test_package/conanfile.py +++ b/recipes/log4cxx/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,6 +21,7 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindir, "test_package") config_xml_name = os.path.join(self.source_folder, "log4cxx_config.xml") - self.run(f"{bin_path} {config_xml_name}", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run("{} {}".format(bin_path, config_xml_name), env="conanrun") + diff --git a/recipes/log4cxx/all/test_package/test_package.cpp b/recipes/log4cxx/all/test_package/test_package.cpp index 4e52b04611957..41abd554c33f4 100644 --- a/recipes/log4cxx/all/test_package/test_package.cpp +++ b/recipes/log4cxx/all/test_package/test_package.cpp @@ -1,20 +1,18 @@ -#include "log4cxx/logger.h" +#include "log4cxx/logmanager.h" #include "log4cxx/xml/domconfigurator.h" #include -using namespace log4cxx; -using namespace log4cxx::xml; - int main(int argc, const char* argv[]) { - LoggerPtr logger(Logger::getLogger("TEST")); if (argc < 2) { - std::cerr << "Expected path to config xml\n"; + std::cerr << "Usage error. Expected an argument, the path to a xml configuration file\n"; return -1; } - DOMConfigurator::configure(argv[1]); - LOG4CXX_INFO(logger, "App started!"); - LOG4CXX_ERROR(logger, "Some error!"); + log4cxx::xml::DOMConfigurator::configure(argv[1]); + auto logger = log4cxx::LogManager::getLogger("TEST"); + LOG4CXX_INFO(logger, "App started"); + LOG4CXX_ERROR(logger, "Information message"); + log4cxx::LogManager::shutdown(); return 0; } diff --git a/recipes/log4cxx/config.yml b/recipes/log4cxx/config.yml index 18729d7b4cdc5..fb792fbdf460c 100644 --- a/recipes/log4cxx/config.yml +++ b/recipes/log4cxx/config.yml @@ -1,7 +1,9 @@ versions: + "1.2.0": + folder: all "1.1.0": folder: all - "0.12.1": + "0.13.0": folder: all - "0.12.0": + "0.12.1": folder: all diff --git a/recipes/logfault/all/conandata.yml b/recipes/logfault/all/conandata.yml new file mode 100644 index 0000000000000..4ef9e5e9edbe3 --- /dev/null +++ b/recipes/logfault/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + 0.5.2: + url: + - https://github.com/jgaa/logfault/archive/refs/tags/v0.5.2.tar.gz + sha256: b6c7a4faca340bb7e3105c2094acd2afd52ce1bcfbe7e3ed2233c1ec933a904f diff --git a/recipes/logfault/all/conanfile.py b/recipes/logfault/all/conanfile.py new file mode 100644 index 0000000000000..d93b9976fa00f --- /dev/null +++ b/recipes/logfault/all/conanfile.py @@ -0,0 +1,69 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain +import os + + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "logfault" + description = "Simple to use, header only C++ library for application-logging on all major platforms." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jgaa/logfault" + topics = ("logging", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "8", + "clang": "7", + "apple-clang": "12", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.h", + os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + diff --git a/recipes/logfault/all/test_package/CMakeLists.txt b/recipes/logfault/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fcdef5afc6817 --- /dev/null +++ b/recipes/logfault/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(LOGFAULT REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE logfault::logfault) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logfault/all/test_package/conanfile.py b/recipes/logfault/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a808db45f245 --- /dev/null +++ b/recipes/logfault/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/logfault/all/test_package/test_package.cpp b/recipes/logfault/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a80ce4ba7c1ff --- /dev/null +++ b/recipes/logfault/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ + +// General tests for manual testing during development + +#include +#include "logfault/logfault.h" + +using namespace std; + +int main( int argc, char *argv[]) { + + logfault::LogManager::Instance().AddHandler(std::make_unique(clog, logfault::LogLevel::DEBUGGING)); + LFLOG_INFO << "Testing" << 1 << 2 << 3; +} diff --git a/recipes/logfault/config.yml b/recipes/logfault/config.yml new file mode 100644 index 0000000000000..ccf525f369b0e --- /dev/null +++ b/recipes/logfault/config.yml @@ -0,0 +1,3 @@ +versions: + "0.5.2": + folder: all diff --git a/recipes/logr/config.yml b/recipes/logr/config.yml index 71c5abd93f78c..afa3309f2914c 100644 --- a/recipes/logr/config.yml +++ b/recipes/logr/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.0": + folder: v0.7 "0.6.0": folder: all "0.5.1": diff --git a/recipes/logr/v0.7/conandata.yml b/recipes/logr/v0.7/conandata.yml new file mode 100644 index 0000000000000..745404ba635bc --- /dev/null +++ b/recipes/logr/v0.7/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.7.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.7.0.tar.gz" + sha256: "b43b6624a9223bcb0a11c83afb3df69ef4388d42abef9abb1b80fbc85b890287" diff --git a/recipes/logr/v0.7/conanfile.py b/recipes/logr/v0.7/conanfile.py new file mode 100644 index 0000000000000..7eee46ae5d249 --- /dev/null +++ b/recipes/logr/v0.7/conanfile.py @@ -0,0 +1,140 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy, rm +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs +import os + +required_conan_version = ">=1.50.0" + + +class LogrConan(ConanFile): + name = "logr" + 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", "header-only") + settings = "os", "arch", "compiler", "build_type" + package_type = "header-library" + options = { + "with_spdlog": [True, False], + "with_glog": [True, False], + "with_log4cplus": [True, False], + "with_boostlog": [True, False], + } + default_options = { + "with_spdlog": True, + "with_glog": False, + "with_log4cplus": False, + "with_boostlog": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "gcc": "10", + "clang": "11", + "apple-clang": "12", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("fmt/10.2.1") + + if self.options.with_spdlog: + self.requires("spdlog/1.12.0") + + if self.options.with_glog: + self.requires("glog/0.6.0") + + if self.options.with_log4cplus: + self.requires("log4cplus/2.1.0") + + if self.options.with_boostlog: + self.requires("boost/1.83.0") + + def package_id(self): + self.info.settings.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + + check_min_vs(self, 192) + + 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 minimum {self.settings.compiler} version of {minimum_version}" + ) + + def build(self): + pass + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.*pp", src=os.path.join(self.source_folder, "logr", "include"), dst=os.path.join(self.package_folder, "include")) + + include_folder = os.path.join(self.package_folder, "include", "logr") + if not self.options.with_spdlog: + rm(self, "spdlog_backend.hpp", include_folder) + + if not self.options.with_glog: + rm(self, "glog_backend.hpp", include_folder) + + if not self.options.with_log4cplus: + rm(self, "log4cplus_backend.hpp", include_folder) + + if not self.options.with_boostlog: + rm(self, "boostlog_backend.hpp", include_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.components["logr_base"].includedirs = ["include"] + self.cpp_info.components["logr_base"].requires = ["fmt::fmt"] + + if self.options.with_spdlog: + self.cpp_info.components["logr_spdlog"].includedirs = [] + self.cpp_info.components["logr_spdlog"].requires = [ + "logr_base", + "spdlog::spdlog", + ] + + if self.options.with_glog: + self.cpp_info.components["logr_glog"].includedirs = [] + self.cpp_info.components["logr_glog"].requires = [ + "logr_base", + "glog::glog", + ] + + if self.options.with_log4cplus: + self.cpp_info.components["logr_log4cplus"].includedirs = [] + self.cpp_info.components["logr_log4cplus"].requires = [ + "logr_base", + "log4cplus::log4cplus", + ] + + if self.options.with_boostlog: + self.cpp_info.components["logr_boostlog"].includedirs = [] + self.cpp_info.components["logr_boostlog"].requires = [ + "logr_base", + "boost::log", + ] diff --git a/recipes/logr/v0.7/test_package/CMakeLists.txt b/recipes/logr/v0.7/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5e62d2b8b4d92 --- /dev/null +++ b/recipes/logr/v0.7/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(logr REQUIRED) + +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/libassert/all/test_package/conanfile.py b/recipes/logr/v0.7/test_package/conanfile.py similarity index 100% rename from recipes/libassert/all/test_package/conanfile.py rename to recipes/logr/v0.7/test_package/conanfile.py diff --git a/recipes/logr/v0.7/test_package/test_package.cpp b/recipes/logr/v0.7/test_package/test_package.cpp new file mode 100644 index 0000000000000..27d9ac363797b --- /dev/null +++ b/recipes/logr/v0.7/test_package/test_package.cpp @@ -0,0 +1,46 @@ +// Logger frontend library for C++. +// +// Copyright (c) 2020 - present, Nicolai Grodzitski +// See LICENSE file in the root of the project. + + +#include + +#include +#include + + +int main() { + auto logger = logr::basic_ostream_logger_t<1024u>(std::cout); + + logger.info( "Hello World! [raw message]" ); + logger.info( LOGR_SRC_LOCATION, "Hello World! [raw message]" ); + + logger.info( []() { return "Hello World! [cb]"; } ); + logger.info( LOGR_SRC_LOCATION, []() { return "Hello World! [cb]"; } ); + + logger.info( []( auto out ) { + format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" ); + } ); + + logger.info( LOGR_SRC_LOCATION, []( auto out ) { + format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" ); + } ); + logger.info( LOGR_SRC_LOCATION, []( auto out ) { + format_to( out, + FMT_STRING( "Hello {}! [{}]" ), + "World", + "cb with explicit out and FMT_STRING" ); + } ); + + logger.info( LOGR_SRC_LOCATION, []( auto out ) { + format_to( out, + fmt::runtime( "Hello {}! [{}]" ), + "World", + "cb with explicit out and runtime-string" ); + } ); + + logger.flush(); + + return 0; +} diff --git a/recipes/lua/all/conandata.yml b/recipes/lua/all/conandata.yml index 8ec9d4e74c4ed..c45d4283f1442 100644 --- a/recipes/lua/all/conandata.yml +++ b/recipes/lua/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.4.7": + url: "https://www.lua.org/ftp/lua-5.4.7.tar.gz" + sha256: "9fbf5e28ef86c69858f6d3d34eccc32e911c1a28b4120ff3e84aaa70cfbf1e30" "5.4.6": url: "https://www.lua.org/ftp/lua-5.4.6.tar.gz" sha256: "7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88" diff --git a/recipes/lua/config.yml b/recipes/lua/config.yml index 2b62e0c775189..00a91f7d773a9 100644 --- a/recipes/lua/config.yml +++ b/recipes/lua/config.yml @@ -1,4 +1,6 @@ versions: + "5.4.7": + folder: all "5.4.6": folder: all "5.4.4": diff --git a/recipes/luajit/all/patches/20230104-0001-remove-mac-deploy.patch b/recipes/luajit/all/patches/20230104-0001-remove-mac-deploy.patch deleted file mode 100644 index 42e0eca4a7fb6..0000000000000 --- a/recipes/luajit/all/patches/20230104-0001-remove-mac-deploy.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/src/Makefile b/src/Makefile -index 30d64be..b753ea1 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -316,9 +316,6 @@ ifeq (,$(shell $(TARGET_CC) -o /dev/null -c -x c /dev/null -fno-stack-protector - TARGET_XCFLAGS+= -fno-stack-protector - endif - ifeq (Darwin,$(TARGET_SYS)) -- ifeq (,$(MACOSX_DEPLOYMENT_TARGET)) -- $(error missing: export MACOSX_DEPLOYMENT_TARGET=XX.YY) -- endif - TARGET_STRIP+= -x - TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL - TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC diff --git a/recipes/luau/all/conandata.yml b/recipes/luau/all/conandata.yml index 9d1d69b7d2681..d38eb7af87816 100644 --- a/recipes/luau/all/conandata.yml +++ b/recipes/luau/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.630": + url: "https://github.com/Roblox/luau/archive/0.630.tar.gz" + sha256: "601938ebd428d37c2bb10697500bff4fe304f7c0651cf64721b9dc5600a30ed9" + "0.625": + url: "https://github.com/Roblox/luau/archive/0.625.tar.gz" + sha256: "4dd9295a67c2de6536b6e1208ea81cebfc5caefadcdacd7e09341c7a1dbbb9e2" + "0.620": + url: "https://github.com/Roblox/luau/archive/0.620.tar.gz" + sha256: "a6ae1f0396334e72b1241dabb73aa123037613f3276bf2e71d0dc75568b1eb52" "0.615": url: "https://github.com/Roblox/luau/archive/0.615.tar.gz" sha256: "264192ff1cb1bc3d5c223e5fbe9c4c628d203e2ac6ff72100e09640f43f60a60" diff --git a/recipes/luau/config.yml b/recipes/luau/config.yml index 8d347f4e40ba9..26cd13020e94c 100644 --- a/recipes/luau/config.yml +++ b/recipes/luau/config.yml @@ -1,4 +1,10 @@ versions: + "0.630": + folder: all + "0.625": + folder: all + "0.620": + folder: all "0.615": folder: all "0.610": diff --git a/recipes/lunasvg/all/conandata.yml b/recipes/lunasvg/all/conandata.yml index 841dc89eb9587..c0096452d5b87 100644 --- a/recipes/lunasvg/all/conandata.yml +++ b/recipes/lunasvg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.0": + url: "https://github.com/sammycage/lunasvg/archive/v2.4.0.tar.gz" + sha256: "0682c60501c91d75f4261d9c1a5cd44c2c9da8dba76f8402eab628448c9a4591" "2.3.9": url: "https://github.com/sammycage/lunasvg/archive/v2.3.9.tar.gz" sha256: "088bc9fd1191a004552c65bdcc260989b83da441b0bdaa965e79d984feba88fa" @@ -18,6 +21,10 @@ sources: url: "https://github.com/sammycage/lunasvg/archive/refs/tags/v2.3.1.tar.gz" sha256: "6492bf0f51982f5382f83f1a42f247bb1bbcbaef4a15963bbd53073cd4944a25" patches: + "2.4.0": + - patch_file: "patches/2.3.9-0001-fix-cmake.patch" + patch_description: "use external plutovg and fix installation path for conan" + patch_type: "conan" "2.3.9": - patch_file: "patches/2.3.9-0001-fix-cmake.patch" patch_description: "use external plutovg and fix installation path for conan" diff --git a/recipes/lunasvg/config.yml b/recipes/lunasvg/config.yml index 670758a7b8c7f..b01edffe69a57 100644 --- a/recipes/lunasvg/config.yml +++ b/recipes/lunasvg/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.0": + folder: all "2.3.9": folder: all "2.3.8": diff --git a/recipes/lzham/all/conanfile.py b/recipes/lzham/all/conanfile.py index b1b9dc2a684e4..42a7472a117cb 100644 --- a/recipes/lzham/all/conanfile.py +++ b/recipes/lzham/all/conanfile.py @@ -1,12 +1,14 @@ import os from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import ( apply_conandata_patches, copy, export_conandata_patches, get, + replace_in_file, rmdir ) from conan.tools.microsoft import ( @@ -51,6 +53,28 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def validate(self): + if self.settings.os == "Windows" and self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration("On Windows, only x86 and x86_64 are supported") + + def _msvc_libs(self, targets=False): + arch = "x86" if self.settings.arch == "x86" else "x64" + suffix = f"{arch}D" if self.settings.build_type == "Debug" else arch + if self.options.shared == True: + if targets: + # Note: this causes its dependencies to be built too + return ['lzhamdll'] + + files = [f"lzham_{suffix}.dll", f"lzham_{suffix}.lib"] + else: + libs = ['lzhamcomp', 'lzhamdecomp', 'lzhamlib'] + if targets: + return libs + + files = [f"{lib}_{suffix}.lib" for lib in libs] + + return files + def layout(self): if is_msvc(self): vs_layout(self) @@ -79,10 +103,21 @@ def generate(self): # Honor BUILD_SHARED_LIBS from conan_toolchain (see # https://github.com/conan-io/conan/issues/11840) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + + # Build relocatable shared libraries on Apple OSs + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" tc.generate() def build(self): apply_conandata_patches(self) + for project in ['lzhamcomp', 'lzhamdecomp', 'lzhamdll', 'lzhamlib']: + filename = 'lzham' if project == 'lzhamdll' else project + vcxproj_file = os.path.join(self.source_folder, project, f"{filename}.vcxproj") + # Avoid errors when the toolset on the consumer side is not exactly the same version + replace_in_file(self, vcxproj_file, "WholeProgramOptimization>true", "WholeProgramOptimization>false") + # Don't override the runtime library set by Conan's MSBuildToolchain + replace_in_file(self, vcxproj_file, "MultiThreaded", "") + replace_in_file(self, vcxproj_file, "MultiThreadedDebug", "") if is_msvc(self): msbuild = MSBuild(self) msbuild.build_type = ( @@ -91,7 +126,7 @@ def build(self): msbuild.platform = ( "Win32" if self.settings.arch == "x86" else msbuild.platform ) - msbuild.build(sln="lzham.sln") + msbuild.build(sln="lzham.sln", targets=self._msvc_libs(targets=True)) else: cmake = CMake(self) cmake.configure() @@ -106,21 +141,21 @@ def package(self): ) if is_msvc(self): - suffix = "x64D" if self.settings.build_type == "Debug" else "x64" - copy( - self, - pattern=f"lzham_{suffix}.lib", - dst=os.path.join(self.package_folder, "lib"), - src=os.path.join(self.build_folder, "lib", "x64"), - keep_path=False - ) - copy( - self, - pattern=f"lzham_{suffix}.dll", - dst=os.path.join(self.package_folder, "bin"), - src=os.path.join(self.build_folder, "bin"), - keep_path=False - ) + arch = "x86" if self.settings.arch == "x86" else "x64" + for target in self._msvc_libs(): + self.output.warning(target) + debug_suffix = "D" if self.settings.build_type == "Debug" and not self.options.shared else "" + arch_folder = f"{arch}{debug_suffix}" + subfolder = "lib" if not target.endswith('dll') else "bin" + subfolder_src = os.path.join("lib", arch_folder) if not target.endswith('dll') else "bin" + self.output.warning(subfolder_src) + copy( + self, + pattern=target, + dst=os.path.join(self.package_folder, subfolder), + src=os.path.join(self.build_folder, subfolder_src), + keep_path=False + ) copy( self, pattern="*.h", @@ -141,10 +176,8 @@ def package_info(self): self.cpp_info.system_libs.extend(["m", "pthread"]) if is_msvc(self): - lib_name = "lzham_x64" - if self.settings.build_type == "Debug": - lib_name += "D" - self.cpp_info.libs = [lib_name] + libs = list(set([filename[:-4] for filename in self._msvc_libs()])) + self.cpp_info.libs = libs else: self.cpp_info.libs = ["lzhamdll", "lzhamcomp", "lzhamdecomp"] self.cpp_info.set_property("cmake_file_name", "lzham") diff --git a/recipes/lzham/all/test_package/test_package.cpp b/recipes/lzham/all/test_package/test_package.cpp index c588215577f5f..33155f701528a 100644 --- a/recipes/lzham/all/test_package/test_package.cpp +++ b/recipes/lzham/all/test_package/test_package.cpp @@ -1,23 +1,13 @@ -#include -#include +#include +#include -#include +#include int main() { - unsigned char in[] = "Hello Conan Center!"; - unsigned char out[sizeof(in)]; + const std::string version(lzham_z_version()); - lzham_z_stream stream; - std::memset(&stream, 0, sizeof(stream)); - stream.next_in = in; - stream.avail_in = sizeof(in); - stream.next_out = out; - stream.avail_out = sizeof(out); - if (lzham_z_deflateInit(&stream, LZHAM_Z_BEST_COMPRESSION) != LZHAM_Z_OK) - return EXIT_FAILURE; + std::cout << "lzham version: " << version << std::endl; - if (lzham_z_deflate(&stream, LZHAM_Z_FULL_FLUSH) != LZHAM_Z_OK) - return EXIT_FAILURE; return EXIT_SUCCESS; } diff --git a/recipes/macdylibbundler/all/conandata.yml b/recipes/macdylibbundler/all/conandata.yml new file mode 100644 index 0000000000000..014ef59305c05 --- /dev/null +++ b/recipes/macdylibbundler/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.5": + url: "https://github.com/auriamg/macdylibbundler/archive/refs/tags/1.0.5.tar.gz" + sha256: "13384ebe7ca841ec392ac49dc5e50b1470190466623fa0e5cd30f1c634858530" diff --git a/recipes/macdylibbundler/all/conanfile.py b/recipes/macdylibbundler/all/conanfile.py new file mode 100644 index 0000000000000..774cb3deaaf5d --- /dev/null +++ b/recipes/macdylibbundler/all/conanfile.py @@ -0,0 +1,50 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.files import copy, get +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=1.53.0" + + +class MacDylibBundlerConan(ConanFile): + name = "macdylibbundler" + package_type = "application" + description = ( + "mac dylib bundler is a tool for use when bundling mac applications" + ) + topics = ("build", "dylib", "installer", "mac") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/auriamg/macdylibbundler" + license = "MIT" + settings = "os", "arch", "build_type" + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if not is_apple_os(self): + raise ConanInvalidConfiguration("This tool is for macOS only") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + # The CMakeLists.txt misses the install command, so for simplicity the executable is copied manually + copy(self, "dylibbundler", src=self.build_folder, dst=os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/macdylibbundler/all/test_package/conanfile.py b/recipes/macdylibbundler/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7909754cbfd68 --- /dev/null +++ b/recipes/macdylibbundler/all/test_package/conanfile.py @@ -0,0 +1,15 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + if can_run(self): + self.run("dylibbundler -h") diff --git a/recipes/macdylibbundler/config.yml b/recipes/macdylibbundler/config.yml new file mode 100644 index 0000000000000..84f5016ed4a14 --- /dev/null +++ b/recipes/macdylibbundler/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.5": + folder: all diff --git a/recipes/magic_enum/all/conandata.yml b/recipes/magic_enum/all/conandata.yml index dd9aed1156ca9..37be348e4f658 100644 --- a/recipes/magic_enum/all/conandata.yml +++ b/recipes/magic_enum/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.6": + url: "https://github.com/Neargye/magic_enum/archive/v0.9.6.tar.gz" + sha256: "814791ff32218dc869845af7eb89f898ebbcfa18e8d81aa4d682d18961e13731" "0.9.5": url: "https://github.com/Neargye/magic_enum/archive/v0.9.5.tar.gz" sha256: "44ad80db5a72f5047e01d90e18315751d9ac90c0ab42cbea7a6f9ec66a4cd679" diff --git a/recipes/magic_enum/config.yml b/recipes/magic_enum/config.yml index 45e3b1189db90..c08b3138c2531 100644 --- a/recipes/magic_enum/config.yml +++ b/recipes/magic_enum/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.6": + folder: all "0.9.5": folder: all "0.9.4": diff --git a/recipes/makefile-project-workspace-creator/all/conanfile.py b/recipes/makefile-project-workspace-creator/all/conanfile.py index c3268efeaebb0..4a70766451e93 100644 --- a/recipes/makefile-project-workspace-creator/all/conanfile.py +++ b/recipes/makefile-project-workspace-creator/all/conanfile.py @@ -1,37 +1,51 @@ 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 + +required_conan_version = ">=1.53.0" class MPCGeneratorConan(ConanFile): name = "makefile-project-workspace-creator" description = "The Makefile, Project and Workspace Creator" license = "BSD-3-Clause" - homepage = "https://objectcomputing.com/" url = "https://github.com/conan-io/conan-center-index" - topics = ("conan", "makefile-project-workspace-creator", "objectcomputing", "installer") - settings = "os" + homepage = "https://github.com/objectcomputing/MPC" + topics = ("objectcomputing", "installer") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "build-scripts" + settings = "os", "arch", "compiler", "build_type" - def requirements(self): - if self.settings.os == "Windows": - self.requires("strawberryperl/5.30.0.1") + def layout(self): + basic_layout(self, src_folder="src") - def build(self): - pass + def package_id(self): + self.info.clear() - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("MPC-MPC_" + self.version.replace(".", "_"), self._source_subfolder) + def build(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="*", src=self._source_subfolder, dst="bin") - self.copy(pattern="LICENSE", src=os.path.join(self._source_subfolder, "docs"), dst="licenses") + copy(self, "*", + src=self.build_folder, + dst=os.path.join(self.package_folder, "bin"), + excludes=["history", "docs", "rpm", "MPC.ico", "PROBLEM-REPORT-FORM", "azure-pipelines.yml", "ChangeLog"]) + copy(self, "LICENSE", + src=os.path.join(self.build_folder, "docs"), + dst=os.path.join(self.package_folder, "licenses")) 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: %s' % bin_path) + # MPC_ROOT: https://github.com/objectcomputing/MPC/blob/5b4c2443871e5e9b6267edef17fed66afc125fa4/docs/USAGE#L243 + self.buildenv_info.define("MPC_ROOT", bin_path) + + # TODO: Remove after dropping Conan 1.x self.env_info.PATH.append(bin_path) self.env_info.MPC_ROOT = bin_path diff --git a/recipes/makefile-project-workspace-creator/all/test_package/conanfile.py b/recipes/makefile-project-workspace-creator/all/test_package/conanfile.py index d02d604b53d44..a57997b529e79 100644 --- a/recipes/makefile-project-workspace-creator/all/test_package/conanfile.py +++ b/recipes/makefile-project-workspace-creator/all/test_package/conanfile.py @@ -1,12 +1,25 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.layout import basic_layout +from conan.tools.files import save, load +import os -class DefaultNameConan(ConanFile): - settings = "os" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" - def build(self): - pass + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + build_vars = self.dependencies[self.tested_reference_str].buildenv_info.vars(self, scope="build") + mpc_root = build_vars["MPC_ROOT"] + save(self, os.path.join(self.build_folder, "mpc_root.txt"), mpc_root) def test(self): - if not tools.cross_building(self.settings): - self.run("perl -S mpc.pl --version", run_environment=True) + mpc_root = load(self, os.path.join(self.build_folder, "mpc_root.txt")) + assert os.path.exists(os.path.join(mpc_root, 'mpc.pl')) diff --git a/recipes/materialx/all/conandata.yml b/recipes/materialx/all/conandata.yml new file mode 100644 index 0000000000000..833be07aa53a6 --- /dev/null +++ b/recipes/materialx/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.38.10": + url: "https://github.com/AcademySoftwareFoundation/MaterialX/archive/refs/tags/v1.38.10.tar.gz" + sha256: "706f44100188bc283a135ad24b348e55b405ac9e70cb64b7457c381383cc2887" diff --git a/recipes/materialx/all/conanfile.py b/recipes/materialx/all/conanfile.py new file mode 100644 index 0000000000000..2c3fec3a18990 --- /dev/null +++ b/recipes/materialx/all/conanfile.py @@ -0,0 +1,188 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, export_conandata_patches, get, rm, rmdir +from conan.tools.apple import is_apple_os +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class MaterialXConan(ConanFile): + name = "materialx" + description = "MaterialX is an open standard for the exchange of rich material and look-development content across applications and renderers." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AcademySoftwareFoundation/MaterialX" + topics = ("vfx", "3d", "graphics", "aswf") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openimageio": [True, False], + "build_gen_msl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openimageio": False, + "build_gen_msl": True + } + + short_paths = True + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + # src_folder must use the same source folder name the project + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_openimageio: + self.requires("openimageio/2.5.10.1") + if self.settings.os in ["Linux", "FreeBSD"]: + self.requires("xorg/system") + self.requires("opengl/system") + + def validate(self): + # validate the minimum cpp standard supported. For C++ projects only + 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 build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MATERIALX_BUILD_TESTS"] = False + tc.variables["MATERIALX_TEST_RENDER"] = False + tc.variables["MATERIALX_BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["MATERIALX_BUILD_GEN_MSL"] = self.options.build_gen_msl and is_apple_os + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "resources")) + rmdir(self, os.path.join(self.package_folder, "libraries")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "README.md", self.package_folder) + rm(self, "CHANGELOG.md", self.package_folder) + rm(self, "THIRD-PARTY.md", self.package_folder) + rm(self, "LICENSE", self.package_folder) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("dl") + + self.cpp_info.components["MaterialXCore"].libs = ["MaterialXCore"] + + self.cpp_info.components["MaterialXFormat"].libs = ["MaterialXFormat"] + self.cpp_info.components["MaterialXFormat"].requires = ["MaterialXCore"] + + self.cpp_info.components["MaterialXGenGlsl"].libs = ["MaterialXGenGlsl"] + self.cpp_info.components["MaterialXGenGlsl"].requires = ["MaterialXCore", "MaterialXGenShader"] + + self.cpp_info.components["MaterialXGenMdl"].libs = ["MaterialXGenMdl"] + self.cpp_info.components["MaterialXGenMdl"].requires = ["MaterialXCore", "MaterialXGenShader"] + + self.cpp_info.components["MaterialXGenMsl"].libs = ["MaterialXGenMsl"] + self.cpp_info.components["MaterialXGenMsl"].requires = ["MaterialXCore", "MaterialXGenShader"] + + self.cpp_info.components["MaterialXGenOsl"].libs = ["MaterialXGenOsl"] + self.cpp_info.components["MaterialXGenOsl"].requires = ["MaterialXCore", "MaterialXGenShader"] + + self.cpp_info.components["MaterialXGenShader"].libs = ["MaterialXGenShader"] + self.cpp_info.components["MaterialXGenShader"].requires = ["MaterialXCore", "MaterialXFormat"] + + self.cpp_info.components["MaterialXRender"].libs = ["MaterialXRender"] + self.cpp_info.components["MaterialXRender"].requires = ["MaterialXGenShader"] + if self.options.with_openimageio: + self.cpp_info.components["MaterialXRender"].requires.append("openimageio::openimageio") + + self.cpp_info.components["MaterialXRenderGlsl"].libs = ["MaterialXRenderGlsl"] + self.cpp_info.components["MaterialXRenderGlsl"].requires = ["MaterialXRenderHw", "MaterialXGenGlsl"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["MaterialXRenderGlsl"].requires.append("opengl::opengl") + elif self.settings.os in ["Macos", "iOS"]: + self.cpp_info.frameworks.extend(["Foundation", "Cocoa", "OpenGL"]) + if self.settings.os == "Macos": + self.cpp_info.includedirs.extend(["include/compat/osx"]) + else: + self.cpp_info.includedirs.extend(["include/compat/ios"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("opengl32") + + self.cpp_info.components["MaterialXRenderHw"].libs = ["MaterialXRenderHw"] + self.cpp_info.components["MaterialXRenderHw"].requires = ["MaterialXRender"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["MaterialXRenderHw"].requires.append("xorg::xorg") + elif self.settings.os in ["Macos", "iOS"]: + self.cpp_info.frameworks.extend(["Foundation", "Cocoa", "AppKit", "Metal"]) + if self.settings.os == "Macos": + self.cpp_info.includedirs.extend(["include/compat/osx"]) + else: + self.cpp_info.includedirs.extend(["include/compat/ios"]) + + self.cpp_info.components["MaterialXRenderOsl"].libs = ["MaterialXRenderOsl"] + self.cpp_info.components["MaterialXRenderOsl"].requires = ["MaterialXRender"] + + if self.options.build_gen_msl: + self.cpp_info.components["MaterialXGenMsl"].libs = ["MaterialXGenMsl"] + self.cpp_info.components["MaterialXGenMsl"].requires = ["MaterialXCore", "MaterialXGenShader"] + + if self.options.build_gen_msl and self.settings.os == "Macos": + self.cpp_info.components["MaterialXRenderMsl"].libs = ["MaterialXRenderMsl"] + self.cpp_info.components["MaterialXRenderMsl"].requires = ["MaterialXRenderHw", "MaterialXGenMsl"] + self.cpp_info.frameworks.extend(["CoreFoundation", "OpenGL", "AppKit", "Metal"]) + if self.settings.os == "Macos": + self.cpp_info.includedirs.extend(["include/compat/osx"]) + else: + self.cpp_info.includedirs.extend(["include/compat/ios"]) diff --git a/recipes/materialx/all/test_package/CMakeLists.txt b/recipes/materialx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..54a09a6c2e591 --- /dev/null +++ b/recipes/materialx/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) # if the project uses c++ + +find_package(materialx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE materialx::MaterialXCore materialx::MaterialXFormat) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/materialx/all/test_package/conanfile.py b/recipes/materialx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..311e7c4a81341 --- /dev/null +++ b/recipes/materialx/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 TestMaterialXConan(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/materialx/all/test_package/test_package.cpp b/recipes/materialx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f7a9e7cefee90 --- /dev/null +++ b/recipes/materialx/all/test_package/test_package.cpp @@ -0,0 +1,42 @@ +#include + +#include +#include +#include +#include +#include + +namespace mx = MaterialX; + +int main(void) { + + mx::DocumentPtr doc = mx::createDocument(); + + // Create a base shader nodedef. + mx::NodeDefPtr simpleSrf = doc->addNodeDef("ND_simpleSrf", mx::SURFACE_SHADER_TYPE_STRING, "simpleSrf"); + simpleSrf->setInputValue("diffColor", mx::Color3(1.0f)); + simpleSrf->setInputValue("specColor", mx::Color3(0.0f)); + simpleSrf->setInputValue("roughness", 0.25f); + simpleSrf->setTokenValue("texId", "01"); + + // Create an inherited shader nodedef. + mx::NodeDefPtr anisoSrf = doc->addNodeDef("ND_anisoSrf", mx::SURFACE_SHADER_TYPE_STRING, "anisoSrf"); + anisoSrf->setInheritsFrom(simpleSrf); + anisoSrf->setInputValue("anisotropy", 0.0f); + + // Instantiate shader and material nodes. + mx::NodePtr shaderNode = doc->addNode(anisoSrf->getNodeString(), "", anisoSrf->getType()); + mx::NodePtr materialNode = doc->addMaterialNode("", shaderNode); + + // Set nodedef and shader node qualifiers. + shaderNode->setVersionString("2.0"); + anisoSrf->setVersionString("2"); + shaderNode->setVersionString("2"); + shaderNode->setType(mx::VOLUME_SHADER_TYPE_STRING); + shaderNode->setType(mx::SURFACE_SHADER_TYPE_STRING); + + // Bind a shader input to a value. + mx::InputPtr instanceSpecColor = shaderNode->setInputValue("specColor", mx::Color3(1.0f)); + + return EXIT_SUCCESS; +} diff --git a/recipes/materialx/config.yml b/recipes/materialx/config.yml new file mode 100644 index 0000000000000..88daea6e8239b --- /dev/null +++ b/recipes/materialx/config.yml @@ -0,0 +1,3 @@ +versions: + "1.38.10": + folder: all diff --git a/recipes/mathter/all/conandata.yml b/recipes/mathter/all/conandata.yml index d93f0abf24463..f12b02f2c9224 100644 --- a/recipes/mathter/all/conandata.yml +++ b/recipes/mathter/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.1.1": + url: "https://github.com/petiaccja/Mathter/archive/v1.1.1.tar.gz" + sha256: "510e6aa198cd7b207a44d319e4471021f207cba8c4d2d7e40086f1f042fe13ab" + "1.1.0": + url: "https://github.com/petiaccja/Mathter/archive/v1.1.0.tar.gz" + sha256: "a9a82126ecd80112854098a5646d38f72f0af03e9655b28ab8fa38b4c03b0870" "1.0.1": url: "https://github.com/petiaccja/Mathter/archive/v1.0.1.tar.gz" sha256: "ab90736abfa8774103b53fe2b8962981c5f117dc582b01698c18d66cd2398b8c" diff --git a/recipes/mathter/all/conanfile.py b/recipes/mathter/all/conanfile.py index b25becfd19c5b..82cdb44fbd38a 100644 --- a/recipes/mathter/all/conanfile.py +++ b/recipes/mathter/all/conanfile.py @@ -20,6 +20,12 @@ class MathterConan(ConanFile): package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + options = { + "with_xsimd": [True, False] # XSimd is optionally used for hand-rolled vectorization. + } + default_options = { + "with_xsimd": True + } no_copy_source = True @property @@ -34,6 +40,10 @@ def _compilers_minimum_version(self): "gcc": 7, "Visual Studio": 16, } + + def config_options(self): + if Version(self.version) < "1.1": + del self.options.with_xsimd def layout(self): basic_layout(self, src_folder="src") @@ -53,6 +63,10 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + def requirements(self): + if self.options.get_safe("with_xsimd"): + self.requires("xsimd/11.1.0") + def package(self): if self.version == "1.0.0": copy(self, "LICENCE", self.source_folder, os.path.join(self.package_folder, "licenses")) @@ -66,3 +80,5 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + if self.options.get_safe("with_xsimd"): + self.cpp_info.defines = ["MATHTER_USE_XSIMD=1"] diff --git a/recipes/mathter/all/test_package/test_package.cpp b/recipes/mathter/all/test_package/test_package.cpp index f9de551629038..c46788d9d6a1c 100644 --- a/recipes/mathter/all/test_package/test_package.cpp +++ b/recipes/mathter/all/test_package/test_package.cpp @@ -7,5 +7,10 @@ int main() { Vec3 v2 = {2, 5, 3}; auto r = v1 + v2; std::cout << "Mathter installation works." << std::endl; +#ifdef MATHTER_USE_XSIMD + std::cout << "XSimd enabled." << std::endl; +#else + std::cout << "XSimd disabled." << std::endl; +#endif return 0; } diff --git a/recipes/mathter/config.yml b/recipes/mathter/config.yml index af3bb0714e65c..e685e077396ef 100644 --- a/recipes/mathter/config.yml +++ b/recipes/mathter/config.yml @@ -1,4 +1,8 @@ versions: + "1.1.1": + folder: all + "1.1.0": + folder: all "1.0.1": folder: all "1.0.0": diff --git a/recipes/matio/all/conandata.yml b/recipes/matio/all/conandata.yml index 0850bf3d72ee4..2c7850edc678c 100644 --- a/recipes/matio/all/conandata.yml +++ b/recipes/matio/all/conandata.yml @@ -1,36 +1,26 @@ sources: - "1.5.18": - url: "https://downloads.sourceforge.net/project/matio/matio/1.5.18/matio-1.5.18.tar.gz" - sha256: "5fad71a63a854d821cc6f4e8c84da837149dd5fb57e1e2baeffd85fa0f28fe25" - "1.5.19": - url: "https://downloads.sourceforge.net/project/matio/matio/1.5.19/matio-1.5.19.tar.gz" - sha256: "a4fa4d248b0414fc72f3d6155f710c470d5628d3c31af834f8d5ccf06b60286f" - "1.5.21": - url: "https://downloads.sourceforge.net/project/matio/matio/1.5.21/matio-1.5.21.tar.gz" - sha256: "21809177e55839e7c94dada744ee55c1dea7d757ddaab89605776d50122fb065" "1.5.23": url: "https://downloads.sourceforge.net/project/matio/matio/1.5.23/matio-1.5.23.tar.gz" sha256: "9f91eae661df46ea53c311a1b2dcff72051095b023c612d7cbfc09406c9f4d6e" "1.5.24": url: "https://downloads.sourceforge.net/project/matio/matio/1.5.24/matio-1.5.24.tar.gz" sha256: "5106ebed5b40d02a2bb968b57bef8876701c566e039e6ebe134bab779c436f7c" + "1.5.26": + url: "https://downloads.sourceforge.net/project/matio/matio/1.5.26/matio-1.5.26.tar.gz" + sha256: "8b47c29f58e468dba7a5555371c6a72ad4c6aa8b15f459b2b0b65a303c063933" + "1.5.27": + url: "https://downloads.sourceforge.net/project/matio/matio/1.5.27/matio-1.5.27.tar.gz" + sha256: "0a6aa00b18c4512b63a8d27906b079c8c6ed41d4b2844f7a4ae598e18d22d3b3" patches: - "1.5.18": + "1.5.23": - patch_file: "patches/require-cmake-3.10.patch" - - patch_file: "patches/disable-hdf5-target.patch" - - patch_file: "patches/patch-apple-no-undefined.patch" - patch_file: "patches/cmake-install-bundle.patch" - "1.5.19": + "1.5.24": - patch_file: "patches/require-cmake-3.10.patch" - - patch_file: "patches/patch-apple-no-undefined.patch" - patch_file: "patches/cmake-install-bundle.patch" - "1.5.21": + "1.5.26": - patch_file: "patches/require-cmake-3.10.patch" - - patch_file: "patches/patch-apple-no-undefined.patch" - patch_file: "patches/cmake-install-bundle.patch" - "1.5.23": + "1.5.27": - patch_file: "patches/require-cmake-3.10.patch" - - patch_file: "patches/cmake-install-bundle.patch" - "1.5.24": - - patch_file: "patches/require-cmake-3.10.patch" - - patch_file: "patches/cmake-install-bundle.patch" + - patch_file: "patches/cmake-install-bundle-1.5.27.patch" diff --git a/recipes/matio/all/conanfile.py b/recipes/matio/all/conanfile.py index 199bb98823415..d5369f6dca220 100644 --- a/recipes/matio/all/conanfile.py +++ b/recipes/matio/all/conanfile.py @@ -54,7 +54,7 @@ def layout(self): def requirements(self): if self.options.with_hdf5: - self.requires("hdf5/1.14.1") + self.requires("hdf5/1.14.3") if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") @@ -67,6 +67,7 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + tc.variables["MATIO_ENABLE_CPPCHECK"] = False tc.variables["MATIO_EXTENDED_SPARSE"] = self.options.extended_sparse tc.variables["MATIO_PIC"] = self.options.get_safe("fPIC", True) tc.variables["MATIO_SHARED"] = self.options.shared diff --git a/recipes/matio/all/patches/cmake-install-bundle-1.5.27.patch b/recipes/matio/all/patches/cmake-install-bundle-1.5.27.patch new file mode 100644 index 0000000000000..9d320dedb44ec --- /dev/null +++ b/recipes/matio/all/patches/cmake-install-bundle-1.5.27.patch @@ -0,0 +1,14 @@ +Fix CMake configuration errors while cross-building to iOS/tvOS/watchOS + +--- a/cmake/tools.cmake ++++ b/cmake/tools.cmake +@@ -8,8 +8,5 @@ if(NOT HAVE_GETOPT) + endif() + + install(TARGETS matdump +- PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + ) diff --git a/recipes/matio/all/patches/disable-hdf5-target.patch b/recipes/matio/all/patches/disable-hdf5-target.patch deleted file mode 100644 index 8f9c45cb87de8..0000000000000 --- a/recipes/matio/all/patches/disable-hdf5-target.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/cmake/thirdParties.cmake -+++ b/cmake/thirdParties.cmake -@@ -29,8 +29,8 @@ if(MATIO_WITH_HDF5) - endif() - endif() - --if(HDF5_FOUND) - set(HAVE_HDF5 1) -+if(0) - add_library(HDF5::HDF5 INTERFACE IMPORTED) - if(MATIO_USE_CONAN AND TARGET CONAN_PKG::hdf5) - # target from Conan diff --git a/recipes/matio/all/patches/patch-apple-no-undefined.patch b/recipes/matio/all/patches/patch-apple-no-undefined.patch deleted file mode 100644 index 6dbb97ff53471..0000000000000 --- a/recipes/matio/all/patches/patch-apple-no-undefined.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/cmake/src.cmake -+++ b/cmake/src.cmake -@@ -37,8 +37,12 @@ if(STDINT_MSVC) - endif() - - if(NOT MSVC) -- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") -- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--retain-symbols-file,${PROJECT_SOURCE_DIR}/src/matio.sym") -+ if(APPLE) -+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error") -+ else() -+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") -+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--retain-symbols-file,${PROJECT_SOURCE_DIR}/src/matio.sym") -+ endif() - endif() - - if(MATIO_SHARED) diff --git a/recipes/matio/config.yml b/recipes/matio/config.yml index 32213bb4d952d..71576cf31a76e 100644 --- a/recipes/matio/config.yml +++ b/recipes/matio/config.yml @@ -1,11 +1,9 @@ versions: - "1.5.18": + "1.5.27": folder: all - "1.5.19": + "1.5.26": folder: all - "1.5.21": + "1.5.24": folder: all "1.5.23": folder: all - "1.5.24": - folder: all diff --git a/recipes/mbedtls/all/conandata.yml b/recipes/mbedtls/all/conandata.yml index 4fc47c13a49df..59921058d7fdf 100644 --- a/recipes/mbedtls/all/conandata.yml +++ b/recipes/mbedtls/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.6.0": + url: "https://github.com/Mbed-TLS/mbedtls/releases/download/v3.6.0/mbedtls-3.6.0.tar.bz2" + sha256: "3ecf94fcfdaacafb757786a01b7538a61750ebd85c4b024f56ff8ba1490fcd38" "3.5.2": url: "https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.5.2.tar.gz" sha256: "eedecc468b3f8d052ef05a9d42bf63f04c8a1c50d1c5a94c251c681365a2c723" @@ -20,6 +23,9 @@ sources: "3.0.0": url: "https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.0.0.tar.gz" sha256: "377d376919be19f07c7e7adeeded088a525be40353f6d938a78e4f986bce2ae0" + "2.28.8": + url: "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v2.28.8.tar.gz" + sha256: "4fef7de0d8d542510d726d643350acb3cdb9dc76ad45611b59c9aa08372b4213" "2.28.4": url: "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v2.28.4.tar.gz" sha256: "578c4dcd15bbff3f5cd56aa07cd4f850fc733634e3d5947be4f7157d5bfd81ac" diff --git a/recipes/mbedtls/all/conanfile.py b/recipes/mbedtls/all/conanfile.py index 6b9782288fcdd..4ccbcab9405bc 100644 --- a/recipes/mbedtls/all/conanfile.py +++ b/recipes/mbedtls/all/conanfile.py @@ -26,11 +26,13 @@ class MBedTLSConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_zlib": [True, False], + "enable_threading": [True, False], } default_options = { "shared": False, "fPIC": True, "with_zlib": True, + "enable_threading": False, } def config_options(self): @@ -54,8 +56,12 @@ def requirements(self): self.requires("zlib/[>=1.2.11 <2]") def validate(self): - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} does not support shared build on Windows") + if self.settings.os == "Windows": + if self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} does not support shared build on Windows") + if self.options.enable_threading: + # INFO: Planned: https://github.com/Mbed-TLS/mbedtls/issues/8455 + raise ConanInvalidConfiguration(f"{self.ref} does not support the option enable_threading on Windows") if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": # The command line flags set are not supported on older versions of gcc @@ -86,6 +92,10 @@ def generate(self): tc.preprocessor_definitions["MBEDTLS_PLATFORM_SNPRINTF_MACRO"] = "snprintf" else: tc.preprocessor_definitions["MBEDTLS_PLATFORM_SNPRINTF_MACRO"] = "MBEDTLS_PLATFORM_STD_SNPRINTF" + if self.options.enable_threading: + tc.preprocessor_definitions["MBEDTLS_THREADING_C"] = True + tc.preprocessor_definitions["MBEDTLS_THREADING_PTHREAD"] = True + tc.generate() tc = CMakeDeps(self) tc.generate() @@ -100,6 +110,7 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "cmake")) def package_info(self): @@ -110,16 +121,26 @@ def package_info(self): self.cpp_info.components["mbedcrypto"].libs = ["mbedcrypto"] if self.settings.os == "Windows": self.cpp_info.components["mbedcrypto"].system_libs = ["bcrypt"] + if Version(self.version) >= "3.6.0": + self.cpp_info.components["mbedcrypto"].set_property("pkg_config_name", "mbedcrypto") + if self.options.enable_threading: + self.cpp_info.components["mbedcrypto"].defines.extend(["MBEDTLS_THREADING_C=1", "MBEDTLS_THREADING_PTHREAD=1"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["mbedcrypto"].system_libs.append("pthread") self.cpp_info.components["mbedx509"].set_property("cmake_target_name", "MbedTLS::mbedx509") self.cpp_info.components["mbedx509"].libs = ["mbedx509"] if self.settings.os == "Windows": self.cpp_info.components["mbedx509"].system_libs = ["ws2_32"] self.cpp_info.components["mbedx509"].requires = ["mbedcrypto"] + if Version(self.version) >= "3.6.0": + self.cpp_info.components["mbedx509"].set_property("pkg_config_name", "mbedx509") self.cpp_info.components["libembedtls"].set_property("cmake_target_name", "MbedTLS::mbedtls") self.cpp_info.components["libembedtls"].libs = ["mbedtls"] self.cpp_info.components["libembedtls"].requires = ["mbedx509"] + if Version(self.version) >= "3.6.0": + self.cpp_info.components["libembedtls"].set_property("pkg_config_name", "embedtls") if self.options.get_safe("with_zlib"): for component in self.cpp_info.components: diff --git a/recipes/mbedtls/config.yml b/recipes/mbedtls/config.yml index 0b85d9e34743c..b30565c2258dc 100644 --- a/recipes/mbedtls/config.yml +++ b/recipes/mbedtls/config.yml @@ -1,4 +1,6 @@ versions: + "3.6.0": + folder: all "3.5.2": folder: all "3.5.1": @@ -13,6 +15,8 @@ versions: folder: all "3.0.0": folder: all + "2.28.8": + folder: all "2.28.4": folder: all "2.25.0": diff --git a/recipes/mbits-utfconv/all/conandata.yml b/recipes/mbits-utfconv/all/conandata.yml index f315fc7cf457d..321d37c79ca7e 100644 --- a/recipes/mbits-utfconv/all/conandata.yml +++ b/recipes/mbits-utfconv/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.4": + url: "https://github.com/mbits-libs/utfconv/archive/v1.0.4.tar.gz" + sha256: "cd4b6cbed75d67a02399add312b93c4c1de9ac53cf33a8bf44baece038fabb60" "1.0.3": url: "https://github.com/mbits-libs/utfconv/archive/v1.0.3.tar.gz" sha256: "2077e3dcb999dc76d2bdc06cc141b38e10f15762975c261f72cc1a8c2519a27a" diff --git a/recipes/mbits-utfconv/config.yml b/recipes/mbits-utfconv/config.yml index 372dd1cb646bd..20b5bf02cf8c7 100644 --- a/recipes/mbits-utfconv/config.yml +++ b/recipes/mbits-utfconv/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.4": + folder: all "1.0.3": folder: all diff --git a/recipes/mcap/all/conandata.yml b/recipes/mcap/all/conandata.yml index 4ede1237bc36c..86d2a620395b9 100644 --- a/recipes/mcap/all/conandata.yml +++ b/recipes/mcap/all/conandata.yml @@ -1,37 +1,40 @@ sources: + "1.4.0": + url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.4.0.tar.gz" + sha256: "64ff3e51119f37ffcfaf9deecbd987a7cb4d4d9035d74a3fd3773395a470fda1" "1.3.0": url: "https://github.com/foxglove/mcap/archive/releases/cpp/v1.3.0.tar.gz" sha256: "41acf6e85d75556c64407f077e05492d31db1f099e07242ef04364bb2939acf1" "1.2.1": url: "https://github.com/foxglove/mcap/archive/releases/cpp/v1.2.1.tar.gz" sha256: "fdc0c351bbcf8883fec0047ff84fed74da88446859083beb6624a584e2cde669" - 1.2.0: + "1.2.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.2.0/main.tar.gz" sha256: "11a6badecac2b10e9687e912648a6e9679ef8731e4ab9570346ae9845ae64a65" - 1.1.0: + "1.1.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.1.0/main.tar.gz" sha256: "1cb2ae9f2e910eeb2e93b3ab722744d1805b9da45764e4fd88703b669413350d" - 1.0.0: + "1.0.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.0.0/main.tar.gz" sha256: "e36169e46a67a9431f73df335f67488461817bc423f9af63ac0af7f29e0bd696" - 0.9.0: + "0.9.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.9.0/main.tar.gz" sha256: "e17702fcc0259bf72eab0d84d3fa6e02c051256357ab7ba4421462f2c02b434f" - 0.5.0: + "0.5.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.5.0/main.tar.gz" sha256: "408e255a6c6419b16de38a9ecbdd9729d60adc657767b2d52a234d1da1185349" - 0.4.0: + "0.4.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.4.0/main.tar.gz" sha256: "c0ab99e51005fa8b74fe9ca1ed23b205cf532b8b0723eedd243f35a28d7b466b" - 0.3.0: + "0.3.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.3.0/main.tar.gz" sha256: "ef29ea4c09520b8aaa2d78ce5e79cbbcd87511ed14d6abf3c4b249ae67a4153b" - 0.1.2: + "0.1.2": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.1.2/main.tar.gz" sha256: "0f456d6c53730445c3dbf57afd285493cf748c66a02f77d6e48c075128fd0896" - 0.1.1: + "0.1.1": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.1.1/main.tar.gz" sha256: "a9ea899315851bfacdb234b7acc917b1a9c67593f0d68e1920321a8f6fa2cfbf" - 0.1.0: + "0.1.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.1.0/main.tar.gz" sha256: "a936abb1493b0d189d7909a79c45bdc6703b6016801e10b5cd129ba39642d2b2" diff --git a/recipes/mcap/config.yml b/recipes/mcap/config.yml index fb6aa455469ea..693870396f82a 100644 --- a/recipes/mcap/config.yml +++ b/recipes/mcap/config.yml @@ -1,25 +1,27 @@ versions: + "1.4.0": + folder: all "1.3.0": folder: all "1.2.1": folder: all - 1.2.0: + "1.2.0": folder: all - 1.1.0: + "1.1.0": folder: all - 1.0.0: + "1.0.0": folder: all - 0.9.0: + "0.9.0": folder: all - 0.5.0: + "0.5.0": folder: all - 0.4.0: + "0.4.0": folder: all - 0.3.0: + "0.3.0": folder: all - 0.1.2: + "0.1.2": folder: all - 0.1.1: + "0.1.1": folder: all - 0.1.0: + "0.1.0": folder: all diff --git a/recipes/md4c/all/conanfile.py b/recipes/md4c/all/conanfile.py index 554edcc0d2057..40333503038dd 100644 --- a/recipes/md4c/all/conanfile.py +++ b/recipes/md4c/all/conanfile.py @@ -20,11 +20,13 @@ class Md4cConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "md2html": [True, False], "encoding": ["utf-8", "utf-16", "ascii"], } default_options = { "shared": False, "fPIC": True, + "md2html": True, "encoding": "utf-8", } @@ -53,6 +55,7 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + tc.variables["BUILD_MD2HTML_EXECUTABLE"] = self.options.md2html if self.options.encoding == "utf-8": tc.preprocessor_definitions["MD4C_USE_UTF8"] = "1" elif self.options.encoding == "utf-16": diff --git a/recipes/md4qt/all/conandata.yml b/recipes/md4qt/all/conandata.yml index 46312df8b8947..e803e1133c2a4 100644 --- a/recipes/md4qt/all/conandata.yml +++ b/recipes/md4qt/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.8.2": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.8.2.tar.gz" + sha256: "4f560d752ead3aba4983bd09d87e9e32a8313770d7fde0374988785d193b386a" + "2.8.1": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.8.1.tar.gz" + sha256: "02a046c1586da820be0c5dd36f635ca50060f893fe638b542546f4a7a07d3164" "2.8.0": url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.8.0.tar.gz" sha256: "82ef6acc84ea3a7891e4547f7d79af4caaef0f4d6f152bdab2a5c6ed5a48d11b" diff --git a/recipes/md4qt/all/conanfile.py b/recipes/md4qt/all/conanfile.py index 90fcedd907a99..8e13c7e378f4f 100644 --- a/recipes/md4qt/all/conanfile.py +++ b/recipes/md4qt/all/conanfile.py @@ -60,7 +60,10 @@ def build(self): pass def package(self): - copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) <= "2.8.1": + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + else: + copy(self, "MIT.txt", src=os.path.join(self.source_folder, "LICENSES"), dst=os.path.join(self.package_folder, "licenses")) copy(self, "*.hpp", src=os.path.join(self.source_folder, "md4qt"), dst=os.path.join(self.package_folder, "include", "md4qt")) def package_info(self): diff --git a/recipes/md4qt/config.yml b/recipes/md4qt/config.yml index fb12b4088b445..39e742c86f556 100644 --- a/recipes/md4qt/config.yml +++ b/recipes/md4qt/config.yml @@ -1,4 +1,8 @@ versions: + "2.8.2": + folder: all + "2.8.1": + folder: all "2.8.0": folder: all "2.7.4": diff --git a/recipes/meshoptimizer/all/conandata.yml b/recipes/meshoptimizer/all/conandata.yml index 123647cd81c5f..94a9a85900a6d 100644 --- a/recipes/meshoptimizer/all/conandata.yml +++ b/recipes/meshoptimizer/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.21": + url: "https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.21.tar.gz" + sha256: "050A5438E4644833FF69F35110FCF4E37038A89C5FDC8AED45D8CD848ECB3A20" "0.20": url: "https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.20.tar.gz" sha256: "CF1077A83958BED3D8DA28A841CA53A6A42D871E49023EDCE64E37002A0F5A48" diff --git a/recipes/meshoptimizer/config.yml b/recipes/meshoptimizer/config.yml index 31e2badfe4c2f..bb6c09f07b3de 100644 --- a/recipes/meshoptimizer/config.yml +++ b/recipes/meshoptimizer/config.yml @@ -1,4 +1,6 @@ versions: + "0.21": + folder: all "0.20": folder: all "0.17": diff --git a/recipes/meson/all/conandata.yml b/recipes/meson/all/conandata.yml index f567bf8d56087..ff346a78a0f7d 100644 --- a/recipes/meson/all/conandata.yml +++ b/recipes/meson/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.5.0": + url: "https://github.com/mesonbuild/meson/archive/1.5.0.tar.gz" + sha256: "781913826fb6f478eb7d77e1942ab3df39444e4c90e9a3523737e215171db469" + "1.4.1": + url: "https://github.com/mesonbuild/meson/archive/1.4.1.tar.gz" + sha256: "a7efc72ecb873c5a62031ade1921a7177b67cfdcb2e9410a7ab023f9e8192f4b" "1.4.0": url: "https://github.com/mesonbuild/meson/archive/1.4.0.tar.gz" sha256: "61382f295378bddcd9bebb3a9a9065b1cbc671fa41b80964ab02726f9a5f3a88" @@ -26,60 +32,23 @@ sources: "1.1.1": url: "https://github.com/mesonbuild/meson/releases/download/1.1.1/meson-1.1.1.tar.gz" sha256: "d04b541f97ca439fb82fab7d0d480988be4bd4e62563a5ca35fadb5400727b1c" + # qt requires 1.1.0 "1.1.0": url: "https://github.com/mesonbuild/meson/archive/1.1.0.tar.gz" sha256: "f29a3e14062043d75e82d16f1e41856e6b1ed7a7c016e10c7b13afa7ee6364cc" - "1.0.1": - url: "https://github.com/mesonbuild/meson/archive/1.0.1.tar.gz" - sha256: "4ab3a5c0060dc22bdefb04507efc6c38acb910e91bcd467a38e1fa211e5a6cfe" + # wayland-protocols requires 1.0.0 "1.0.0": url: "https://github.com/mesonbuild/meson/releases/download/1.0.0/meson-1.0.0.tar.gz" sha256: "aa50a4ba4557c25e7d48446abfde857957dcdf58385fffbe670ba0e8efacce05" - "0.64.1": - url: "https://github.com/mesonbuild/meson/archive/0.64.1.tar.gz" - sha256: "1d12a4bc1cf3ab18946d12cf0b6452e5254ada1ad50aacc97f87e2cccd7da315" - "0.64.0": - url: "https://github.com/mesonbuild/meson/archive/0.64.0.tar.gz" - sha256: "6477993d781b6efea93091616a6d6a0766c0e026076dbeb11249bf1c9b49a347" - "0.63.3": - url: "https://github.com/mesonbuild/meson/archive/0.63.3.tar.gz" - sha256: "7c516c2099b762203e8a0a22412aa465b7396e6f9b1ab728bad6e6db44dc2659" - "0.63.2": - url: "https://github.com/mesonbuild/meson/archive/0.63.2.tar.gz" - sha256: "023a3f7c74e68991154c3205a6975705861eedbf8130e013d15faa1df1af216e" - "0.63.1": - url: "https://github.com/mesonbuild/meson/archive/0.63.1.tar.gz" - sha256: "f355829f0e8c714423f03a06604c04c216d4cbe3586f3154cb2181076b19207a" - "0.63.0": - url: "https://github.com/mesonbuild/meson/archive/0.63.0.tar.gz" - sha256: "77808d47fa05875c2553d66cb6c6140c2f687b46256dc537eeb8a63889e0bea2" + # gtk requires 0.62.2 "0.62.2": url: "https://github.com/mesonbuild/meson/archive/0.62.2.tar.gz" sha256: "97108f4d9bb16bc758c44749bd25ec7d42c6a762961efbed8b7589a2a3551ea6" - "0.62.1": - url: "https://github.com/mesonbuild/meson/archive/0.62.1.tar.gz" - sha256: "9fb52e66dbc613479a5f70e46cc2e8faf5aa65e09313f2c71fa63b8afd018107" - "0.62.0": - url: "https://github.com/mesonbuild/meson/archive/0.62.0.tar.gz" - sha256: "72ac3bab701dfd597604de29cc74baaa1cc0ad8ca26ae23d5288de26abfe1c80" + # gst-plugins-base requires 0.61.2 "0.61.2": url: "https://github.com/mesonbuild/meson/archive/0.61.2.tar.gz" sha256: "33cd555314a94d52acfbb3f6f44d4e61c4ad0bfec7acf4301be7e40bb969b3a8" - "0.60.2": - url: "https://github.com/mesonbuild/meson/archive/0.60.2.tar.gz" - sha256: "fc7c2f315b5b63fee0414b0b94b5a7d0e9c71c8c9bb8487314eb5a9a33984b8d" + # gobject-introspection requires 0.59.3 "0.59.3": url: "https://github.com/mesonbuild/meson/archive/0.59.3.tar.gz" sha256: "b2c5bfd5032189a66cf6a32d98ba82d94d7d314577d8efe4d9dc159c4073f282" - "0.58.1": - url: "https://github.com/mesonbuild/meson/archive/0.58.1.tar.gz" - sha256: "78e0f553dd3bc632d5f96ab943b1bbccb599c2c84ff27c5fb7f7fff9c8a3f6b4" - "0.57.2": - url: "https://github.com/mesonbuild/meson/archive/0.57.2.tar.gz" - sha256: "cd3773625253df4fd1c380faf03ffae3d02198d6301e7c8bc7bba6c66af66096" - "0.56.2": - url: "https://github.com/mesonbuild/meson/archive/0.56.2.tar.gz" - sha256: "aaae961c3413033789248ffe6762589e80b6cf487c334d0b808e31a32c48f35f" - "0.55.3": - url: "https://github.com/mesonbuild/meson/archive/0.55.3.tar.gz" - sha256: "2b276df50c5b13ccdbfb14d3333141e9e7985aca31b60400b3f3e0be2ee6897e" diff --git a/recipes/meson/config.yml b/recipes/meson/config.yml index 2b56413242adf..ef65493e12e2f 100644 --- a/recipes/meson/config.yml +++ b/recipes/meson/config.yml @@ -1,4 +1,8 @@ versions: + "1.5.0": + folder: all + "1.4.1": + folder: all "1.4.0": folder: all "1.3.2": @@ -19,39 +23,11 @@ versions: folder: all "1.1.0": folder: all - "1.0.1": - folder: all "1.0.0": folder: all - "0.64.1": - folder: all - "0.64.0": - folder: all - "0.63.3": - folder: all - "0.63.2": - folder: all - "0.63.1": - folder: all - "0.63.0": - folder: all "0.62.2": folder: all - "0.62.1": - folder: all - "0.62.0": - folder: all "0.61.2": folder: all - "0.60.2": - folder: all "0.59.3": folder: all - "0.58.1": - folder: all - "0.57.2": - folder: all - "0.56.2": - folder: all - "0.55.3": - folder: all diff --git a/recipes/metal-cpp/all/conandata.yml b/recipes/metal-cpp/all/conandata.yml new file mode 100644 index 0000000000000..2fd6dd33feee7 --- /dev/null +++ b/recipes/metal-cpp/all/conandata.yml @@ -0,0 +1,30 @@ +sources: + "14.2": + url: "https://developer.apple.com/metal/cpp/files/metal-cpp_macOS14.2_iOS17.2.zip" + sha256: "d800ddbc3fccabce3a513f975eeafd4057e07a29e905ad5aaef8c1f4e12d9ada" + "14": + url: "https://developer.apple.com/metal/cpp/files/metal-cpp_macOS14_iOS17-beta.zip" + sha256: "2009a339ecbd56b36601435fe08c415749f8ad09145755472bb637b319003367" + "13.3": + url: "https://developer.apple.com/metal/cpp/files/metal-cpp_macOS13.3_iOS16.4.zip" + sha256: "0afd87ca851465191ae4e3980aa036c7e9e02fe32e7c760ac1a74244aae6023b" + "13": + url: "https://developer.apple.com/metal/cpp/files/metal-cpp_macOS13_iOS16.zip" + sha256: "6f741894229e9c750add1afc3797274fc008c7507e2ae726370c17c34b7c6a68" +minimum_os_version: + "14.2": + "Macos": "14.2" + "iOS": "17.2" + "tvOS": "17.2" + "14": + "Macos": "14" + "iOS": "17" + "tvOS": "17" + "13.3": + "Macos": "13.3" + "iOS": "16.4" + "tvOS": "16.4" + "13": + "Macos": "13" + "iOS": "16" + "tvOS": "16" diff --git a/recipes/metal-cpp/all/conanfile.py b/recipes/metal-cpp/all/conanfile.py new file mode 100644 index 0000000000000..2efbdaef9686f --- /dev/null +++ b/recipes/metal-cpp/all/conanfile.py @@ -0,0 +1,92 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import XCRun +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +import os +import platform + +required_conan_version = ">=1.53.0" + + +class MetalcppConan(ConanFile): + name = "metal-cpp" + description = ( + "Library for the usage of Apple Metal GPU programming in C++ applications - " + "Header-only library to wrap Metal in C++ classes" + ) + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://developer.apple.com/metal/cpp/" + topics = ("metal", "gpu", "apple", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def validate(self): + os_name = str(self.settings.os) + if not os_name in ["Macos", "iOS", "tvOS"]: + raise ConanInvalidConfiguration("Metal can only be used on an Macos, iOS or tvOS platform.") + + if self.settings.compiler.get_safe("cppstd"): + min_cppstd = "17" + check_min_cppstd(self, min_cppstd) + + minimum_os_version = self.conan_data["minimum_os_version"][self.version][os_name] + + xcrun = XCRun(self) + os_version = self.settings.get_safe("os.version") + sdk_version = self.settings.get_safe("os.sdk_version") + visible_sdk_version = xcrun.sdk_version if platform.system() == "Darwin" else None + + sdk_version = sdk_version or os_version or visible_sdk_version + + if sdk_version is None: + # Will raise when `os.version` or `os.sdk_version` are not defined + # and we are *NOT* running this on macOS + raise ConanInvalidConfiguration(f"metal-cpp {self.version} requires the os.version or sdk.version settings, but the are not defined") + + if sdk_version < Version(minimum_os_version): + raise ConanInvalidConfiguration(f"metal-cpp {self.version} requires {os_name} SDK version {minimum_os_version} but {sdk_version} is the target.") + + def package(self): + copy( + self, + pattern="LICENSE.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=os.path.join(self.source_folder) + ) + copy( + self, + pattern="**.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder), + keep_path=True + ) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "metal-cpp") + self.cpp_info.set_property("cmake_target_name", "metal-cpp::metal-cpp") + self.cpp_info.set_property("pkg_config_name", "metal-cpp") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + self.cpp_info.frameworks = ["Foundation", "Metal", "MetalKit", "QuartzCore"] + if self.version >= Version('14'): + self.cpp_info.frameworks.append("MetalFX") diff --git a/recipes/metal-cpp/all/test_package/CMakeLists.txt b/recipes/metal-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..640984ec9c7f0 --- /dev/null +++ b/recipes/metal-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(metal-cpp REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE metal-cpp::metal-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/metal-cpp/all/test_package/conanfile.py b/recipes/metal-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e28de31d33b1c --- /dev/null +++ b/recipes/metal-cpp/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def validate(self): + if not is_apple_os(self): + raise ConanInvalidConfiguration("Metal can only be used on an Apple OS.") + + 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/metal-cpp/all/test_package/test_package.cpp b/recipes/metal-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bb32b01f0db92 --- /dev/null +++ b/recipes/metal-cpp/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include + +#define NS_PRIVATE_IMPLEMENTATION +#define MTL_PRIVATE_IMPLEMENTATION + +#include +#include + + +int main() +{ + // Create a metal device to check the library functions + MTL::Device* metalDevice = MTL::CreateSystemDefaultDevice(); + + std::cout << "Metal device detected: " << metalDevice->name()->cString(NS::ASCIIStringEncoding) << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/metal-cpp/config.yml b/recipes/metal-cpp/config.yml new file mode 100644 index 0000000000000..1f484bca5aa17 --- /dev/null +++ b/recipes/metal-cpp/config.yml @@ -0,0 +1,9 @@ +versions: + "14.2": + folder: all + "14": + folder: all + "13.3": + folder: all + "13": + folder: all diff --git a/recipes/metall/all/conandata.yml b/recipes/metall/all/conandata.yml index 023411b883cb5..72fbcaef70e39 100644 --- a/recipes/metall/all/conandata.yml +++ b/recipes/metall/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.28": + url: "https://github.com/LLNL/metall/archive/refs/tags/v0.28.tar.gz" + sha256: "770dedb7f8220c333688b232a22104ca9d8d5823e7a8a21152b58ef970eb85d0" "0.27": url: "https://github.com/LLNL/metall/archive/refs/tags/v0.27.tar.gz" sha256: "6e6f17a760778f9162def939701f9381a75e5275fd1eb1b2af4b2e89e86e1c58" diff --git a/recipes/metall/all/conanfile.py b/recipes/metall/all/conanfile.py index b13166986c15d..6017c84ad4f89 100644 --- a/recipes/metall/all/conanfile.py +++ b/recipes/metall/all/conanfile.py @@ -5,6 +5,7 @@ from conan.tools.layout import basic_layout from conan.tools.scm import Version import os +import platform required_conan_version = ">=1.50.0" @@ -36,13 +37,18 @@ def requirements(self): def package_id(self): self.info.clear() + @property + def _is_glibc_older_than_2_27(self): + libver = platform.libc_ver() + return self.settings.os == 'Linux' and libver[0] == 'glibc' and Version(libver[1]) < "2.27" + def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 17) if self.settings.os not in ["Linux", "Macos"]: raise ConanInvalidConfiguration( - "Metall requires some POSIX functionalities like mmap.") + f"{self.ref} requires some POSIX functionalities like mmap.") def lazy_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] @@ -56,6 +62,11 @@ def lazy_lt_semver(v1, v2): raise ConanInvalidConfiguration( "{} {} requires C++17, which your compiler does not support.".format(self.name, self.version)) + def validate_build(self): + if Version(self.version) >= "0.28" and self._is_glibc_older_than_2_27: + raise ConanInvalidConfiguration( + f"{self.ref} requires copy_file_range() which is available since glibc 2.27.") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/metall/config.yml b/recipes/metall/config.yml index 1d869b27d6481..1984e8dcd4850 100644 --- a/recipes/metall/config.yml +++ b/recipes/metall/config.yml @@ -1,4 +1,6 @@ versions: + "0.28": + folder: all "0.27": folder: all "0.26": diff --git a/recipes/metis/all/conanfile.py b/recipes/metis/all/conanfile.py index 7782c2735e124..d935fb4c025d2 100644 --- a/recipes/metis/all/conanfile.py +++ b/recipes/metis/all/conanfile.py @@ -34,7 +34,7 @@ class METISConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "with_64bit_types": True, + "with_64bit_types": False, "enable_gkrand": False, "enable_gkregex": False, "with_openmp": False, @@ -45,12 +45,7 @@ class METISConan(ConanFile): def export_sources(self): export_conandata_patches(self) copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) - copy( - self, - "gkbuild.cmake", - self.recipe_folder, - os.path.join(self.export_sources_folder, "src"), - ) + copy(self, "gkbuild.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -76,11 +71,11 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.cache_variables["VALGRIND"] = self.options.with_valgrind - tc.cache_variables["OPENMP"] = self.options.with_openmp - tc.cache_variables["PCRE"] = self.options.with_pcre - tc.cache_variables["GKREGEX"] = self.settings.os == "Windows" or self.options.enable_gkregex - tc.cache_variables["GKRAND"] = self.options.enable_gkrand + tc.variables["VALGRIND"] = self.options.with_valgrind + tc.variables["OPENMP"] = self.options.with_openmp + tc.variables["PCRE"] = self.options.with_pcre + tc.variables["GKREGEX"] = self.settings.os == "Windows" or self.options.enable_gkregex + tc.variables["GKRAND"] = self.options.enable_gkrand if self.settings.build_type == "Debug": tc.preprocessor_definitions["DEBUG"] = "" else: @@ -104,12 +99,7 @@ def build(self): cmake.build() def package(self): - copy( - self, - pattern="LICENSE", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rm(self, "*.cmake", self.package_folder, recursive=True) diff --git a/recipes/mimalloc/all/conandata.yml b/recipes/mimalloc/all/conandata.yml index 4c93c0b6b2850..879d39b04284b 100644 --- a/recipes/mimalloc/all/conandata.yml +++ b/recipes/mimalloc/all/conandata.yml @@ -1,44 +1,30 @@ sources: + "2.1.7": + url: "https://github.com/microsoft/mimalloc/archive/v2.1.7.tar.gz" + sha256: "0eed39319f139afde8515010ff59baf24de9e47ea316a315398e8027d198202d" "2.1.2": url: "https://github.com/microsoft/mimalloc/archive/v2.1.2.tar.gz" sha256: "2b1bff6f717f9725c70bf8d79e4786da13de8a270059e4ba0bdd262ae7be46eb" "2.0.9": url: "https://github.com/microsoft/mimalloc/archive/v2.0.9.tar.gz" sha256: "4a29edae32a914a706715e2ac8e7e4109e25353212edeed0888f4e3e15db5850" - "2.0.7": - url: "https://github.com/microsoft/mimalloc/archive/v2.0.7.tar.gz" - sha256: "f23aac6c73594e417af50cb38f1efed88ef1dc14a490f0eff07c7f7b079810a4" - "2.0.6": - url: "https://github.com/microsoft/mimalloc/archive/v2.0.6.tar.gz" - sha256: "9f05c94cc2b017ed13698834ac2a3567b6339a8bde27640df5a1581d49d05ce5" - "2.0.5": - url: "https://github.com/microsoft/mimalloc/archive/v2.0.5.tar.gz" - sha256: "fb000a017c289ddc0df749f16fef854e033e496276d8426bdd066b59c476f6cf" - "2.0.3": - url: "https://github.com/microsoft/mimalloc/archive/v2.0.3.tar.gz" - sha256: "5af497f360879bf9d07a5146961d275a25f4177fbe21ee6c437db604422acd60" - "2.0.2": - url: "https://github.com/microsoft/mimalloc/archive/v2.0.2.tar.gz" - sha256: "c81a5f443f72373e3105172d6a935e29b0dabd13ba387c080bc444586cbe3021" + "1.8.7": + url: "https://github.com/microsoft/mimalloc/archive/v1.8.7.tar.gz" + sha256: "347793a2c614e525edc4e286ab5cbc4c7a5efc12503e2dafca276d78394c4f07" "1.8.2": url: "https://github.com/microsoft/mimalloc/archive/v1.8.2.tar.gz" sha256: "4058d53d6ceb75862f32c30a6ee686c3cbb5e965b2c324b828ca454f7fe064f9" "1.7.9": url: "https://github.com/microsoft/mimalloc/archive/v1.7.9.tar.gz" sha256: "45e05be518363d32b2cdcce1a1fac3580895ea2e4524e1a3c7e71145cb58659f" - "1.7.7": - url: "https://github.com/microsoft/mimalloc/archive/v1.7.7.tar.gz" - sha256: "0f6663be1e1764851bf9563fcf7a6b3330e23b933eb4737dd07e3289b87895fe" "1.7.6": url: "https://github.com/microsoft/mimalloc/archive/v1.7.6.tar.gz" sha256: "d74f86ada2329016068bc5a243268f1f555edd620b6a7d6ce89295e7d6cf18da" - "1.7.5": - url: "https://github.com/microsoft/mimalloc/archive/v1.7.5.tar.gz" - sha256: "4f9ed087fc1804a8a77c4225ffc3337468f18d6c4f060c4d44f3a3eff85bc5b6" - "1.6.7": - url: "https://github.com/microsoft/mimalloc/archive/v1.6.7.tar.gz" - sha256: "111b718b496f297f128d842880e72e90e33953cf00b45ba0ccd2167e7340ed17" patches: + "2.1.7": + - patch_file: "patches/2.1.7-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" + patch_type: "portability" "2.1.2": - patch_file: "patches/2.1.2-0001-change-install-paths.patch" patch_description: "fix install paths" @@ -53,28 +39,9 @@ patches: - patch_file: "patches/2.0.9-0002-support-older-compiler.patch" patch_description: "fix compilation errors on older compilers" patch_type: "portability" - "2.0.7": - - patch_file: "patches/2.0.7-0001-change-install-paths.patch" - patch_description: "fix install paths" - patch_type: "conan" - "2.0.6": - - patch_file: "patches/2.0.6-0001-change-install-paths.patch" - patch_description: "fix install paths" - patch_type: "conan" - "2.0.5": - - patch_file: "patches/2.0.6-0001-change-install-paths.patch" - patch_description: "fix install paths" - patch_type: "conan" - "2.0.3": - - patch_file: "patches/2.0.3-0001-change-install-paths-avoid-symlink.patch" - patch_description: "fix install paths, disable creating symlink" - patch_type: "conan" - "2.0.2": - - patch_file: "patches/2.0.2-0001-change-install-paths-avoid-symlink.patch" - patch_description: "fix install paths, disable creating symlink" - patch_type: "conan" - - patch_file: "patches/2.0.2-0002-include-cstddef-to-get-std-size-t.patch" - patch_description: "include stddef" + "1.8.7": + - patch_file: "patches/1.8.7-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" patch_type: "portability" "1.8.2": - patch_file: "patches/1.8.2-0001-change-install-paths.patch" @@ -90,22 +57,7 @@ patches: - patch_file: "patches/1.7.9-0002-support-older-compiler.patch" patch_description: "fix compilation errors on older compilers" patch_type: "portability" - "1.7.7": - - patch_file: "patches/1.7.7-0001-change-install-paths.patch" - patch_description: "fix install paths" - patch_type: "conan" "1.7.6": - patch_file: "patches/1.7.5-0001-change-install-paths.patch" patch_description: "fix install paths" patch_type: "conan" - "1.7.5": - - patch_file: "patches/1.7.5-0001-change-install-paths.patch" - patch_description: "fix install paths" - patch_type: "conan" - "1.6.7": - - patch_file: "patches/1.6.7-0001-change-install-paths-avoid-symlink.patch" - patch_description: "fix install paths, disable creating symlink" - patch_type: "conan" - - patch_file: "patches/1.6.7-0002-include-cstddef-to-get-std-size-t.patch" - patch_description: "include stddef" - patch_type: "portability" diff --git a/recipes/mimalloc/all/conanfile.py b/recipes/mimalloc/all/conanfile.py index eaa8e6193ea4e..881542551c915 100644 --- a/recipes/mimalloc/all/conanfile.py +++ b/recipes/mimalloc/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file, save, collect_libs from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, VCVars from conan.tools.scm import Version +from conan.tools.env import VirtualBuildEnv import os import shutil import textwrap @@ -13,10 +14,10 @@ class MimallocConan(ConanFile): name = "mimalloc" + description = "mimalloc is a compact general purpose allocator with excellent performance." license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/microsoft/mimalloc" - description = "mimalloc is a compact general purpose allocator with excellent performance." topics = ("mimalloc", "allocator", "performance", "microsoft") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -94,6 +95,9 @@ def validate(self): self.options.get_safe("inject"): raise ConanInvalidConfiguration("Single object is incompatible with library injection") + def build_requirements(self): + self.tool_requires("cmake/[>=3.18 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -105,9 +109,12 @@ def generate(self): tc.variables["MI_BUILD_OBJECT"] = self.options.get_safe("single_object", False) tc.variables["MI_OVERRIDE"] = "ON" if self.options.override else "OFF" tc.variables["MI_SECURE"] = "ON" if self.options.secure else "OFF" + tc.variables["MI_WIN_REDIRECT"] = "OFF" if Version(self.version) >= "1.7.0": tc.variables["MI_INSTALL_TOPLEVEL"] = "ON" tc.generate() + venv = VirtualBuildEnv(self) + venv.generate(scope="build") if is_msvc(self): vcvars = VCVars(self) diff --git a/recipes/mimalloc/all/patches/1.6.7-0001-change-install-paths-avoid-symlink.patch b/recipes/mimalloc/all/patches/1.6.7-0001-change-install-paths-avoid-symlink.patch deleted file mode 100644 index 6fa2c822d32ef..0000000000000 --- a/recipes/mimalloc/all/patches/1.6.7-0001-change-install-paths-avoid-symlink.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 35460e8..e5340d5 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -206,7 +206,7 @@ endif() - # Install and output names - # ----------------------------------------------------------------------------- - --set(mi_install_dir "${CMAKE_INSTALL_PREFIX}/lib/mimalloc-${mi_version}") -+set(mi_install_dir ".") - if(MI_SECURE MATCHES "ON") - set(mi_basename "mimalloc-secure") - else() -@@ -263,7 +263,7 @@ if(MI_BUILD_SHARED) - COMMENT "Copy mimalloc-redirect.dll to output directory") - endif() - -- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_dir} LIBRARY) -+ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(EXPORT mimalloc DESTINATION ${mi_install_dir}/cmake) - endif() - -@@ -287,7 +287,7 @@ if (MI_BUILD_STATIC) - set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) - endif() - -- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_dir}) -+ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - endif() - - # install include files -@@ -297,7 +297,7 @@ install(FILES include/mimalloc-new-delete.h DESTINATION ${mi_install_dir}/includ - install(FILES cmake/mimalloc-config.cmake DESTINATION ${mi_install_dir}/cmake) - install(FILES cmake/mimalloc-config-version.cmake DESTINATION ${mi_install_dir}/cmake) - --if(NOT WIN32 AND MI_BUILD_SHARED) -+if(FALSE) - # install a symlink in the /usr/local/lib to the versioned library - set(mi_symlink "${CMAKE_SHARED_MODULE_PREFIX}${mi_basename}${CMAKE_SHARED_LIBRARY_SUFFIX}") - set(mi_soname "mimalloc-${mi_version}/${mi_symlink}.${mi_version}") diff --git a/recipes/mimalloc/all/patches/1.6.7-0002-include-cstddef-to-get-std-size-t.patch b/recipes/mimalloc/all/patches/1.6.7-0002-include-cstddef-to-get-std-size-t.patch deleted file mode 100644 index b6a13ceb0fb42..0000000000000 --- a/recipes/mimalloc/all/patches/1.6.7-0002-include-cstddef-to-get-std-size-t.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/include/mimalloc.h b/include/mimalloc.h -index 254a7d9..3c3142b 100644 ---- a/include/mimalloc.h -+++ b/include/mimalloc.h -@@ -377,6 +377,7 @@ mi_decl_nodiscard mi_decl_export void* mi_new_reallocn(void* p, size_t newcount, - #ifdef __cplusplus - - #include // PTRDIFF_MAX -+#include // std::size_t - #if (__cplusplus >= 201103L) || (_MSC_VER > 1900) // C++11 - #include // std::true_type - #include // std::forward diff --git a/recipes/mimalloc/all/patches/1.7.7-0001-change-install-paths.patch b/recipes/mimalloc/all/patches/1.7.7-0001-change-install-paths.patch deleted file mode 100644 index 108558a1f1922..0000000000000 --- a/recipes/mimalloc/all/patches/1.7.7-0001-change-install-paths.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2bc0f76..f40e272 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -360,7 +360,7 @@ if(MI_BUILD_SHARED) - install(FILES "$/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir}) - endif() - -- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) -+ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) - endif() - -@@ -384,7 +384,7 @@ if (MI_BUILD_STATIC) - set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) - endif() - -- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_objdir} LIBRARY) -+ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) - endif() - diff --git a/recipes/mimalloc/all/patches/1.8.7-0002-support-older-compiler.patch b/recipes/mimalloc/all/patches/1.8.7-0002-support-older-compiler.patch new file mode 100644 index 0000000000000..4b1890b784ff9 --- /dev/null +++ b/recipes/mimalloc/all/patches/1.8.7-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index ae6f99b..773424e 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -511,7 +511,7 @@ template struct _mi_heap_stl_allocator_common : publi + #endif + + void collect(bool force) { mi_heap_collect(this->heap.get(), force); } +- template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } ++ template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } + + protected: + std::shared_ptr heap; +@@ -522,7 +522,7 @@ protected: + this->heap.reset(hp, (_mi_destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */ + } + _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } +- template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } ++ template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } + + private: + static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } } diff --git a/recipes/mimalloc/all/patches/2.0.2-0001-change-install-paths-avoid-symlink.patch b/recipes/mimalloc/all/patches/2.0.2-0001-change-install-paths-avoid-symlink.patch deleted file mode 100644 index ffbc799da2d8e..0000000000000 --- a/recipes/mimalloc/all/patches/2.0.2-0001-change-install-paths-avoid-symlink.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt 2021-06-18 00:05:40.000000000 -0300 -+++ b/CMakeLists.txt 2021-07-14 18:02:10.941935678 -0300 -@@ -281,7 +281,7 @@ - COMMENT "Copy mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll to output directory") - endif() - -- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) -+ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) - endif() - -@@ -305,7 +305,7 @@ - set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) - endif() - -- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) -+ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - endif() - - # install include files -@@ -315,7 +315,7 @@ - install(FILES cmake/mimalloc-config.cmake DESTINATION ${mi_install_cmakedir}) - install(FILES cmake/mimalloc-config-version.cmake DESTINATION ${mi_install_cmakedir}) - --if(NOT WIN32 AND MI_BUILD_SHARED AND NOT MI_INSTALL_TOPLEVEL) -+if(FALSE) - # install a symlink in the /usr/local/lib to the versioned library - # note: use delayed prefix expansion as \${CMAKE_INSTALL_PREFIX} - set(mi_symlink "${CMAKE_SHARED_MODULE_PREFIX}${mi_basename}${CMAKE_SHARED_LIBRARY_SUFFIX}") diff --git a/recipes/mimalloc/all/patches/2.0.2-0002-include-cstddef-to-get-std-size-t.patch b/recipes/mimalloc/all/patches/2.0.2-0002-include-cstddef-to-get-std-size-t.patch deleted file mode 100644 index fc8068130bf11..0000000000000 --- a/recipes/mimalloc/all/patches/2.0.2-0002-include-cstddef-to-get-std-size-t.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/include/mimalloc.h b/include/mimalloc.h -index 254a7d9..3c3142b 100644 ---- a/include/mimalloc.h -+++ b/include/mimalloc.h -@@ -387,6 +387,7 @@ mi_decl_nodiscard mi_decl_export void* mi_new_reallocn(void* p, size_t newcount, - #ifdef __cplusplus - - #include // PTRDIFF_MAX -+#include // std::size_t - #if (__cplusplus >= 201103L) || (_MSC_VER > 1900) // C++11 - #include // std::true_type - #include // std::forward diff --git a/recipes/mimalloc/all/patches/2.0.3-0001-change-install-paths-avoid-symlink.patch b/recipes/mimalloc/all/patches/2.0.3-0001-change-install-paths-avoid-symlink.patch deleted file mode 100644 index 00b059ccae3db..0000000000000 --- a/recipes/mimalloc/all/patches/2.0.3-0001-change-install-paths-avoid-symlink.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 580e38c..19fce47 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -305,7 +305,7 @@ if(MI_BUILD_SHARED) - COMMENT "Copy mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll to output directory") - endif() - -- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) -+ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) - endif() - -@@ -329,7 +329,7 @@ if (MI_BUILD_STATIC) - set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) - endif() - -- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) -+ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - endif() - - # install include files -@@ -339,7 +339,7 @@ install(FILES include/mimalloc-new-delete.h DESTINATION ${mi_install_incdir}) - install(FILES cmake/mimalloc-config.cmake DESTINATION ${mi_install_cmakedir}) - install(FILES cmake/mimalloc-config-version.cmake DESTINATION ${mi_install_cmakedir}) - --if(NOT WIN32 AND MI_BUILD_SHARED AND NOT MI_INSTALL_TOPLEVEL) -+if(FALSE) - # install a symlink in the /usr/local/lib to the versioned library - # note: use delayed prefix expansion as \${CMAKE_INSTALL_PREFIX} - set(mi_symlink "${CMAKE_SHARED_MODULE_PREFIX}${mi_basename}${CMAKE_SHARED_LIBRARY_SUFFIX}") diff --git a/recipes/mimalloc/all/patches/2.0.6-0001-change-install-paths.patch b/recipes/mimalloc/all/patches/2.0.6-0001-change-install-paths.patch deleted file mode 100644 index bb266a46ce3f6..0000000000000 --- a/recipes/mimalloc/all/patches/2.0.6-0001-change-install-paths.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8127e09..af459af 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -319,7 +319,7 @@ if(MI_BUILD_SHARED) - install(FILES "$/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir}) - endif() - -- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) -+ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) - endif() - -@@ -343,7 +343,7 @@ if (MI_BUILD_STATIC) - set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) - endif() - -- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_objdir} LIBRARY) -+ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) - endif() - diff --git a/recipes/mimalloc/all/patches/2.0.7-0001-change-install-paths.patch b/recipes/mimalloc/all/patches/2.0.7-0001-change-install-paths.patch deleted file mode 100644 index adf1e00f9607c..0000000000000 --- a/recipes/mimalloc/all/patches/2.0.7-0001-change-install-paths.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2550f0d..da42112 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -360,7 +360,7 @@ if(MI_BUILD_SHARED) - install(FILES "$/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir}) - endif() - -- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) -+ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) - endif() - -@@ -384,7 +384,7 @@ if (MI_BUILD_STATIC) - set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) - endif() - -- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_objdir} LIBRARY) -+ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir}) - endif() - diff --git a/recipes/mimalloc/all/patches/2.1.7-0002-support-older-compiler.patch b/recipes/mimalloc/all/patches/2.1.7-0002-support-older-compiler.patch new file mode 100644 index 0000000000000..34149f1737e9e --- /dev/null +++ b/recipes/mimalloc/all/patches/2.1.7-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index c41bcc8..cc4929e 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -512,7 +512,7 @@ template struct _mi_heap_stl_allocator_common : publi + #endif + + void collect(bool force) { mi_heap_collect(this->heap.get(), force); } +- template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } ++ template bool is_equal(const _mi_heap_stl_allocator_common& x) const { return (this->heap == x.heap); } + + protected: + std::shared_ptr heap; +@@ -523,7 +523,7 @@ protected: + this->heap.reset(hp, (_mi_destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */ + } + _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } +- template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } ++ template _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { } + + private: + static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } } diff --git a/recipes/mimalloc/config.yml b/recipes/mimalloc/config.yml index 2f9902ecefeb6..8b0873bb9cd4c 100644 --- a/recipes/mimalloc/config.yml +++ b/recipes/mimalloc/config.yml @@ -1,27 +1,17 @@ versions: + "2.1.7": + folder: all + # mold requires 2.1.2 "2.1.2": folder: all "2.0.9": folder: all - "2.0.7": - folder: all - "2.0.6": - folder: all - "2.0.5": - folder: all - "2.0.3": - folder: all - "2.0.2": + "1.8.7": folder: all "1.8.2": folder: all "1.7.9": folder: all - "1.7.7": - folder: all + # arrow requires 1.7.6 "1.7.6": folder: all - "1.7.5": - folder: all - "1.6.7": - folder: all diff --git a/recipes/mingw-builds/all/conandata.yml b/recipes/mingw-builds/all/conandata.yml index 6703f0f20681d..4f44c4f767124 100644 --- a/recipes/mingw-builds/all/conandata.yml +++ b/recipes/mingw-builds/all/conandata.yml @@ -1,4 +1,26 @@ sources: + "13.2.0": + mcf: + seh: + ucrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-mcf-seh-ucrt-rt_v11-rev1.7z" + sha256: "9ae11d0b00f4deae7246471193191de62d9e0318917d3577b568e0974c3069bc" + posix: + seh: + ucrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev1.7z" + sha256: "475ee72c5ce1bd54a3e3c334bdd3be5e6575334184fd9718013aa362c9819d2f" + msvcrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-posix-seh-msvcrt-rt_v11-rev1.7z" + sha256: "7d3f84b17b235aa233f0fb5df9765bf79dbea950177a69ff99f8ad1d75b0aa6e" + win32: + seh: + ucrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev1.7z" + sha256: "74ca64c55220edd3196681782fbff653c2b9cb4f427f9e532ab6e9a0823dc997" + msvcrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-win32-seh-msvcrt-rt_v11-rev1.7z" + sha256: "15b914f38f2f2e2d6f7b9b8425ff22b7e406878b01920190b09ce0dd8259c6aa" "12.2.0": posix: seh: diff --git a/recipes/mingw-builds/all/conanfile.py b/recipes/mingw-builds/all/conanfile.py index 8b875ba354b42..913b244a11774 100644 --- a/recipes/mingw-builds/all/conanfile.py +++ b/recipes/mingw-builds/all/conanfile.py @@ -2,6 +2,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.files import copy, download, rmdir +from conan.tools.scm import Version required_conan_version = ">=1.47.0" @@ -14,14 +15,27 @@ class MingwConan(ConanFile): license = "ZPL-2.1", "MIT", "GPL-2.0-or-later" topics = ("gcc", "gnu", "unix", "mingw32", "binutils") settings = "os", "arch" - options = {"threads": ["posix", "win32"], "exception": ["seh", "sjlj"]} - default_options = {"threads": "posix", "exception": "seh"} + options = { + "threads": ["posix", "win32", "mcf"], + "exception": ["seh", "sjlj"], + "runtime": ["msvcrt", "ucrt"] + } + default_options = { + "threads": "posix", + "exception": "seh", + "runtime": "ucrt" + } provides = "mingw-w64" @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + def config_options(self): + # Before version 12 (included) the only possible runtime was msvcrt + if Version(self.version) <= Version("12.2.0"): + del self.options.runtime + def validate(self): valid_os = ["Windows"] if str(self.settings.os) not in valid_os: @@ -52,15 +66,20 @@ def validate(self): def build_requirements(self): self.build_requires("7zip/19.00") + def _get_source(self): + if Version(self.version) <= Version("12.2.0"): + return self.conan_data["sources"][self.version][str(self.options.threads)][str(self.options.exception)] + else: + return self.conan_data["sources"][self.version][str(self.options.threads)][str(self.options.exception)][str(self.options.runtime)] + def build(self): # Source should be downloaded in the build step since it depends on specific options - url = self.conan_data["sources"][self.version][str(self.options.threads)][str(self.options.exception)] + url = self._get_source() self.output.info(f"Downloading: {url['url']}") download(self, url["url"], "file.7z", sha256=url["sha256"]) self.run("7z x file.7z") os.remove('file.7z') - def package(self): target = "mingw64" if self.settings.arch == "x86_64" else "mingw32" copy(self, "*", src=target, dst=self.package_folder) diff --git a/recipes/mingw-builds/config.yml b/recipes/mingw-builds/config.yml index 6ceaf5fe4c164..337b953faeff9 100644 --- a/recipes/mingw-builds/config.yml +++ b/recipes/mingw-builds/config.yml @@ -1,4 +1,6 @@ versions: + "13.2.0": + folder: "all" "12.2.0": folder: "all" "12.1.0": diff --git a/recipes/mini/all/conandata.yml b/recipes/mini/all/conandata.yml new file mode 100644 index 0000000000000..da5a086ee7d80 --- /dev/null +++ b/recipes/mini/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.9.15": + url: "https://github.com/metayeti/mINI/archive/refs/tags/0.9.15.tar.gz" + sha256: "241e105ab074827ab8b40582aa7b04c6191f84b244603969965c0874ad4f942c" diff --git a/recipes/mini/all/conanfile.py b/recipes/mini/all/conanfile.py new file mode 100644 index 0000000000000..938a8179ad53f --- /dev/null +++ b/recipes/mini/all/conanfile.py @@ -0,0 +1,65 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class MiniConan(ConanFile): + name = "mini" + description = "INI file reader and writer" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/metayeti/mINI" + topics = ("ini", "writer", "reader", "header-only") + 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": "191", + "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", 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"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/mini/all/test_package/CMakeLists.txt b/recipes/mini/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b1d6d15b13411 --- /dev/null +++ b/recipes/mini/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(mini REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mini::mini) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/mini/all/test_package/conanfile.py b/recipes/mini/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/mini/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/mini/all/test_package/test_package.cpp b/recipes/mini/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ee74c82e08d01 --- /dev/null +++ b/recipes/mini/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include "mini/ini.h" + +int main(void) { + mINI::INIFile file("test_package.ini"); + + std::cout << "mini test successful \n"; + return 0; +} diff --git a/recipes/mini/config.yml b/recipes/mini/config.yml new file mode 100644 index 0000000000000..0382c3dda0836 --- /dev/null +++ b/recipes/mini/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.15": + folder: all diff --git a/recipes/minicoro/all/conandata.yml b/recipes/minicoro/all/conandata.yml new file mode 100644 index 0000000000000..26ecba7b50b2a --- /dev/null +++ b/recipes/minicoro/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.3": + url: "https://github.com/edubart/minicoro/archive/refs/tags/v0.1.3.tar.gz" + sha256: "4f9d4c3b5f6473f8141ee45e9947a6e7e7ee6665b4d9a8c373c0602495c5f6c9" diff --git a/recipes/minicoro/all/conanfile.py b/recipes/minicoro/all/conanfile.py new file mode 100644 index 0000000000000..77385609248b9 --- /dev/null +++ b/recipes/minicoro/all/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "minicoro" + description = "Single header stackful cross-platform coroutine library in pure C" + license = ("Unlicense", "MIT-0") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/edubart/minicoro" + topics = ("lua", "coroutine", "fibers", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", self.source_folder, os.path.join(self.package_folder, "include", "minicoro")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs.append(os.path.join("include", "minicoro")) diff --git a/recipes/minicoro/all/test_package/CMakeLists.txt b/recipes/minicoro/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2862cc4744006 --- /dev/null +++ b/recipes/minicoro/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(minicoro REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE minicoro::minicoro) diff --git a/recipes/minicoro/all/test_package/conanfile.py b/recipes/minicoro/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/minicoro/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/minicoro/all/test_package/test_package.c b/recipes/minicoro/all/test_package/test_package.c new file mode 100644 index 0000000000000..5c333058e9350 --- /dev/null +++ b/recipes/minicoro/all/test_package/test_package.c @@ -0,0 +1,22 @@ +#define MINICORO_IMPL +#include "minicoro.h" + +#include +#include +#include + +void coro_entry(mco_coro* co) { + printf("coroutine 1\n"); + mco_yield(co); + printf("coroutine 2\n"); +} + +int main(void) { + mco_desc desc = mco_desc_init(coro_entry, 0); + desc.user_data = NULL; + mco_coro* co; + mco_create(&co, &desc); + mco_destroy(co); + + return EXIT_SUCCESS; +} diff --git a/recipes/minicoro/config.yml b/recipes/minicoro/config.yml new file mode 100644 index 0000000000000..b7f57204004e4 --- /dev/null +++ b/recipes/minicoro/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.3": + folder: all diff --git a/recipes/minizip-ng/all/conandata.yml b/recipes/minizip-ng/all/conandata.yml index 1c6819fac1991..5c7d70a9a8713 100644 --- a/recipes/minizip-ng/all/conandata.yml +++ b/recipes/minizip-ng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.0.6": + url: "https://github.com/zlib-ng/minizip-ng/archive/4.0.6.tar.gz" + sha256: "e96ed3866706a67dbed05bf035e26ef6b60f408e1381bf0fe9af17fe2c0abebc" "4.0.5": url: "https://github.com/zlib-ng/minizip-ng/archive/4.0.5.tar.gz" sha256: "9bb636474b8a4269280d32aca7de4501f5c24cc642c9b4225b4ed7b327f4ee73" diff --git a/recipes/minizip-ng/all/conanfile.py b/recipes/minizip-ng/all/conanfile.py index 7d26ebb7bc61f..6185768b2d0c8 100644 --- a/recipes/minizip-ng/all/conanfile.py +++ b/recipes/minizip-ng/all/conanfile.py @@ -197,6 +197,8 @@ def package_info(self): self.cpp_info.components["minizip"].requires.append("openssl::openssl") elif is_apple_os(self): self.cpp_info.components["minizip"].frameworks.extend(["CoreFoundation", "Security"]) + elif self.settings.os == "Windows": + self.cpp_info.components["minizip"].system_libs.append("crypt32") if self.settings.os != "Windows" and self.options.with_iconv: self.cpp_info.components["minizip"].requires.append("libiconv::libiconv") diff --git a/recipes/minizip-ng/config.yml b/recipes/minizip-ng/config.yml index c5531d3a6ec01..580a769b6b0a8 100644 --- a/recipes/minizip-ng/config.yml +++ b/recipes/minizip-ng/config.yml @@ -1,4 +1,6 @@ versions: + "4.0.6": + folder: all "4.0.5": folder: all "4.0.4": diff --git a/recipes/mlpack/all/conandata.yml b/recipes/mlpack/all/conandata.yml new file mode 100644 index 0000000000000..1b7e9d933c958 --- /dev/null +++ b/recipes/mlpack/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.3.0": + url: "https://github.com/mlpack/mlpack/archive/refs/tags/4.3.0.tar.gz" + sha256: "08cd54f711fde66fc3b6c9db89dc26776f9abf1a6256c77cfa3556e2a56f1a3d" diff --git a/recipes/mlpack/all/conanfile.py b/recipes/mlpack/all/conanfile.py new file mode 100644 index 0000000000000..bf8304a813b40 --- /dev/null +++ b/recipes/mlpack/all/conanfile.py @@ -0,0 +1,124 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, replace_in_file +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class MlpackConan(ConanFile): + name = "mlpack" + description = "mlpack: a fast, header-only C++ machine learning library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mlpack/mlpack" + topics = ("machine-learning", "deep-learning", "regression", "nearest-neighbor-search", "scientific-computing", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + if is_msvc(self): + return 17 + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "5", + "apple-clang": "5", + "msvc": "191", + "Visual Studio": "15", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("armadillo/12.6.4") + self.requires("cereal/1.3.2") + self.requires("ensmallen/2.21.0") + self.requires("stb/cci.20230920") + # TODO: MSVC OpenMP is not compatible, enable for MSVC after #22353 + if not is_msvc(self): + self.requires("llvm-openmp/17.0.6") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if not self.dependencies["armadillo"].options.use_blas or not self.dependencies["armadillo"].options.use_lapack: + raise ConanInvalidConfiguration("mlpack requires armadillo to be built with BLAS and LAPACK support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _configure_headers(self): + # https://github.com/mlpack/mlpack/blob/4.3.0/src/mlpack/config.hpp + config_hpp = os.path.join(self.package_folder, "include", "mlpack", "config.hpp") + replace_in_file(self, config_hpp, "// #define MLPACK_HAS_STB", "#define MLPACK_HAS_STB") + replace_in_file(self, config_hpp, "// #define MLPACK_HAS_NO_STB_DIR", "// #define MLPACK_HAS_NO_STB_DIR") + + def package(self): + copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*", + os.path.join(self.source_folder, "src"), + os.path.join(self.package_folder, "include"), + excludes=["mlpack/bindings/*", "mlpack/tests/*", "mlpack/CMakeLists.txt"]) + self._configure_headers() + + @property + def _openmp_flags(self): + # Based on https://github.com/Kitware/CMake/blob/v3.28.1/Modules/FindOpenMP.cmake#L104-L135 + if self.settings.compiler == "clang": + return ["-fopenmp=libomp"] + elif self.settings.compiler == "apple-clang": + return ["-Xclang", "-fopenmp"] + elif self.settings.compiler == "gcc": + return ["-fopenmp"] + elif self.settings.compiler == "intel-cc": + return ["-Qopenmp"] + elif self.settings.compiler == "sun-cc": + return ["-xopenmp"] + elif is_msvc(self): + return ["-openmp:llvm"] + return None + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "mlpack") + self.cpp_info.set_property("cmake_target_name", "mlpack::mlpack") + self.cpp_info.set_property("pkg_config_name", "mlpack") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + + if self.settings.get_safe("compiler.libcxx") in ["libstdc++", "libstdc++11"]: + self.cpp_info.system_libs.append("atomic") + + self.cpp_info.cflags = self._openmp_flags + self.cpp_info.cxxflags = self._openmp_flags + + # https://github.com/mlpack/mlpack/blob/4.3.0/CMakeLists.txt#L164-L175 + if is_msvc(self): + self.cpp_info.cxxflags.extend(["/bigobj", "/Zm200", "/Zc:__cplusplus"]) + elif self.settings.os == "Windows" and self.settings.compiler == "gcc": + self.cpp_info.cflags.append("-Wa,-mbig-obj") + self.cpp_info.cxxflags.append("-Wa,-mbig-obj") diff --git a/recipes/mlpack/all/test_package/CMakeLists.txt b/recipes/mlpack/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8bdbe35c75acf --- /dev/null +++ b/recipes/mlpack/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(mlpack REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mlpack::mlpack) +if(MSVC) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/mlpack/all/test_package/conanfile.py b/recipes/mlpack/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/mlpack/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/mlpack/all/test_package/test_package.cpp b/recipes/mlpack/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b5b09f906a9df --- /dev/null +++ b/recipes/mlpack/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +using namespace mlpack; + +int main() +{ + const size_t numClasses = 2; + const size_t minimumLeafSize = 5; + const size_t numTrees = 10; + + arma::mat dataset; + arma::Row labels, predictions; + RandomForest rf(dataset, labels, numClasses, numTrees, minimumLeafSize); + rf.Classify(dataset, predictions); +} diff --git a/recipes/mlpack/config.yml b/recipes/mlpack/config.yml new file mode 100644 index 0000000000000..fefa3b794940e --- /dev/null +++ b/recipes/mlpack/config.yml @@ -0,0 +1,3 @@ +versions: + "4.3.0": + folder: all diff --git a/recipes/mocknetworkaccessmanager/all/conandata.yml b/recipes/mocknetworkaccessmanager/all/conandata.yml new file mode 100644 index 0000000000000..74e9cd9518faf --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "0.12.0": + url: "https://gitlab.com/julrich/MockNetworkAccessManager/-/archive/0.12.0/MockNetworkAccessManager-0.12.0.tar.gz" + sha256: "ac9ffb5e6e5ccdc1b7c76da7a92b5d845ec12eb48a39b0423005da4f6431b09f" +patches: + "0.12.0": + - patch_file: "patches/0.12.0-0001-add-install-step.patch" + patch_description: "Add install step" + patch_type: "conan" + patch_source: "https://gitlab.com/julrich/MockNetworkAccessManager/-/merge_requests/75" + - patch_file: "patches/0.12.0-0002-fix-target-without-location.patch" + patch_description: "Fix target without location" + patch_type: "conan" + patch_source: "https://gitlab.com/julrich/MockNetworkAccessManager/-/merge_requests/75" diff --git a/recipes/mocknetworkaccessmanager/all/conanfile.py b/recipes/mocknetworkaccessmanager/all/conanfile.py new file mode 100644 index 0000000000000..11510320e6ea3 --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +import os + + +required_conan_version = ">=1.52.0" + + +class MockNetworkAccessManagerConan(ConanFile): + name = "mocknetworkaccessmanager" + description = "Mocking network communication for Qt applications" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.com/julrich/MockNetworkAccessManager" + topics = ("qt", "mock", "network", "QNetworkAccessManager", "unit test", "test") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "with_qt": [5, 6], + } + default_options = { + "fPIC": True, + "with_qt": 5, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_qt == 5: + self.requires("qt/[~5.15]", transitive_headers=True) + else: + self.requires("qt/[>=6.6 <7]", transitive_headers=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["FORCE_QT5"] = self.options.with_qt == 5 + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["MockNetworkAccessManager"] diff --git a/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0001-add-install-step.patch b/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0001-add-install-step.patch new file mode 100644 index 0000000000000..5ab7046d5c273 --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0001-add-install-step.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 61ed3ed..6d0de20 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -107,3 +107,10 @@ add_library( MockNetworkAccessManager STATIC EXCLUDE_FROM_ALL "MockNetworkAccess + target_include_directories( MockNetworkAccessManager PUBLIC "${PROJECT_SOURCE_DIR}" ) + target_link_libraries( MockNetworkAccessManager Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network ) + ++install(TARGETS MockNetworkAccessManager ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) ++ ++install(FILES "${PROJECT_SOURCE_DIR}/MockNetworkAccessManager.hpp" ++ DESTINATION include) ++ diff --git a/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0002-fix-target-without-location.patch b/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0002-fix-target-without-location.patch new file mode 100644 index 0000000000000..30e7bf6374a71 --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0002-fix-target-without-location.patch @@ -0,0 +1,20 @@ +commit e28d1f3868db8c7f5ff654a205d80d5d7ed203c4 +Author: Martin Delille +Date: Fri Jan 19 18:06:56 2024 +0100 + + Fix target without LOCATION property + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6d0de20..dbfbed3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -26,8 +26,7 @@ if( NOT Qt5_FOUND OR NOT Qt6_FOUND ) + find_package( Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network ) + endif() + +-get_target_property( QTCORE_LOCATION Qt${QT_VERSION_MAJOR}::Core LOCATION ) +-get_filename_component( QT_BIN_DIR ${QTCORE_LOCATION} DIRECTORY ) ++get_filename_component(QT_BIN_DIR "$" ABSOLUTE) + set( CMAKE_MSVCIDE_RUN_PATH ${QT_BIN_DIR} ) + set_property( DIRECTORY "." APPEND PROPERTY COMPILE_DEFINITIONS "QT_DEPRECATED_WARNINGS" ) + diff --git a/recipes/mocknetworkaccessmanager/all/test_package/CMakeLists.txt b/recipes/mocknetworkaccessmanager/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..679b5058fe4c8 --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(mocknetworkaccessmanager REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mocknetworkaccessmanager::mocknetworkaccessmanager) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mocknetworkaccessmanager/all/test_package/conanfile.py b/recipes/mocknetworkaccessmanager/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mocknetworkaccessmanager/all/test_package/test_package.cpp b/recipes/mocknetworkaccessmanager/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..16d39eccc870f --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#include "MockNetworkAccessManager.hpp" + +int main(int argc, char *argv[]) { + QCoreApplication app(argc, argv); + MockNetworkAccess::Manager< QNetworkAccessManager > mnam; + + mnam.whenGet( QUrl( "http://example.com/hello" ) ) + .has( MockNetworkAccess::Predicates::HeaderMatching( QNetworkRequest::UserAgentHeader, + QRegularExpression( ".*MyNetworkClient/.*" ) ) ) + .reply().withBody( QJsonDocument::fromJson( "{\"hello\":\"world\"}" ) ); + + return 0; +} diff --git a/recipes/mocknetworkaccessmanager/config.yml b/recipes/mocknetworkaccessmanager/config.yml new file mode 100644 index 0000000000000..bd3e719c29dbd --- /dev/null +++ b/recipes/mocknetworkaccessmanager/config.yml @@ -0,0 +1,3 @@ +versions: + "0.12.0": + folder: all diff --git a/recipes/mold/all/conandata.yml b/recipes/mold/all/conandata.yml index 27fad647a9723..76bdbbd4a2351 100644 --- a/recipes/mold/all/conandata.yml +++ b/recipes/mold/all/conandata.yml @@ -1,10 +1,22 @@ sources: + "2.32.1": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.32.1.tar.gz" + sha256: "f3c9a527d884c635834fe7d79b3de959b00783bf9446280ea274d996f0335825" + "2.32.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.32.0.tar.gz" + sha256: "4b7e4146ea0f52be9adae8b417399f3676a041e65b55e3f25f088120d30a320b" + "2.31.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.31.0.tar.gz" + sha256: "3dc3af83a5d22a4b29971bfad17261851d426961c665480e2ca294e5c74aa1e5" "2.4.0": url: "https://github.com/rui314/mold/archive/refs/tags/v2.4.0.tar.gz" sha256: "be65f3d785d32ece7b3204ecaa57810847fdd25c232cf704cbfff2dafb1ac107" "2.0.0": url: "https://github.com/rui314/mold/archive/refs/tags/v2.0.0.tar.gz" sha256: "2ae8a22db09cbff626df74c945079fa29c1e5f60bbe02502dcf69191cf43527b" + "1.11.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v1.11.0.tar.gz" + sha256: "99318eced81b09a77e4c657011076cc8ec3d4b6867bd324b8677974545bc4d6f" "1.4.2": url: "https://github.com/rui314/mold/archive/refs/tags/v1.4.2.tar.gz" sha256: "47e6c48d20f49e5b47dfb8197dd9ffcb11a8833d614f7a03bd29741c658a69cd" @@ -17,6 +29,3 @@ sources: "1.8.0": url: "https://github.com/rui314/mold/archive/refs/tags/v1.8.0.tar.gz" sha256: "7210225478796c2528aae30320232a5a3b93a640292575a8c55aa2b140041b5c" - "1.11.0": - url: "https://github.com/rui314/mold/archive/refs/tags/v1.11.0.tar.gz" - sha256: "99318eced81b09a77e4c657011076cc8ec3d4b6867bd324b8677974545bc4d6f" diff --git a/recipes/mold/all/conanfile.py b/recipes/mold/all/conanfile.py index a760cce0d4728..68b6db435177a 100644 --- a/recipes/mold/all/conanfile.py +++ b/recipes/mold/all/conanfile.py @@ -40,11 +40,12 @@ def layout(self): def requirements(self): self.requires("zlib/[>=1.2.11 <2]") - self.requires("openssl/[>=1.1 <4]") self.requires("xxhash/0.8.2") - self.requires("onetbb/2021.10.0") if self.options.with_mimalloc: self.requires("mimalloc/2.1.2") + if Version(self.version) < "2.2.0": + # Newer versions use vendored-in BLAKE3 + self.requires("openssl/[>=1.1 <4]") def package_id(self): del self.info.settings.compiler @@ -75,7 +76,7 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["MOLD_USE_MIMALLOC"] = self.options.with_mimalloc tc.variables["MOLD_USE_SYSTEM_MIMALLOC"] = True - tc.variables["MOLD_USE_SYSTEM_TBB"] = True + tc.variables["MOLD_USE_SYSTEM_TBB"] = False # see https://github.com/conan-io/conan-center-index/pull/23575#issuecomment-2059154281 tc.variables["CMAKE_INSTALL_LIBEXECDIR"] = "libexec" tc.generate() diff --git a/recipes/mold/config.yml b/recipes/mold/config.yml index b4070800652f5..096044e3278b2 100644 --- a/recipes/mold/config.yml +++ b/recipes/mold/config.yml @@ -1,8 +1,16 @@ versions: + "2.32.1": + folder: all + "2.32.0": + folder: all + "2.31.0": + folder: all "2.4.0": folder: all "2.0.0": folder: all + "1.11.0": + folder: all "1.4.2": folder: all "1.5.1": @@ -11,5 +19,3 @@ versions: folder: all "1.8.0": folder: all - "1.11.0": - folder: all diff --git a/recipes/mongo-c-driver/all/conandata.yml b/recipes/mongo-c-driver/all/conandata.yml index 5e5abc368ffce..2f74d581142e4 100644 --- a/recipes/mongo-c-driver/all/conandata.yml +++ b/recipes/mongo-c-driver/all/conandata.yml @@ -1,28 +1,22 @@ sources: + "1.27.3": + url: "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/1.27.3.tar.gz" + sha256: "2593048270f8426c3dc60f0a3c22c3da92ae00a3ef284da7e662a1348ca1685c" + "1.27.2": + url: "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/1.27.2.tar.gz" + sha256: "a53010803e2df097a2ea756be6ece34c8f52cda2c18e6ea21115097b75f5d4bf" + "1.27.1": + url: "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/1.27.1.tar.gz" + sha256: "cc97407b16da54ba9b27029237b9a7a13651ada04da15e3b5dcd8fee8db20eed" + "1.26.2": + url: "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/1.26.2.tar.gz" + sha256: "7084c488a758bf226cc0b3d500e7e001f0e2e37391cbeecd341050a9a899857d" "1.24.3": url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.24.3/mongo-c-driver-1.24.3.tar.gz" sha256: "cc0ad1006447ded21bbefecf57d6fef61afe6f0d56a4e28da73805d50fdb81b5" - "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" - "1.23.4": - url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.23.4/mongo-c-driver-1.23.4.tar.gz" - sha256: "209406c91fcf7c63aa633179a0a6b1b36ba237fb77e0470fd81f7299a408e334" - "1.23.2": - url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.23.2/mongo-c-driver-1.23.2.tar.gz" - sha256: "123c358827eea07cd76a31c40281bb1c81b6744f6587c96d0cf217be8b1234e3" - "1.22.2": - url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.22.2/mongo-c-driver-1.22.2.tar.gz" - sha256: "2e59b9d38d600bd63ccc0b215dd44c6254a66eeb8085a5ac513748cd6220532e" - "1.22.0": - url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.22.0/mongo-c-driver-1.22.0.tar.gz" - sha256: "272067f75e7e57c98f90a6f0c42500ef818b4b085539343676b6ce6831655eaf" - "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" patches: "1.24.3": - patch_file: "patches/1.24.1-0001-disable-shared-when-static.patch" @@ -31,19 +25,6 @@ patches: - 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.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" @@ -51,50 +32,3 @@ patches: - patch_file: "patches/1.22.0-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.4": - - patch_file: "patches/1.23.2-0001-disable-shared-when-static.patch" - patch_description: "separate static and shared builds" - patch_type: "conan" - - patch_file: "patches/1.22.0-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.2": - - patch_file: "patches/1.23.2-0001-disable-shared-when-static.patch" - patch_description: "separate static and shared builds" - patch_type: "conan" - - patch_file: "patches/1.22.0-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.22.2": - - patch_file: "patches/1.22.0-0001-disable-shared-when-static.patch" - patch_description: "separate static and shared builds" - patch_type: "conan" - - patch_file: "patches/1.22.0-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.22.0": - - patch_file: "patches/1.22.0-0001-disable-shared-when-static.patch" - patch_description: "separate static and shared builds" - patch_type: "conan" - - patch_file: "patches/1.22.0-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.17.6": - - patch_file: "patches/1.17.6-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 abc21a11a2f2b..cdbc84b964e85 100644 --- a/recipes/mongo-c-driver/all/conanfile.py +++ b/recipes/mongo-c-driver/all/conanfile.py @@ -70,7 +70,7 @@ def requirements(self): elif self.options.with_ssl == "libressl": self.requires("libressl/3.5.3") if self.options.with_sasl == "cyrus": - self.requires("cyrus-sasl/2.1.27") + self.requires("cyrus-sasl/2.1.28") if self.options.with_snappy: self.requires("snappy/1.1.10") if self.options.with_zlib: @@ -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.2") + self.requires("icu/74.2") def validate(self): if self.options.with_ssl == "darwin" and not is_apple_os(self): @@ -91,7 +91,7 @@ def validate(self): def build_requirements(self): if self.options.with_ssl == "libressl" or self.options.with_zstd: if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -118,10 +118,11 @@ def generate(self): # therefore it defeats conan_toolchain variables, but it works fine with cache_variables tc.cache_variables["ENABLE_SSL"] = self._ssl_cmake_value tc.cache_variables["ENABLE_SASL"] = self._sasl_cmake_value - tc.cache_variables["ENABLE_STATIC"] = "OFF" if self.options.shared else "ON" + tc.cache_variables["ENABLE_SHARED"] = self.options.shared + tc.cache_variables["ENABLE_STATIC"] = not self.options.shared tc.cache_variables["ENABLE_TESTS"] = "OFF" tc.cache_variables["ENABLE_EXAMPLES"] = "OFF" - tc.cache_variables["ENABLE_SRV"] = "ON" if self.options.srv else "OFF" + tc.cache_variables["ENABLE_SRV"] = self.options.srv tc.cache_variables["ENABLE_MAINTAINER_FLAGS"] = "OFF" tc.cache_variables["ENABLE_AUTOMATIC_INIT_AND_CLEANUP"] = "ON" tc.cache_variables["ENABLE_CRYPTO_SYSTEM_PROFILE"] = "OFF" @@ -130,29 +131,34 @@ def generate(self): tc.cache_variables["ENABLE_SHM_COUNTERS"] = "OFF" tc.cache_variables["ENABLE_MONGOC"] = "ON" tc.cache_variables["ENABLE_BSON"] = "ON" - tc.cache_variables["ENABLE_SNAPPY"] = "ON" if self.options.with_snappy else "OFF" + tc.cache_variables["ENABLE_SNAPPY"] = self.options.with_snappy tc.cache_variables["ENABLE_ZLIB"] = "SYSTEM" if self.options.with_zlib else "OFF" - tc.cache_variables["ENABLE_ZSTD"] = "ON" if self.options.with_zstd else "OFF" + tc.cache_variables["ENABLE_ZSTD"] = self.options.with_zstd tc.cache_variables["ENABLE_MAN_PAGES"] = "OFF" tc.cache_variables["ENABLE_HTML_DOCS"] = "OFF" tc.cache_variables["ENABLE_EXTRA_ALIGNMENT"] = "ON" tc.cache_variables["ENABLE_RDTSCP"] = "OFF" tc.cache_variables["ENABLE_APPLE_FRAMEWORK"] = "OFF" - tc.cache_variables["ENABLE_ICU"] = "ON" if self.options.with_icu else "OFF" + tc.cache_variables["ENABLE_ICU"] = self.options.with_icu tc.cache_variables["ENABLE_UNINSTALL"] = "OFF" tc.cache_variables["ENABLE_CLIENT_SIDE_ENCRYPTION"] = "OFF" # libmongocrypt recipe not yet in CCI tc.cache_variables["ENABLE_MONGODB_AWS_AUTH"] = "AUTO" - tc.cache_variables["ENABLE_PIC"] = "ON" if self.options.get_safe("fPIC", True) else "OFF" + tc.cache_variables["ENABLE_PIC"] = self.options.get_safe("fPIC", True) # Avoid to install vc runtime stuff tc.variables["CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP"] = "TRUE" if self.options.with_ssl == "openssl": tc.variables["OPENSSL_ROOT_DIR"] = self.dependencies["openssl"].package_folder.replace("\\", "/") - if Version(self.version) >= "1.20.0": - tc.variables["MONGO_USE_CCACHE"] = False + tc.variables["MONGO_USE_CCACHE"] = False if is_msvc(self): # Should be added because of # https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-initonceexecuteonce tc.preprocessor_definitions["_WIN32_WINNT"] = "0x0600" + tc.cache_variables["BUILD_VERSION"] = self.version + # Skip some fragile checks + # https://github.com/mongodb/mongo-c-driver/blob/1.25.3/src/libmongoc/CMakeLists.txt#L266-L276 + tc.variables["HAVE_ASN1_STRING_GET0_DATA"] = True # Requires OpenSSL 1.1.0+ + # https://github.com/mongodb/mongo-c-driver/blob/1.25.3/src/libmongoc/CMakeLists.txt#L366-L375 + tc.variables["SASL2_HAVE_SASL_CLIENT_DONE"] = True # Requires Cyrus-SASL 2.1.23+ tc.generate() deps = CMakeDeps(self) @@ -166,18 +172,14 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - to_replace_old_new = [ - # Fix Snappy - {"old": "include (FindSnappy)\nif (SNAPPY_INCLUDE_DIRS)", - "new": "if(ENABLE_SNAPPY MATCHES \"ON\")\n find_package(Snappy REQUIRED)"}, - {"old": "SNAPPY_LIBRARIES", "new": "Snappy_LIBRARIES"}, - {"old": "SNAPPY_INCLUDE_DIRS", "new": "Snappy_INCLUDE_DIRS"}, - # Fix LibreSSL - {"old": "set (SSL_LIBRARIES -ltls -lcrypto)", "new": ""}, - ] - for old_new in to_replace_old_new: - replace_in_file(self, os.path.join(self.source_folder, "src", "libmongoc", "CMakeLists.txt"), - old_new["old"], old_new["new"]) + libmongoc_cmake = os.path.join(self.source_folder, "src", "libmongoc", "CMakeLists.txt") + replace_in_file(self, libmongoc_cmake, + "include (FindSnappy)\nif (SNAPPY_INCLUDE_DIRS)", + 'if(ENABLE_SNAPPY MATCHES "ON")\n find_package(Snappy REQUIRED)') + replace_in_file(self, libmongoc_cmake, "SNAPPY_LIBRARIES", "Snappy_LIBRARIES") + replace_in_file(self, libmongoc_cmake, "SNAPPY_INCLUDE_DIRS", "Snappy_INCLUDE_DIRS") + if Version(self.version) < "1.25": + replace_in_file(self, libmongoc_cmake, "set (SSL_LIBRARIES -ltls -lcrypto)", "") # cleanup rpath replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set (CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)", "") diff --git a/recipes/mongo-c-driver/all/patches/1.17.6-0001-disable-shared-when-static.patch b/recipes/mongo-c-driver/all/patches/1.17.6-0001-disable-shared-when-static.patch deleted file mode 100644 index dad7659403d2b..0000000000000 --- a/recipes/mongo-c-driver/all/patches/1.17.6-0001-disable-shared-when-static.patch +++ /dev/null @@ -1,77 +0,0 @@ ---- a/src/libbson/CMakeLists.txt -+++ b/src/libbson/CMakeLists.txt -@@ -230,6 +230,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) -@@ -279,6 +280,7 @@ if (WIN32) - # must be handled specially since we can't resolve them - set (BSON_SYSTEM_LIBRARIES ${BSON_SYSTEM_LIBRARIES} ws2_32) - endif () -+endif() - - if (MONGOC_ENABLE_STATIC_BUILD) - add_library (bson_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) -@@ -337,7 +339,7 @@ set (BSON_HEADER_INSTALL_DIR - ) - - if (MONGOC_ENABLE_STATIC_INSTALL) -- set (TARGETS_TO_INSTALL bson_shared bson_static) -+ set (TARGETS_TO_INSTALL bson_static) - else () - set (TARGETS_TO_INSTALL bson_shared) - endif () ---- a/src/libmongoc/CMakeLists.txt -+++ b/src/libmongoc/CMakeLists.txt -@@ -725,6 +725,7 @@ if (MONGOC_ENABLE_MONGODB_AWS_AUTH) - endif() - 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 - - 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}") -+endif() - - if (MONGOC_ENABLE_STATIC_BUILD) - add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) -@@ -766,6 +768,7 @@ if (MONGOC_ENABLE_STATIC_BUILD) - set_target_properties (mongoc_static PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BASENAME}-static-${MONGOC_API_VERSION}") - endif () - -+if (NOT MONGOC_ENABLE_STATIC_BUILD) - if (ENABLE_APPLE_FRAMEWORK) - set_target_properties (mongoc_shared PROPERTIES - FRAMEWORK TRUE -@@ -776,9 +779,14 @@ if (ENABLE_APPLE_FRAMEWORK) - PUBLIC_HEADER "${HEADERS}" - ) - endif () -+endif() - - add_executable (mongoc-stat ${PROJECT_SOURCE_DIR}/../../src/tools/mongoc-stat.c) -+if (NOT MONGOC_ENABLE_STATIC_BUILD) - target_link_libraries (mongoc-stat mongoc_shared ${LIBRARIES}) -+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} - file (COPY ${PROJECT_SOURCE_DIR}/tests/release_files DESTINATION ${PROJECT_BINARY_DIR}/tests) - - if (MONGOC_ENABLE_STATIC_INSTALL) -- set (TARGETS_TO_INSTALL mongoc_shared mongoc_static) -+ set (TARGETS_TO_INSTALL mongoc_static) - else () - set (TARGETS_TO_INSTALL mongoc_shared) - endif () diff --git a/recipes/mongo-c-driver/all/patches/1.22.0-0001-disable-shared-when-static.patch b/recipes/mongo-c-driver/all/patches/1.22.0-0001-disable-shared-when-static.patch deleted file mode 100644 index 23d005b89467b..0000000000000 --- a/recipes/mongo-c-driver/all/patches/1.22.0-0001-disable-shared-when-static.patch +++ /dev/null @@ -1,77 +0,0 @@ ---- a/src/libbson/CMakeLists.txt -+++ b/src/libbson/CMakeLists.txt -@@ -209,6 +209,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 -@@ -275,6 +276,7 @@ if (WIN32) - # must be handled specially since we can't resolve them - set (BSON_SYSTEM_LIBRARIES ${BSON_SYSTEM_LIBRARIES} ws2_32) - endif () -+endif() - - if (MONGOC_ENABLE_STATIC_BUILD) - add_library (bson_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) -@@ -349,7 +351,7 @@ set (BSON_HEADER_INSTALL_DIR - ) - - if (MONGOC_ENABLE_STATIC_INSTALL) -- set (TARGETS_TO_INSTALL bson_shared bson_static) -+ set (TARGETS_TO_INSTALL bson_static) - else () - set (TARGETS_TO_INSTALL bson_shared) - endif () ---- a/src/libmongoc/CMakeLists.txt -+++ b/src/libmongoc/CMakeLists.txt -@@ -758,6 +758,7 @@ if (MONGOC_ENABLE_MONGODB_AWS_AUTH) - endif() - 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}) -@@ -795,6 +796,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}") -+endif() - - if (MONGOC_ENABLE_STATIC_BUILD) - add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) -@@ -835,6 +837,7 @@ if (MONGOC_ENABLE_STATIC_BUILD) - set_target_properties (mongoc_static PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BASENAME}-static-${MONGOC_API_VERSION}") - endif () - -+if (NOT MONGOC_ENABLE_STATIC_BUILD) - if (ENABLE_APPLE_FRAMEWORK) - set_target_properties (mongoc_shared PROPERTIES - FRAMEWORK TRUE -@@ -845,9 +848,14 @@ if (ENABLE_APPLE_FRAMEWORK) - PUBLIC_HEADER "${HEADERS}" - ) - endif () -+endif() - - add_executable (mongoc-stat ${PROJECT_SOURCE_DIR}/../../src/tools/mongoc-stat.c) -+if (NOT MONGOC_ENABLE_STATIC_BUILD) - target_link_libraries (mongoc-stat mongoc_shared ${LIBRARIES}) -+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") -@@ -1161,7 +1169,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) -- set (TARGETS_TO_INSTALL mongoc_shared mongoc_static) -+ set (TARGETS_TO_INSTALL mongoc_static) - else () - set (TARGETS_TO_INSTALL mongoc_shared) - endif () diff --git a/recipes/mongo-c-driver/all/patches/1.22.0-0003-disable-warning-errors.patch b/recipes/mongo-c-driver/all/patches/1.22.0-0003-disable-warning-errors.patch deleted file mode 100644 index 2ade48e877823..0000000000000 --- a/recipes/mongo-c-driver/all/patches/1.22.0-0003-disable-warning-errors.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/build/cmake/MongoC-Warnings.cmake b/build/cmake/MongoC-Warnings.cmake -index 4784c93..99745c3 100644 ---- a/build/cmake/MongoC-Warnings.cmake -+++ b/build/cmake/MongoC-Warnings.cmake -@@ -58,10 +58,6 @@ mongoc_add_platform_compile_options ( - gnu-like:$<${is_c_lang}:-Werror=implicit> msvc:/we4013 msvc:/we4431 - # Missing return types/statements - gnu-like:-Werror=return-type msvc:/we4716 -- # Incompatible pointer types -- gnu-like:$<$:-Werror=incompatible-pointer-types> msvc:/we4113 -- # Integral/pointer conversions -- gnu-like:$<$:-Werror=int-conversion> msvc:/we4047 - # Discarding qualifiers - gnu:$<$:-Werror=discarded-qualifiers> - clang:$<${is_c_lang}:-Werror=ignored-qualifiers> diff --git a/recipes/mongo-c-driver/config.yml b/recipes/mongo-c-driver/config.yml index c20e8c0d07847..e4d32528df309 100644 --- a/recipes/mongo-c-driver/config.yml +++ b/recipes/mongo-c-driver/config.yml @@ -1,17 +1,13 @@ versions: - "1.24.3": - folder: all - "1.24.1": - folder: all - "1.23.5": + "1.27.3": folder: all - "1.23.4": + "1.27.2": folder: all - "1.23.2": + "1.27.1": folder: all - "1.22.2": + "1.26.2": folder: all - "1.22.0": + "1.24.3": folder: all - "1.17.6": + "1.23.5": folder: all diff --git a/recipes/mongo-cxx-driver/all/conandata.yml b/recipes/mongo-cxx-driver/all/conandata.yml index 58272018f4021..002c89f370676 100644 --- a/recipes/mongo-cxx-driver/all/conandata.yml +++ b/recipes/mongo-cxx-driver/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.10.1": + url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.10.1/mongo-cxx-driver-r3.10.1.tar.gz" + sha256: "0297d9d1a513f09438cc05254b14baa49edd1fa64a6ce5d7a80a1eb7677cf2be" "3.8.1": url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.8.1/mongo-cxx-driver-r3.8.1.tar.gz" sha256: "b12c96670e1e68bae1a6f5cb08541f3da52f5ddeb5def274d2cf5d662ef73160" @@ -24,6 +27,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.10.1": + - patch_file: "patches/3.10.1-0001-dirs.patch" + patch_description: "disable documentation features, fix directories" + patch_type: "conan" + - patch_file: "patches/3.10.1-0002-remove-abi-suffixes.patch" + patch_description: "remove abi suffixes for MSVC" + patch_type: "conan" "3.8.1": - patch_file: "patches/3.8.1-0001-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 26e997f666df1..f123921c3c4aa 100644 --- a/recipes/mongo-cxx-driver/all/conanfile.py +++ b/recipes/mongo-cxx-driver/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get, rm, rmdir from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc import os import shutil @@ -12,10 +13,10 @@ class MongoCxxConan(ConanFile): name = "mongo-cxx-driver" + description = "C++ Driver for MongoDB" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" 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" @@ -47,7 +48,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("mongo-c-driver/1.24.3") + self.requires("mongo-c-driver/1.27.1") if self.options.polyfill == "boost": self.requires("boost/1.82.0", transitive_headers=True) @@ -129,6 +130,8 @@ def generate(self): if not valid_min_cppstd(self, self._minimal_std_version): tc.variables["CMAKE_CXX_STANDARD"] = self._minimal_std_version tc.variables["ENABLE_TESTS"] = False + if Version(self.version) >= "3.10.1" and is_msvc(self): + tc.variables["ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES"] = False tc.generate() deps = CMakeDeps(self) @@ -182,6 +185,8 @@ def package_info(self): if not self.options.shared: self.cpp_info.components["mongocxx"].defines.append("MONGOCXX_STATIC") self.cpp_info.components["mongocxx"].requires = ["mongo-c-driver::mongoc", "bsoncxx"] + if Version(self.version) >= "3.10.1": + self.cpp_info.components["mongocxx"].includedirs.append(os.path.join("include", "mongocxx", "v_noabi")) # bsoncxx bsoncxx_target = "bsoncxx_shared" if self.options.shared else "bsoncxx_static" @@ -197,3 +202,5 @@ def package_info(self): self.cpp_info.components["bsoncxx"].requires = ["mongo-c-driver::bson"] if self.options.polyfill == "boost": self.cpp_info.components["bsoncxx"].requires.append("boost::headers") + if Version(self.version) >= "3.10.1": + self.cpp_info.components["bsoncxx"].includedirs.append(os.path.join("include", "bsoncxx", "v_noabi")) diff --git a/recipes/mongo-cxx-driver/all/patches/3.10.1-0001-dirs.patch b/recipes/mongo-cxx-driver/all/patches/3.10.1-0001-dirs.patch new file mode 100644 index 0000000000000..41a672d93964e --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/3.10.1-0001-dirs.patch @@ -0,0 +1,61 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2a960f7..f809b6c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -315,7 +315,7 @@ unset(dist_generated_depends CACHE) + set(BUILD_SOURCE_DIR ${CMAKE_BINARY_DIR}) + + include(MakeDistFiles) +- ++if(FALSE) + add_custom_target(hugo_dir + COMMAND ${CMAKE_COMMAND} -E make_directory hugo + ) +@@ -371,7 +371,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) + set(DATA_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/data) + +@@ -381,13 +381,13 @@ option(ENABLE_MACRO_GUARD_TESTS "Enable targets for macro guard compile tests." + 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) + +-add_subdirectory(examples EXCLUDE_FROM_ALL) +- +-add_subdirectory(benchmark EXCLUDE_FROM_ALL) +- ++# add_subdirectory(benchmark EXCLUDE_FROM_ALL) ++if(FALSE) + # Implement 'dist' target + # + # CMake does not implement anything like 'dist' from autotools. +@@ -525,3 +525,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 ce53a71..bcd0a61 100644 +--- a/src/bsoncxx/CMakeLists.txt ++++ b/src/bsoncxx/CMakeLists.txt +@@ -93,8 +93,8 @@ if(TARGET bson_shared OR TARGET bson_static) + set(BSONCXX_PKG_DEP "find_dependency(bson-${LIBBSON_REQUIRED_ABI_VERSION} REQUIRED)") + 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(STATUS "found libbson version ${bson-${LIBBSON_REQUIRED_ABI_VERSION}_VERSION}") + diff --git a/recipes/mongo-cxx-driver/all/patches/3.10.1-0002-remove-abi-suffixes.patch b/recipes/mongo-cxx-driver/all/patches/3.10.1-0002-remove-abi-suffixes.patch new file mode 100644 index 0000000000000..f1fdc639b41ea --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/3.10.1-0002-remove-abi-suffixes.patch @@ -0,0 +1,26 @@ +diff --git a/cmake/BsoncxxUtil.cmake b/cmake/BsoncxxUtil.cmake +index c72f98e..5f977e1 100644 +--- a/cmake/BsoncxxUtil.cmake ++++ b/cmake/BsoncxxUtil.cmake +@@ -76,7 +76,7 @@ function(bsoncxx_add_library TARGET OUTPUT_NAME LINK_TYPE) + endif() + + # MSVC-specific ABI tag suffixes. +- if(MSVC) ++ if(0) + set(vs_suffix "") + + # Include the target architecture if applicable (Win32, x64, etc.). +diff --git a/cmake/MongocxxUtil.cmake b/cmake/MongocxxUtil.cmake +index de9210c..f9937f4 100644 +--- a/cmake/MongocxxUtil.cmake ++++ b/cmake/MongocxxUtil.cmake +@@ -63,7 +63,7 @@ function(mongocxx_add_library TARGET OUTPUT_NAME LINK_TYPE) + endif() + + # MSVC-specific ABI tag suffixes. Inherit from bsoncxx. +- if(MSVC) ++ if(0) + get_target_property(vs_suffix ${bsoncxx_target} BSONCXX_ABI_TAG_VS_SUFFIX) + set_target_properties(${TARGET} PROPERTIES + BSONCXX_ABI_TAG_VS_SUFFIX ${vs_suffix} diff --git a/recipes/mongo-cxx-driver/config.yml b/recipes/mongo-cxx-driver/config.yml index dfc6d8b54584e..e353de8ba013d 100644 --- a/recipes/mongo-cxx-driver/config.yml +++ b/recipes/mongo-cxx-driver/config.yml @@ -1,4 +1,6 @@ versions: + "3.10.1": + folder: all "3.8.1": folder: all "3.8.0": diff --git a/recipes/morton-nd/all/conandata.yml b/recipes/morton-nd/all/conandata.yml index 41b2951c67096..da7e41c780c0c 100644 --- a/recipes/morton-nd/all/conandata.yml +++ b/recipes/morton-nd/all/conandata.yml @@ -5,3 +5,10 @@ sources: "3.0.0": url: "https://github.com/kevinhartman/morton-nd/archive/v3.0.0.tar.gz" sha256: "ba57df04a2e1e73709f55fd3fee71082750013c5792de3c6eb84a8c87d40d781" +patches: + "4.0.0": + - patch_file: "patches/0001-v4.0.0-fix-include-cstdint.patch" + patch_type: "portability" + "3.0.0": + - patch_file: "patches/0001-v3.0.0-fix-include-cstdint.patch" + patch_type: "portability" diff --git a/recipes/morton-nd/all/conanfile.py b/recipes/morton-nd/all/conanfile.py index 5e3263ed60dd4..9558cedb497f2 100644 --- a/recipes/morton-nd/all/conanfile.py +++ b/recipes/morton-nd/all/conanfile.py @@ -1,7 +1,7 @@ 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.files import apply_conandata_patches, copy, export_conandata_patches, get from conan.tools.layout import basic_layout from conan.tools.scm import Version import os @@ -14,9 +14,10 @@ class MortonndConan(ConanFile): description = "A header-only Morton encode/decode library (C++14) capable " \ "of encoding from and decoding to N-dimensional space." license = "MIT" - topics = ("morton-nd", "morton", "encoding", "decoding", "n-dimensional") + topics = ("morton", "encoding", "decoding", "n-dimensional") homepage = "https://github.com/kevinhartman/morton-nd" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -34,6 +35,9 @@ def _compilers_minimum_version(self): "apple-clang": "5.1", } + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() @@ -45,13 +49,13 @@ def validate(self): raise ConanInvalidConfiguration( f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler does not support.", ) - - def layout(self): - basic_layout(self, src_folder="src") + + def export_sources(self): + export_conandata_patches(self) def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def build(self): pass @@ -64,9 +68,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "morton-nd") self.cpp_info.set_property("cmake_target_name", "morton-nd::MortonND") self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] # TODO: to remove in conan v2 once legacy generators removed self.cpp_info.names["cmake_find_package"] = "morton-nd" @@ -75,6 +77,4 @@ def package_info(self): self.cpp_info.components["mortonnd"].names["cmake_find_package_multi"] = "MortonND" self.cpp_info.components["mortonnd"].set_property("cmake_target_name", "morton-nd::MortonND") self.cpp_info.components["mortonnd"].bindirs = [] - self.cpp_info.components["mortonnd"].frameworkdirs = [] self.cpp_info.components["mortonnd"].libdirs = [] - self.cpp_info.components["mortonnd"].resdirs = [] diff --git a/recipes/morton-nd/all/patches/0001-v3.0.0-fix-include-cstdint.patch b/recipes/morton-nd/all/patches/0001-v3.0.0-fix-include-cstdint.patch new file mode 100644 index 0000000000000..52cd77981fa28 --- /dev/null +++ b/recipes/morton-nd/all/patches/0001-v3.0.0-fix-include-cstdint.patch @@ -0,0 +1,24 @@ +diff --git a/include/morton-nd/mortonND_BMI2.h b/include/morton-nd/mortonND_BMI2.h +index b99d2c0..63d89f2 100644 +--- a/include/morton-nd/mortonND_BMI2.h ++++ b/include/morton-nd/mortonND_BMI2.h +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + namespace mortonnd { + +diff --git a/include/morton-nd/mortonND_LUT_encoder.h b/include/morton-nd/mortonND_LUT_encoder.h +index 5d75cb2..575c898 100644 +--- a/include/morton-nd/mortonND_LUT_encoder.h ++++ b/include/morton-nd/mortonND_LUT_encoder.h +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + namespace mortonnd { + diff --git a/recipes/morton-nd/all/patches/0001-v4.0.0-fix-include-cstdint.patch b/recipes/morton-nd/all/patches/0001-v4.0.0-fix-include-cstdint.patch new file mode 100644 index 0000000000000..0cc25573d036f --- /dev/null +++ b/recipes/morton-nd/all/patches/0001-v4.0.0-fix-include-cstdint.patch @@ -0,0 +1,24 @@ +diff --git a/include/morton-nd/mortonND_BMI2.h b/include/morton-nd/mortonND_BMI2.h +index b99d2c0..63d89f2 100644 +--- a/include/morton-nd/mortonND_BMI2.h ++++ b/include/morton-nd/mortonND_BMI2.h +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + namespace mortonnd { + +diff --git a/include/morton-nd/mortonND_LUT.h b/include/morton-nd/mortonND_LUT.h +index 110ad63..fb3777b 100644 +--- a/include/morton-nd/mortonND_LUT.h ++++ b/include/morton-nd/mortonND_LUT.h +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + namespace mortonnd { + diff --git a/recipes/morton-nd/all/test_package/conanfile.py b/recipes/morton-nd/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/morton-nd/all/test_package/conanfile.py +++ b/recipes/morton-nd/all/test_package/conanfile.py @@ -7,13 +7,14 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/morton-nd/all/test_v1_package/CMakeLists.txt b/recipes/morton-nd/all/test_v1_package/CMakeLists.txt index 07fa1c30a5235..b21cc49efde95 100644 --- a/recipes/morton-nd/all/test_v1_package/CMakeLists.txt +++ b/recipes/morton-nd/all/test_v1_package/CMakeLists.txt @@ -1,14 +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(morton-nd REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE morton-nd::MortonND) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) -if(morton-nd_VERSION VERSION_LESS "4.0.0") - target_compile_definitions(${PROJECT_NAME} PRIVATE "MORTONND_LESS_4_0_0") -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mozjpeg/all/test_package/conanfile.py b/recipes/mozjpeg/all/test_package/conanfile.py index 2494f49b77c0d..e845ae751a301 100644 --- a/recipes/mozjpeg/all/test_package/conanfile.py +++ b/recipes/mozjpeg/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_name = os.path.join(self.source_folder, "testimg.jpg") - self.run(f"{bin_path} {img_name}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/mozjpeg/all/test_package/test_package.c b/recipes/mozjpeg/all/test_package/test_package.c index 2f94478d7ef6f..243a65f0efd44 100644 --- a/recipes/mozjpeg/all/test_package/test_package.c +++ b/recipes/mozjpeg/all/test_package/test_package.c @@ -1,528 +1,9 @@ -/* - * rdjpgcom.c - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * Modified 2009 by Bill Allombert, Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a very simple stand-alone application that displays - * the text in COM (comment) markers in a JFIF file. - * This may be useful as an example of the minimum logic needed to parse - * JPEG markers. - */ - #include -#include -#include - -#define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */ -#include "jpeglib.h" /* get auto-config symbols, */ - -#ifdef HAVE_LOCALE_H -#include /* Bill Allombert: use locale for isprint */ -#endif -#include /* to declare isupper(), tolower() */ -#ifdef USE_SETMODE -#include /* to declare setmode()'s parameter macros */ -/* If you have setmode() but not , just delete this line: */ -#include /* to declare setmode() */ -#endif - -#ifdef USE_CCOMMAND /* command-line reader for Macintosh */ -#ifdef __MWERKS__ -#include /* Metrowerks needs this */ -#include /* ... and this */ -#endif -#ifdef THINK_C -#include /* Think declares it here */ -#endif -#endif - -#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ -#define READ_BINARY "r" -#else -#ifdef VMS /* VMS is very nonstandard */ -#define READ_BINARY "rb", "ctx=stm" -#else /* standard ANSI-compliant case */ -#define READ_BINARY "rb" -#endif -#endif - -#ifndef EXIT_FAILURE /* define exit() codes if not provided */ -#define EXIT_FAILURE 1 -#endif -#ifndef EXIT_SUCCESS -#ifdef VMS -#define EXIT_SUCCESS 1 /* VMS is very nonstandard */ -#else -#define EXIT_SUCCESS 0 -#endif -#endif - -/* - * These macros are used to read the input file. - * To reuse this code in another application, you might need to change these. - */ - -static FILE *infile; /* input JPEG file */ - -/* Return next input byte, or EOF if no more */ -#define NEXTBYTE() getc(infile) - -/* Error exit handler */ -#define ERREXIT(msg) (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE)) - -/* Read one byte, testing for EOF */ -static int read_1_byte(void) { - int c; - - c = NEXTBYTE(); - if (c == EOF) - ERREXIT("Premature EOF in JPEG file"); - return c; -} - -/* Read 2 bytes, convert to unsigned int */ -/* All 2-byte quantities in JPEG markers are MSB first */ -static unsigned int read_2_bytes(void) { - int c1, c2; - - c1 = NEXTBYTE(); - if (c1 == EOF) - ERREXIT("Premature EOF in JPEG file"); - c2 = NEXTBYTE(); - if (c2 == EOF) - ERREXIT("Premature EOF in JPEG file"); - return (((unsigned int)c1) << 8) + ((unsigned int)c2); -} - -/* - * JPEG markers consist of one or more 0xFF bytes, followed by a marker - * code byte (which is not an FF). Here are the marker codes of interest - * in this program. (See jdmarker.c for a more complete list.) - */ - -#define M_SOF0 0xC0 /* Start Of Frame N */ -#define M_SOF1 0xC1 /* N indicates which compression process */ -#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ -#define M_SOF3 0xC3 -#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ -#define M_SOF6 0xC6 -#define M_SOF7 0xC7 -#define M_SOF9 0xC9 -#define M_SOF10 0xCA -#define M_SOF11 0xCB -#define M_SOF13 0xCD -#define M_SOF14 0xCE -#define M_SOF15 0xCF -#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */ -#define M_EOI 0xD9 /* End Of Image (end of datastream) */ -#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ -#define M_APP0 0xE0 /* Application-specific marker, type N */ -#define M_APP12 0xEC /* (we don't bother to list all 16 APPn's) */ -#define M_COM 0xFE /* COMment */ - -/* - * Find the next JPEG marker and return its marker code. - * We expect at least one FF byte, possibly more if the compressor used FFs - * to pad the file. - * There could also be non-FF garbage between markers. The treatment of such - * garbage is unspecified; we choose to skip over it but emit a warning msg. - * NB: this routine must not be used after seeing SOS marker, since it will - * not deal correctly with FF/00 sequences in the compressed image data... - */ - -static int next_marker(void) { - int c; - int discarded_bytes = 0; - - /* Find 0xFF byte; count and skip any non-FFs. */ - c = read_1_byte(); - while (c != 0xFF) { - discarded_bytes++; - c = read_1_byte(); - } - /* Get marker code byte, swallowing any duplicate FF bytes. Extra FFs - * are legal as pad bytes, so don't count them in discarded_bytes. - */ - do { - c = read_1_byte(); - } while (c == 0xFF); - - if (discarded_bytes != 0) { - fprintf(stderr, "Warning: garbage data found in JPEG file\n"); - } - - return c; -} - -/* - * Read the initial marker, which should be SOI. - * For a JFIF file, the first two bytes of the file should be literally - * 0xFF M_SOI. To be more general, we could use next_marker, but if the - * input file weren't actually JPEG at all, next_marker might read the whole - * file and then return a misleading error message... - */ - -static int first_marker(void) { - int c1, c2; - - c1 = NEXTBYTE(); - c2 = NEXTBYTE(); - if (c1 != 0xFF || c2 != M_SOI) - { - ERREXIT("Not a JPEG file"); - } - return c2; -} - -/* - * Most types of marker are followed by a variable-length parameter segment. - * This routine skips over the parameters for any marker we don't otherwise - * want to process. - * Note that we MUST skip the parameter segment explicitly in order not to - * be fooled by 0xFF bytes that might appear within the parameter segment; - * such bytes do NOT introduce new markers. - */ - -static void skip_variable(void) -/* Skip over an unknown or uninteresting variable-length marker */ -{ - unsigned int length; - - /* Get the marker parameter length count */ - length = read_2_bytes(); - /* Length includes itself, so must be at least 2 */ - if (length < 2) - ERREXIT("Erroneous JPEG marker length"); - length -= 2; - /* Skip over the remaining bytes */ - while (length > 0) { - (void)read_1_byte(); - length--; - } -} - -/* - * Process a COM marker. - * We want to print out the marker contents as legible text; - * we must guard against non-text junk and varying newline representations. - */ - -static void process_COM(int raw) { - unsigned int length; - int ch; - int lastch = 0; - -/* Bill Allombert: set locale properly for isprint */ -#ifdef HAVE_LOCALE_H - setlocale(LC_CTYPE, ""); -#endif - - /* Get the marker parameter length count */ - length = read_2_bytes(); - /* Length includes itself, so must be at least 2 */ - if (length < 2) - ERREXIT("Erroneous JPEG marker length"); - length -= 2; - - while (length > 0) { - ch = read_1_byte(); - if (raw) { - putc(ch, stdout); - /* Emit the character in a readable form. - * Nonprintables are converted to \nnn form, - * while \ is converted to \\. - * Newlines in CR, CR/LF, or LF form will be printed as one newline. - */ - } else if (ch == '\r') { - printf("\n"); - } else if (ch == '\n') { - if (lastch != '\r') - printf("\n"); - } else if (ch == '\\') { - printf("\\\\"); - } else if (isprint(ch)) { - putc(ch, stdout); - } else { - printf("\\%03o", ch); - } - lastch = ch; - length--; - } - printf("\n"); - -/* Bill Allombert: revert to C locale */ -#ifdef HAVE_LOCALE_H - setlocale(LC_CTYPE, "C"); -#endif -} - -/* - * Process a SOFn marker. - * This code is only needed if you want to know the image dimensions... - */ - -static void process_SOFn(int marker) { - unsigned int length; - unsigned int image_height, image_width; - int data_precision, num_components; - const char *process; - int ci; - - length = read_2_bytes(); /* usual parameter length count */ - - data_precision = read_1_byte(); - image_height = read_2_bytes(); - image_width = read_2_bytes(); - num_components = read_1_byte(); - - switch (marker) { - case M_SOF0: - process = "Baseline"; - break; - case M_SOF1: - process = "Extended sequential"; - break; - case M_SOF2: - process = "Progressive"; - break; - case M_SOF3: - process = "Lossless"; - break; - case M_SOF5: - process = "Differential sequential"; - break; - case M_SOF6: - process = "Differential progressive"; - break; - case M_SOF7: - process = "Differential lossless"; - break; - case M_SOF9: - process = "Extended sequential, arithmetic coding"; - break; - case M_SOF10: - process = "Progressive, arithmetic coding"; - break; - case M_SOF11: - process = "Lossless, arithmetic coding"; - break; - case M_SOF13: - process = "Differential sequential, arithmetic coding"; - break; - case M_SOF14: - process = "Differential progressive, arithmetic coding"; - break; - case M_SOF15: - process = "Differential lossless, arithmetic coding"; - break; - default: - process = "Unknown"; - break; - } - - printf("JPEG image is %uw * %uh, %d color components, %d bits per sample\n", - image_width, image_height, num_components, data_precision); - printf("JPEG process: %s\n", process); - - if (length != (unsigned int)(8 + num_components * 3)) - ERREXIT("Bogus SOF marker length"); - - for (ci = 0; ci < num_components; ci++) { - (void)read_1_byte(); /* Component ID code */ - (void)read_1_byte(); /* H, V sampling factors */ - (void)read_1_byte(); /* Quantization table number */ - } -} - -/* - * Parse the marker stream until SOS or EOI is seen; - * display any COM markers. - * While the companion program wrjpgcom will always insert COM markers before - * SOFn, other implementations might not, so we scan to SOS before stopping. - * If we were only interested in the image dimensions, we would stop at SOFn. - * (Conversely, if we only cared about COM markers, there would be no need - * for special code to handle SOFn; we could treat it like other markers.) - */ - -static int scan_JPEG_header(int verbose, int raw) { - int marker; - /* Expect SOI at start of file */ - if (first_marker() != M_SOI) - ERREXIT("Expected SOI marker first"); - - /* Scan miscellaneous markers until we reach SOS. */ - for (;;) { - marker = next_marker(); - switch (marker) { - /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be, - * treated as SOFn. C4 in particular is actually DHT. - */ - case M_SOF0: /* Baseline */ - case M_SOF1: /* Extended sequential, Huffman */ - case M_SOF2: /* Progressive, Huffman */ - case M_SOF3: /* Lossless, Huffman */ - case M_SOF5: /* Differential sequential, Huffman */ - case M_SOF6: /* Differential progressive, Huffman */ - case M_SOF7: /* Differential lossless, Huffman */ - case M_SOF9: /* Extended sequential, arithmetic */ - case M_SOF10: /* Progressive, arithmetic */ - case M_SOF11: /* Lossless, arithmetic */ - case M_SOF13: /* Differential sequential, arithmetic */ - case M_SOF14: /* Differential progressive, arithmetic */ - case M_SOF15: /* Differential lossless, arithmetic */ - if (verbose) - process_SOFn(marker); - else - skip_variable(); - break; - - case M_SOS: /* stop before hitting compressed data */ - return marker; - - case M_EOI: /* in case it's a tables-only JPEG stream */ - return marker; - - case M_COM: - process_COM(raw); - break; - - case M_APP12: - /* Some digital camera makers put useful textual information into - * APP12 markers, so we print those out too when in -verbose mode. - */ - if (verbose) { - printf("APP12 contains:\n"); - process_COM(raw); - } else - skip_variable(); - break; - - default: /* Anything else just gets skipped */ - skip_variable(); /* we assume it has a parameter count... */ - break; - } - } /* end loop */ -} - -/* Command line parsing code */ - -static const char *progname; /* program name for error messages */ - -static void usage(void) -/* complain about bad command line */ -{ - fprintf(stderr, "rdjpgcom displays any textual comments in a JPEG file.\n"); - - fprintf(stderr, "Usage: %s [switches] [inputfile]\n", progname); - - fprintf(stderr, "Switches (names may be abbreviated):\n"); - fprintf( - stderr, - " -raw Display non-printable characters in comments (unsafe)\n"); - fprintf(stderr, " -verbose Also display dimensions of JPEG image\n"); - - exit(EXIT_FAILURE); -} - -static int keymatch(char *arg, const char *keyword, int minchars) -/* Case-insensitive matching of (possibly abbreviated) keyword switches. */ -/* keyword is the constant keyword (must be lower case already), */ -/* minchars is length of minimum legal abbreviation. */ -{ - register int ca, ck; - register int nmatched = 0; - - while ((ca = *arg++) != '\0') { - if ((ck = *keyword++) == '\0') - return 0; /* arg longer than keyword, no good */ - if (isupper(ca)) /* force arg to lcase (assume ck is already) */ - ca = tolower(ca); - if (ca != ck) - return 0; /* no good */ - nmatched++; /* count matched characters */ - } - /* reached end of argument; fail if it's too short for unique abbrev */ - if (nmatched < minchars) - return 0; - return 1; /* A-OK */ -} - -/* - * The main program. - */ - -int main(int argc, char **argv) { - int argn; - char *arg; - int verbose = 1, raw = 0; - -/* On Mac, fetch a command line. */ -#ifdef USE_CCOMMAND - argc = ccommand(&argv); -#endif - - progname = argv[0]; - if (progname == NULL || progname[0] == 0) - progname = "rdjpgcom"; /* in case C library doesn't provide it */ - - /* Parse switches, if any */ - for (argn = 1; argn < argc; argn++) - { - arg = argv[argn]; - if (arg[0] != '-') - break; /* not switch, must be file name */ - arg++; /* advance over '-' */ - if (keymatch(arg, "verbose", 1)) - { - verbose++; - } - else if (keymatch(arg, "raw", 1)) - { - raw = 1; - } - else - usage(); - } - - /* Open the input file. */ - /* Unix style: expect zero or one file name */ - if (argn < argc - 1) - { - fprintf(stderr, "%s: only one input file\n", progname); - usage(); - } - if (argn < argc) - { - if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) - { - fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]); - exit(EXIT_FAILURE); - } - } - else if ((infile = fopen("testimg.jpg", READ_BINARY)) == NULL) - { -/* default input file is stdin */ -#ifdef USE_SETMODE /* need to hack file mode? */ - setmode(fileno(stdin), O_BINARY); -#endif -#ifdef USE_FDOPEN /* need to re-open in binary mode? */ - if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) - { - fprintf(stderr, "%s: can't open stdin\n", progname); - exit(EXIT_FAILURE); - } -#else - infile = stdin; -#endif - } - - /* Scan the JPEG headers. */ - (void)scan_JPEG_header(verbose, raw); +#include "jpeglib.h" - /* All done. */ - exit(EXIT_SUCCESS); - return 0; /* suppress no-return-value warnings */ +int main() { + struct jpeg_decompress_struct info; + struct jpeg_error_mgr err; + info.err = jpeg_std_error(&err); + jpeg_create_decompress(&info); } diff --git a/recipes/mozjpeg/all/test_package/testimg.jpg b/recipes/mozjpeg/all/test_package/testimg.jpg deleted file mode 100644 index a026e486f57de..0000000000000 Binary files a/recipes/mozjpeg/all/test_package/testimg.jpg and /dev/null differ diff --git a/recipes/mozjpeg/all/test_package_module/conanfile.py b/recipes/mozjpeg/all/test_package_module/conanfile.py index fd19bb1425057..0a6bc68712d90 100644 --- a/recipes/mozjpeg/all/test_package_module/conanfile.py +++ b/recipes/mozjpeg/all/test_package_module/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/mozjpeg/all/test_v1_package/conanfile.py b/recipes/mozjpeg/all/test_v1_package/conanfile.py index cf6e3a0371de5..5a05af3c2dfd2 100644 --- a/recipes/mozjpeg/all/test_v1_package/conanfile.py +++ b/recipes/mozjpeg/all/test_v1_package/conanfile.py @@ -15,5 +15,4 @@ def build(self): def test(self): if not cross_building(self): bin_path = os.path.join("bin", "test_package") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/mozjpeg/all/test_v1_package_module/conanfile.py b/recipes/mozjpeg/all/test_v1_package_module/conanfile.py index b6600e428515c..19e6a0c06e3d8 100644 --- a/recipes/mozjpeg/all/test_v1_package_module/conanfile.py +++ b/recipes/mozjpeg/all/test_v1_package_module/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/mp-units/0.8.0/conanfile.py b/recipes/mp-units/0.8.0/conanfile.py index c44e1496f2a03..147e52908bb8c 100644 --- a/recipes/mp-units/0.8.0/conanfile.py +++ b/recipes/mp-units/0.8.0/conanfile.py @@ -59,7 +59,7 @@ def _use_range_v3(self): def requirements(self): self.requires("gsl-lite/0.40.0") if self._use_libfmt: - self.requires("fmt/10.1.0") + self.requires("fmt/10.2.1") if self._use_range_v3: self.requires("range-v3/0.12.0") diff --git a/recipes/mp-units/2.0.0/conandata.yml b/recipes/mp-units/2.0.0/conandata.yml index 6919665f992c1..a3b955f5397c3 100644 --- a/recipes/mp-units/2.0.0/conandata.yml +++ b/recipes/mp-units/2.0.0/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.1": + url: https://github.com/mpusz/units/archive/v2.1.1.tar.gz + sha256: 881070fd9a15a8954a4e38d991e398dc9638907bbc13961a530519596c9783f9 "2.1.0": url: https://github.com/mpusz/units/archive/v2.1.0.tar.gz sha256: a42057492f5a8e80442cf13602b97bb48b9c3a408bc91bdb60d86aadc84c95cc diff --git a/recipes/mp-units/2.0.0/conanfile.py b/recipes/mp-units/2.0.0/conanfile.py index c41e90a14db59..655d918b9aed6 100644 --- a/recipes/mp-units/2.0.0/conanfile.py +++ b/recipes/mp-units/2.0.0/conanfile.py @@ -55,7 +55,7 @@ def _use_libfmt(self): def requirements(self): self.requires("gsl-lite/0.40.0") if self._use_libfmt: - self.requires("fmt/10.1.0") + self.requires("fmt/10.2.1") def validate(self): if self.settings.get_safe("compiler.cppstd"): diff --git a/recipes/mp-units/2.2.0/conandata.yml b/recipes/mp-units/2.2.0/conandata.yml new file mode 100644 index 0000000000000..2aee126e2e782 --- /dev/null +++ b/recipes/mp-units/2.2.0/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.2.1": + url: https://github.com/mpusz/units/archive/v2.2.1.tar.gz + sha256: ce5edb27fad9c54b388040341a03d7f2462d61dcedad85b4c983c0e648a91bac diff --git a/recipes/mp-units/2.2.0/conanfile.py b/recipes/mp-units/2.2.0/conanfile.py new file mode 100644 index 0000000000000..89060efea4041 --- /dev/null +++ b/recipes/mp-units/2.2.0/conanfile.py @@ -0,0 +1,274 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import default_cppstd, valid_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=1.59.0" + + +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] + + +class MPUnitsConan(ConanFile): + name = "mp-units" + homepage = "https://github.com/mpusz/mp-units" + description = "The quantities and units library for C++" + topics = ( + "units", + "dimensions", + "quantities", + "dimensional-analysis", + "physical-quantities", + "physical-units", + "system-of-units", + "system-of-quantities", + "isq", + "si", + "library", + "quantity-manipulation", + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" + options = { + "cxx_modules": [True, False], + "std_format": [True, False], + "string_view_ret": [True, False], + "no_crtp": [True, False], + "contracts": ["none", "gsl-lite", "ms-gsl"], + "freestanding": [True, False], + } + default_options = { + # "cxx_modules" default set in config_options() + # "std_format" default set in config_options() + # "string_view_ret" default set in config_options() + # "no_crtp" default set in config_options() + "contracts": "gsl-lite", + "freestanding": False, + } + package_type = "header-library" + no_copy_source = True + + @property + def _feature_compatibility(self): + return { + "minimum_support": { + "min_cppstd": "20", + "compiler": { + "gcc": "12", + "clang": "16", + "apple-clang": "15", + "msvc": "", + "Visual Studio": "", + }, + }, + "std_format": { + "min_cppstd": "20", + "compiler": { + "gcc": "13", + "clang": "17", + "apple-clang": "", + "msvc": "", + "Visual Studio": "", + }, + }, + "cxx_modules": { + "min_cppstd": "20", + "compiler": { + "gcc": "", + "clang": "17", + "apple-clang": "", + "msvc": "", + "Visual Studio": "", + }, + }, + "static_constexpr_vars_in_constexpr_func": { + "min_cppstd": "23", + "compiler": { + "gcc": "13", + "clang": "17", + "apple-clang": "", + "msvc": "", + "Visual Studio": "", + }, + }, + "explicit_this": { + "min_cppstd": "23", + "compiler": { + "gcc": "14", + "clang": "18", + "apple-clang": "", + "msvc": "", + "Visual Studio": "", + }, + }, + } + + @property + def _option_feature_map(self): + return { + "std_format": "std_format", + "cxx_modules": "cxx_modules", + "string_view_ret": "static_constexpr_vars_in_constexpr_func", + "no_crtp": "explicit_this", + } + + def _set_default_option(self, name): + compiler = self.settings.compiler + feature_name = self._option_feature_map[name] + feature = self._feature_compatibility[feature_name] + min_version = feature["compiler"].get(str(compiler)) + setattr( + self.options, + name, + bool( + min_version + and Version(compiler.version) >= min_version + and valid_min_cppstd(self, feature["min_cppstd"]) + ), + ) + + def _check_feature_supported(self, name, feature_name=name): + compiler = self.settings.compiler + cppstd = compiler.get_safe("cppstd") + feature = self._feature_compatibility[feature_name] + + # check C++ version + if cppstd and not valid_min_cppstd(self, feature["min_cppstd"]): + raise ConanInvalidConfiguration( + f"'{name}' requires at least cppstd={feature['min_cppstd']} ({cppstd} in use)", + ) + + # check compiler version + min_version = feature["compiler"].get(str(compiler)) + if min_version == None: + # not tested compiler being used - use at your own risk + return + if min_version == "": + raise ConanInvalidConfiguration( + f"'{name}' is not yet supported by any known {compiler} version" + ) + if loose_lt_semver(str(compiler.version), min_version): + raise ConanInvalidConfiguration( + f"'{name}' requires at least {compiler}-{min_version} ({compiler}-{compiler.version} in use)" + ) + + def config_options(self): + for key in self._option_feature_map.keys(): + self._set_default_option(key) + + def configure(self): + if self.options.freestanding: + self.options.rm_safe("std_format") + + def requirements(self): + if not self.options.freestanding: + if self.options.contracts == "gsl-lite": + self.requires("gsl-lite/0.41.0") + elif self.options.contracts == "ms-gsl": + self.requires("ms-gsl/4.0.0") + if not self.options.std_format: + self.requires("fmt/10.2.1") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.29 <4]") + + def validate(self): + self._check_feature_supported("mp-units", "minimum_support") + for key, value in self._option_feature_map.items(): + if self.options.get_safe(key) == True: + self._check_feature_supported(key, value) + if self.options.freestanding and self.options.contracts != "none": + raise ConanInvalidConfiguration( + "'contracts' should be set to 'none' for a freestanding build" + ) + + 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) + if self.options.cxx_modules: + tc.cache_variables["CMAKE_CXX_SCAN_FOR_MODULES"] = True + tc.cache_variables["MP_UNITS_BUILD_CXX_MODULES"] = self.options.cxx_modules + if self.options.freestanding: + tc.cache_variables["MP_UNITS_API_FREESTANDING"] = True + else: + tc.cache_variables["MP_UNITS_API_STD_FORMAT"] = self.options.std_format + tc.cache_variables["MP_UNITS_API_STRING_VIEW_RET"] = ( + self.options.string_view_ret + ) + tc.cache_variables["MP_UNITS_API_NO_CRTP"] = self.options.no_crtp + tc.cache_variables["MP_UNITS_API_CONTRACTS"] = str( + self.options.contracts + ).upper() + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder="src") + if self.options.cxx_modules: + cmake.build() + + def package_id(self): + self.info.clear() + + def package(self): + copy( + self, + "LICENSE.md", + self.source_folder, + 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): + compiler = self.settings.compiler + + # handle contracts + if self.options.contracts == "none": + self.cpp_info.components["core"].defines.append("MP_UNITS_API_CONTRACTS=0") + elif self.options.contracts == "gsl-lite": + self.cpp_info.components["core"].requires.append("gsl-lite::gsl-lite") + self.cpp_info.components["core"].defines.append("MP_UNITS_API_CONTRACTS=2") + elif self.options.contracts == "ms-gsl": + self.cpp_info.components["core"].requires.append("ms-gsl::ms-gsl") + self.cpp_info.components["core"].defines.append("MP_UNITS_API_CONTRACTS=3") + + # handle API options + self.cpp_info.components["core"].defines.append( + "MP_UNITS_API_STRING_VIEW_RET=" + + str(int(self.options.string_view_ret == True)) + ) + self.cpp_info.components["core"].defines.append( + "MP_UNITS_API_NO_CRTP=" + str(int(self.options.no_crtp == True)) + ) + self.cpp_info.components["core"].defines.append( + "MP_UNITS_API_STD_FORMAT=" + str(int(self.options.std_format == True)) + ) + if not self.options.std_format: + self.cpp_info.components["core"].requires.append("fmt::fmt") + + # handle hosted configuration + if not self.options.freestanding: + self.cpp_info.components["core"].defines.append("MP_UNITS_HOSTED=1") + + if compiler == "msvc": + self.cpp_info.components["core"].cxxflags = ["/utf-8"] + + self.cpp_info.components["systems"].requires = ["core"] diff --git a/recipes/mp-units/2.2.0/test_package/CMakeLists.txt b/recipes/mp-units/2.2.0/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..07f3e7cd91e8a --- /dev/null +++ b/recipes/mp-units/2.2.0/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package + LANGUAGES CXX +) + +find_package(mp-units CONFIG REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE mp-units::mp-units) +target_compile_features(test_package PUBLIC cxx_std_20) diff --git a/recipes/mp-units/2.2.0/test_package/conanfile.py b/recipes/mp-units/2.2.0/test_package/conanfile.py new file mode 100644 index 0000000000000..e418ee7701960 --- /dev/null +++ b/recipes/mp-units/2.2.0/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "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/mp-units/2.2.0/test_package/test_package.cpp b/recipes/mp-units/2.2.0/test_package/test_package.cpp new file mode 100644 index 0000000000000..1182e75d816e4 --- /dev/null +++ b/recipes/mp-units/2.2.0/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include + +using namespace mp_units; + +constexpr auto avg_speed(QuantityOf auto d, QuantityOf auto t) +{ + return d / t; +} + +int main() +{ + using namespace mp_units::si::unit_symbols; + std::cout << "Average speed = " << avg_speed(240 * km, 2 * h) << '\n'; +} diff --git a/recipes/mp-units/config.yml b/recipes/mp-units/config.yml index 3bf1ad6108b4a..adf715f7230a3 100644 --- a/recipes/mp-units/config.yml +++ b/recipes/mp-units/config.yml @@ -1,4 +1,8 @@ versions: + "2.2.1": + folder: 2.2.0 + "2.1.1": + folder: 2.0.0 "2.1.0": folder: 2.0.0 "2.0.0": diff --git a/recipes/mpir/all/conandata.yml b/recipes/mpir/all/conandata.yml index c5a67d7b84dca..815ad473b44e7 100644 --- a/recipes/mpir/all/conandata.yml +++ b/recipes/mpir/all/conandata.yml @@ -1,4 +1,10 @@ sources: "3.0.0": - url: "http://mpir.org/mpir-3.0.0.zip" - sha256: "6277d3cc36ff39c98e4d4cc17b46b5a6ff42a22d30a4130b2d49255f98dd8c1f" + url: "https://github.com/wbhart/mpir/archive/refs/tags/mpir-3.0.0.tar.gz" + sha256: "86a5039badc3e6738219a262873a1db5513405e15ece9527b718fcd0fac09bb2" +patches: + "3.0.0": + - patch_file: "patches/fix_xcode_12_configure.patch" + patch_type: "backport" + patch_source: https://github.com/wbhart/mpir/commit/bbc43ca6ae0bec4f64e69c9cd4c967005d6470eb + patch_description: "Fix warnings (turned to errors) that causes XCode 12+ configure to fail" diff --git a/recipes/mpir/all/conanfile.py b/recipes/mpir/all/conanfile.py index 3c6c16a085f0b..d9ae778b935b2 100644 --- a/recipes/mpir/all/conanfile.py +++ b/recipes/mpir/all/conanfile.py @@ -1,26 +1,28 @@ +import os + from conan import ConanFile -from conan.tools.microsoft import msvc_runtime_flag, is_msvc -from conan.tools.build import cross_building -from conan.tools.files import get, copy, replace_in_file, chdir, rmdir, rm -from conan.tools.scm import Version -from conans import tools, AutoToolsBuildEnvironment, MSBuild from conan.errors import ConanInvalidConfiguration -import contextlib -import os +from conan.tools.apple import XCRun, to_apple_arch +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import MSBuild, MSBuildToolchain, is_msvc, is_msvc_static_runtime, msvc_runtime_flag + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.50.0" class MpirConan(ConanFile): name = "mpir" - description = "MPIR is a highly optimised library for bignum arithmetic" \ - "forked from the GMP bignum library." - topics = ("mpir", "multiprecision", "math", "mathematics") - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://mpir.org/" + description = ("MPIR is a highly optimised library for bignum arithmetic " + "forked from the GMP bignum library.") license = "LGPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/wbhart/mpir" + topics = ("multiprecision", "math", "mathematics") - provides = [] - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -35,45 +37,84 @@ class MpirConan(ConanFile): "enable_gmpcompat": True, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if is_msvc(self) and self.options.shared: del self.options.enable_cxx if not self.options.get_safe("enable_cxx", False): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") if self.options.enable_gmpcompat: - self.provides.append("gmp") + self.provides = ["gmp"] + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): raise ConanInvalidConfiguration("Cross-building doesn't work (yet)") def build_requirements(self): + self.tool_requires("libtool/2.4.7") self.tool_requires("yasm/1.3.0") if not is_msvc(self): self.tool_requires("m4/1.4.19") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.tool_requires("msys2/cci.latest") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") def source(self): - get(self, keep_permissions=True, **self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True, keep_permissions=True) + + def _generate_msvc(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MSBuildToolchain(self) + tc.generate() + + def _generate_autotools(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-silent-rules") + tc.configure_args.append("--enable-cxx" if self.options.get_safe("enable_cxx") else "--disable-cxx") + tc.configure_args.append("--enable-gmpcompat" if self.options.enable_gmpcompat else "--disable-gmpcompat") + + # compiler checks are written for C89 but compilers that default to C99 treat implicit functions as error + tc.extra_cxxflags.append("-Wno-implicit-function-declaration") + + if self.settings.compiler == "apple-clang": + if hasattr(self, "settings_build"): + # there is no CFLAGS_FOR_BUILD/CXXFLAGS_FOR_BUILD + sdk_path = XCRun(self).sdk_path + tc.extra_cxxflags += [ + "-Wno-implicit-function-declaration", + "-isysroot", sdk_path, + "-arch", to_apple_arch(self), + ] + # Disable docs + tc.make_args.append("MAKEINFO=true") + tc.generate() + + def generate(self): + if is_msvc(self): + self._generate_msvc() + else: + self._generate_autotools() @property def _platforms(self): @@ -83,75 +124,41 @@ def _platforms(self): def _dll_or_lib(self): return "dll" if self.options.shared else "lib" + @property + def _vs_ide_version(self): + if str(self.settings.compiler) == "Visual Studio": + return self.settings.compiler.version + msvc_to_ide = {"170": "11", "180": "12", "190": "14", "191": "15", "192": "16", "193": "17"} + return msvc_to_ide.get(str(self.settings.compiler.version), "17") + @property def _vcxproj_paths(self): - compiler_version = self.settings.compiler.version if Version(self.settings.compiler.version) <= "17" else "17" - build_subdir = "build.vc{}".format(compiler_version) + build_subdir = f"build.vc{self._vs_ide_version}" vcxproj_paths = [ - os.path.join(self._source_subfolder, build_subdir, - "{}_mpir_gc".format(self._dll_or_lib), - "{}_mpir_gc.vcxproj".format(self._dll_or_lib)) + os.path.join(self.source_folder, build_subdir, f"{self._dll_or_lib}_mpir_gc", f"{self._dll_or_lib}_mpir_gc.vcxproj") ] if self.options.get_safe("enable_cxx"): - vcxproj_paths.append(os.path.join(self._source_subfolder, build_subdir, + vcxproj_paths.append(os.path.join(self.source_folder, build_subdir, "lib_mpir_cxx", "lib_mpir_cxx.vcxproj")) return vcxproj_paths - def _build_visual_studio(self): - if not self.options.shared: # RuntimeLibrary only defined in lib props files + def _build_msvc(self): + if not self.options.shared: # RuntimeLibrary only defined in lib props files build_type = "debug" if self.settings.build_type == "Debug" else "release" - props_path = os.path.join(self._source_subfolder, "build.vc", - "mpir_{}_lib.props".format(build_type)) - old_runtime = "MultiThreaded{}".format( - "Debug" if build_type == "debug" else "", - ) + props_path = os.path.join(self.source_folder, "build.vc", f"mpir_{build_type}_lib.props") + old_runtime = "MultiThreaded{}".format("Debug" if build_type == "debug" else "") new_runtime = "MultiThreaded{}{}".format( "Debug" if "d" in msvc_runtime_flag(self) else "", - "DLL" if "MD" in msvc_runtime_flag(self) else "", + "DLL" if not is_msvc_static_runtime(self) else "", ) replace_in_file(self, props_path, old_runtime, new_runtime) msbuild = MSBuild(self) for vcxproj_path in self._vcxproj_paths: - msbuild.build(vcxproj_path, platforms=self._platforms, upgrade_project=False) - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "apple-clang": - env_build = {"CC": tools.XCRun(self.settings).cc, - "CXX": tools.XCRun(self.settings).cxx} - if hasattr(self, "settings_build"): - # there is no CFLAGS_FOR_BUILD/CXXFLAGS_FOR_BUILD - xcrun = tools.XCRun(self.settings_build) - flags = " -Wno-implicit-function-declaration -isysroot {} -arch {}".format(xcrun.sdk_path, tools.to_apple_arch(self.settings_build.arch)) - env_build["CC_FOR_BUILD"] = xcrun.cc + flags - env_build["CXX_FOR_BUILD"] = xcrun.cxx + flags - with tools.environment_append(env_build): - yield - else: - yield - - def _configure_autotools(self): - if not self._autotools: - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - args = [] - if self.options.shared: - args.extend(["--disable-static", "--enable-shared"]) - else: - args.extend(["--disable-shared", "--enable-static"]) - args.append("--with-pic" if self.options.get_safe("fPIC", True) else "--without-pic") - - args.append("--disable-silent-rules") - args.append("--enable-cxx" if self.options.get_safe("enable_cxx") else "--disable-cxx") - args.append("--enable-gmpcompat" if self.options.enable_gmpcompat else "--disable-gmpcompat") - - # compiler checks are written for C89 but compilers that default to C99 treat implicit functions as error - self._autotools.flags.append("-Wno-implicit-function-declaration") - self._autotools.configure(args=args) - return self._autotools + msbuild.build(vcxproj_path) def _patch_new_msvc_version(self, ver, toolset): - new_dir = os.path.join(self._source_subfolder, f'build.vc{ver}') - copy(self, pattern="*", src=os.path.join(self._source_subfolder, 'build.vc15'), dst=new_dir) + new_dir = os.path.join(self.source_folder, f"build.vc{ver}") + copy(self, pattern="*", src=os.path.join(self.source_folder, "build.vc15"), dst=new_dir) for root, _, files in os.walk(new_dir): for file in files: @@ -167,6 +174,7 @@ def _patch_new_msvc_version(self, ver, toolset): replace_in_file(self, full_file, 'check_config $(Platform) $(Configuration) 15', f'check_config $(Platform) $(Configuration) {ver}', strict=False) def _patch_sources(self): + apply_conandata_patches(self) if is_msvc(self): self._patch_new_msvc_version(16, "v142") self._patch_new_msvc_version(17, "v143") @@ -174,20 +182,25 @@ def _patch_sources(self): def build(self): self._patch_sources() if is_msvc(self): - self._build_visual_studio() + self._build_msvc() else: - with chdir(self, self._source_subfolder), self._build_context(): + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.autoreconf() # relocatable shared lib on macOS replace_in_file(self, "configure", "-install_name \\$rpath/", "-install_name @rpath/") - autotools = self._configure_autotools() + autotools.configure() autotools.make() def package(self): - copy(self, "COPYING*", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, self._source_subfolder)) + copy(self, "COPYING*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) if is_msvc(self): - lib_folder = os.path.join(self.build_folder, self._source_subfolder, self._dll_or_lib, - self._platforms.get(str(self.settings.arch)), - str(self.settings.build_type)) + lib_folder = os.path.join( + self.source_folder, + self._dll_or_lib, + self._platforms.get(str(self.settings.arch)), + str(self.settings.build_type), + ) include_folder = os.path.join(self.package_folder, "include") copy(self, "mpir.h", dst=include_folder, src=lib_folder, keep_path=True) if self.options.enable_gmpcompat: @@ -196,11 +209,11 @@ def package(self): copy(self, "mpirxx.h", dst=include_folder, src=lib_folder, keep_path=True) if self.options.enable_gmpcompat: copy(self, "gmpxx.h", dst=include_folder, src=lib_folder, keep_path=True) - copy(self, pattern="*.dll*", dst=os.path.join(self.package_folder, "bin"), src=lib_folder, keep_path=False) - copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=lib_folder, keep_path=False) + copy(self, "*.dll*", dst=os.path.join(self.package_folder, "bin"), src=lib_folder, keep_path=False) + copy(self, "*.lib", dst=os.path.join(self.package_folder, "lib"), src=lib_folder, keep_path=False) else: - with chdir(self, self._source_subfolder), self._build_context(): - autotools = self._configure_autotools() + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.install() rmdir(self, os.path.join(self.package_folder, "share")) rm(self, "*.la", os.path.join(self.package_folder, "lib")) diff --git a/recipes/mpir/all/patches/fix_xcode_12_configure.patch b/recipes/mpir/all/patches/fix_xcode_12_configure.patch new file mode 100644 index 0000000000000..13454c5f7d321 --- /dev/null +++ b/recipes/mpir/all/patches/fix_xcode_12_configure.patch @@ -0,0 +1,113 @@ +From bbc43ca6ae0bec4f64e69c9cd4c967005d6470eb Mon Sep 17 00:00:00 2001 +From: Mitchell Blank Jr +Date: Mon, 21 Dec 2020 12:05:19 +0000 +Subject: [PATCH] Fix configure failures with Xcode12 + +Changes are needed becuase Xcode12 includes a default of +-Werror,-Wimplicit-function-declaration which means that +even something like calling "exit(0);" is a compile failure +if you haven't done a "#include " first (as C99 +requires, but most other compilers will just warn about) + +I don't know if the "long long reliability test 2" test which +tries to provoke a crash on a particular gcc 3.3 build still +does what it was originally intended to do with my change. +Of course, I doubt anyone has tried to use that compiler in +years. + +Fixes #290 +--- + acinclude.m4 | 24 +++++++++++++----------- + 1 file changed, 13 insertions(+), 11 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 91c35bc23..620a629ef 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -589,9 +589,9 @@ extern + #endif + __inline__ t1 e(t2 rp,t2 up,int n,t1 v0) + {t1 c,x,r;int i;if(v0){c=1;for(i=1;iconftest.c <conftest.c < + int + main () + { +- exit(0); ++ return 0; + } + double d; + double diff --git a/recipes/mpir/all/test_package/CMakeLists.txt b/recipes/mpir/all/test_package/CMakeLists.txt index d64654ce1f75a..532d088505a3e 100644 --- a/recipes/mpir/all/test_package/CMakeLists.txt +++ b/recipes/mpir/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(mpir CONFIG REQUIRED) +find_package(mpir REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} mpir::mpir) diff --git a/recipes/mpir/all/test_package/conanfile.py b/recipes/mpir/all/test_package/conanfile.py index 2490acfa82ff8..ef5d7042163ec 100644 --- a/recipes/mpir/all/test_package/conanfile.py +++ b/recipes/mpir/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mpir/all/test_v1_package/CMakeLists.txt b/recipes/mpir/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/mpir/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/etl/all/test_v1_package/conanfile.py b/recipes/mpir/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/etl/all/test_v1_package/conanfile.py rename to recipes/mpir/all/test_v1_package/conanfile.py diff --git a/recipes/msdfgen/all/conandata.yml b/recipes/msdfgen/all/conandata.yml index 2d80e884e7bf9..6943aebeb6690 100644 --- a/recipes/msdfgen/all/conandata.yml +++ b/recipes/msdfgen/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.12": + url: "https://github.com/Chlumsky/msdfgen/archive/refs/tags/v1.12.tar.gz" + sha256: "f058117496097217d12e4ea86adbff8467adaf6f12af793925d243b86b0c4f57" + "1.11": + url: "https://github.com/Chlumsky/msdfgen/archive/refs/tags/v1.11.tar.gz" + sha256: "fad74e33274f591e72511bc0546189e7aec439f2a512ef1b2fde243554d457cb" "1.10": url: "https://github.com/Chlumsky/msdfgen/archive/refs/tags/v1.10.tar.gz" sha256: "2754d1687bfb80968d9c682e0c4c04c8fcf72df1421d076baf44ea0d87aa3662" @@ -10,8 +16,8 @@ sources: sha256: "909eb88c71268dc00cdda244a1fa40a0feefae45f68a779fbfddd5463559fa40" patches: "1.10": - - patch_file: "patches/1.10-0001-fix-cmake.patch" - patch_description: "move project position to top" + - patch_file: "patches/1.10-0001-honor-msvc-runtime.patch" + patch_description: "Remove hardcoded vc runtime" patch_type: "conan" "1.9.1": - patch_file: "patches/1.9-0001-unvendor-external-libs.patch" diff --git a/recipes/msdfgen/all/conanfile.py b/recipes/msdfgen/all/conanfile.py index 03f96bc253715..2094d2f1bfe2c 100644 --- a/recipes/msdfgen/all/conanfile.py +++ b/recipes/msdfgen/all/conanfile.py @@ -2,22 +2,21 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, 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, is_msvc_static_runtime from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" - class MsdfgenConan(ConanFile): name = "msdfgen" description = "Multi-channel signed distance field generator" license = "MIT" - topics = ("msdf", "shape", "glyph", "font") - homepage = "https://github.com/Chlumsky/msdfgen" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://github.com/Chlumsky/msdfgen" + topics = ("msdf", "shape", "glyph", "font") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -49,12 +48,13 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("freetype/2.12.1") + self.requires("freetype/2.13.2") if Version(self.version) < "1.10": self.requires("lodepng/cci.20200615") else: - self.requires("libpng/1.6.39") - self.requires("tinyxml2/9.0.0") + self.requires("libpng/[>=1.6 <2]") + self.requires("tinyxml2/10.0.0") + def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -65,59 +65,45 @@ def validate(self): raise ConanInvalidConfiguration("skia recipe not available yet in CCI") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) - tc.variables["MSDFGEN_BUILD_MSDFGEN_STANDALONE"] = self.options.utility - tc.variables["MSDFGEN_USE_OPENMP"] = self.options.with_openmp - tc.variables["MSDFGEN_USE_CPP11"] = True - tc.variables["MSDFGEN_USE_SKIA"] = self.options.with_skia - tc.variables["MSDFGEN_INSTALL"] = True + tc.cache_variables["MSDFGEN_BUILD_MSDFGEN_STANDALONE"] = self.options.utility + tc.cache_variables["MSDFGEN_USE_OPENMP"] = self.options.with_openmp + tc.cache_variables["MSDFGEN_USE_CPP11"] = True + tc.cache_variables["MSDFGEN_USE_SKIA"] = self.options.with_skia + tc.cache_variables["MSDFGEN_INSTALL"] = True if Version(self.version) >= "1.10": - tc.variables["MSDFGEN_DYNAMIC_RUNTIME"] = not is_msvc_static_runtime(self) - tc.variables["MSDFGEN_USE_VCPKG"] = False + tc.cache_variables["MSDFGEN_USE_VCPKG"] = False + # Because in upstream CMakeLists, project() is called after some logic based on BUILD_SHARED_LIBS + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + if Version(self.version) >= "1.11": + tc.cache_variables["MSDFGEN_DYNAMIC_RUNTIME"] = not is_msvc_static_runtime(self) + if self.settings.os == "Linux": + # Workaround for https://github.com/conan-io/conan/issues/13560 + libdirs_host = [l for dependency in self.dependencies.host.values() for l in dependency.cpp_info.aggregated_components().libdirs] + tc.variables["CMAKE_BUILD_RPATH"] = ";".join(libdirs_host) tc.generate() deps = CMakeDeps(self) deps.generate() def _patch_sources(self): apply_conandata_patches(self) - cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - # workaround against CMAKE_FIND_PACKAGE_PREFER_CONFIG ON in conan toolchain - replace_in_file(self, cmakelists, "find_package(Freetype REQUIRED)", "find_package(Freetype REQUIRED MODULE)") - # remove bundled lodepng & tinyxml2 - rmdir(self, os.path.join(self.source_folder, "lib")) - rmdir(self, os.path.join(self.source_folder, "include")) - # very weird but required for Visual Studio when libs are unvendored (at least for Ninja generator) - if is_msvc(self): - if Version(self.version) < "1.10": + + if Version(self.version) < "1.10": + # remove bundled lodepng & tinyxml2 + rmdir(self, os.path.join(self.source_folder, "lib")) + rmdir(self, os.path.join(self.source_folder, "include")) + + # very weird but required for Visual Studio when libs are unvendored (at least for Ninja generator) + if is_msvc(self): replace_in_file( self, - cmakelists, + os.path.join(self.source_folder, "CMakeLists.txt"), "set_target_properties(msdfgen-standalone PROPERTIES ARCHIVE_OUTPUT_DIRECTORY archive OUTPUT_NAME msdfgen)", "set_target_properties(msdfgen-standalone PROPERTIES OUTPUT_NAME msdfgen IMPORT_PREFIX foo)", ) - else: - replace_in_file( - self, - cmakelists, - 'set_property(TARGET msdfgen-core PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>")', - '' - ) - replace_in_file( - self, - cmakelists, - 'set_property(TARGET msdfgen-ext PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>")', - '' - ) - replace_in_file( - self, - cmakelists, - 'set_property(TARGET msdfgen PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>")', - '' - ) def build(self): self._patch_sources() @@ -130,6 +116,7 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "msdfgen") @@ -167,7 +154,6 @@ def package_info(self): if self.options.with_skia: self.cpp_info.components["msdfgen-ext"].defines.append("MSDFGEN_USE_SKIA") + # TODO: to remove once conan v1 support dropped if self.options.utility: - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) - self.env_info.PATH.append(bin_path) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/msdfgen/all/patches/1.10-0001-fix-cmake.patch b/recipes/msdfgen/all/patches/1.10-0001-fix-cmake.patch deleted file mode 100644 index 50b04c4c1e5d9..0000000000000 --- a/recipes/msdfgen/all/patches/1.10-0001-fix-cmake.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6dec916..432f218 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2,6 +2,9 @@ - cmake_minimum_required(VERSION 3.15) - include(cmake/version.cmake) - -+# Version is specified in vcpkg.json -+project(msdfgen VERSION ${MSDFGEN_VERSION} LANGUAGES CXX) -+ - option(MSDFGEN_CORE_ONLY "Only build the core library with no dependencies" OFF) - option(MSDFGEN_BUILD_STANDALONE "Build the msdfgen standalone executable" ON) - option(MSDFGEN_USE_VCPKG "Use vcpkg package manager to link project dependencies" ON) -@@ -67,9 +70,6 @@ if(MSDFGEN_USE_VCPKG) - endif() - endif() - --# Version is specified in vcpkg.json --project(msdfgen VERSION ${MSDFGEN_VERSION} LANGUAGES CXX) -- - file(GLOB_RECURSE MSDFGEN_CORE_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "core/*.h" "core/*.hpp") - file(GLOB_RECURSE MSDFGEN_CORE_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "core/*.cpp") - file(GLOB_RECURSE MSDFGEN_EXT_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ext/*.h" "ext/*.hpp") diff --git a/recipes/msdfgen/all/patches/1.10-0001-honor-msvc-runtime.patch b/recipes/msdfgen/all/patches/1.10-0001-honor-msvc-runtime.patch new file mode 100644 index 0000000000000..c0f9784ad23cf --- /dev/null +++ b/recipes/msdfgen/all/patches/1.10-0001-honor-msvc-runtime.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -79,7 +79,6 @@ file(GLOB_RECURSE MSDFGEN_EXT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ext/ + add_library(msdfgen-core "${CMAKE_CURRENT_SOURCE_DIR}/msdfgen.h" ${MSDFGEN_CORE_HEADERS} ${MSDFGEN_CORE_SOURCES}) + add_library(msdfgen::msdfgen-core ALIAS msdfgen-core) + set_target_properties(msdfgen-core PROPERTIES PUBLIC_HEADER "${MSDFGEN_CORE_HEADERS}") +-set_property(TARGET msdfgen-core PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + target_compile_definitions(msdfgen-core PUBLIC + MSDFGEN_VERSION=${MSDFGEN_VERSION} + MSDFGEN_VERSION_MAJOR=${MSDFGEN_VERSION_MAJOR} +@@ -127,7 +126,6 @@ if(NOT MSDFGEN_CORE_ONLY) + add_library(msdfgen-ext "${CMAKE_CURRENT_SOURCE_DIR}/msdfgen-ext.h" ${MSDFGEN_EXT_HEADERS} ${MSDFGEN_EXT_SOURCES}) + add_library(msdfgen::msdfgen-ext ALIAS msdfgen-ext) + set_target_properties(msdfgen-ext PROPERTIES PUBLIC_HEADER "${MSDFGEN_EXT_HEADERS}") +- set_property(TARGET msdfgen-ext PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + target_compile_definitions(msdfgen-ext PUBLIC MSDFGEN_USE_LIBPNG) + target_link_libraries(msdfgen-ext PRIVATE msdfgen::msdfgen-core Freetype::Freetype tinyxml2::tinyxml2 PNG::PNG) + target_include_directories(msdfgen-ext +@@ -171,7 +169,6 @@ if(MSDFGEN_BUILD_STANDALONE) + add_executable(msdfgen ${MSDFGEN_STANDALONE_SOURCES}) + target_compile_definitions(msdfgen PUBLIC MSDFGEN_STANDALONE) + target_compile_definitions(msdfgen PRIVATE MSDFGEN_VERSION_UNDERLINE=${MSDFGEN_VERSION_UNDERLINE}) +- set_property(TARGET msdfgen PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + target_link_libraries(msdfgen PRIVATE msdfgen::msdfgen) + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT msdfgen) + endif() diff --git a/recipes/msdfgen/all/test_package/OpenSans-Bold.ttf b/recipes/msdfgen/all/test_package/OpenSans-Bold.ttf deleted file mode 100644 index fd79d43bea029..0000000000000 Binary files a/recipes/msdfgen/all/test_package/OpenSans-Bold.ttf and /dev/null differ diff --git a/recipes/msdfgen/all/test_package/conanfile.py b/recipes/msdfgen/all/test_package/conanfile.py index c4fdfb4dbdc98..0a6bc68712d90 100644 --- a/recipes/msdfgen/all/test_package/conanfile.py +++ b/recipes/msdfgen/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - ttf_path = os.path.join(self.source_folder, "OpenSans-Bold.ttf") - self.run(f"{bin_path} {ttf_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/msdfgen/all/test_package/test_package.cpp b/recipes/msdfgen/all/test_package/test_package.cpp index d169064c206c2..fc8e183067d7e 100644 --- a/recipes/msdfgen/all/test_package/test_package.cpp +++ b/recipes/msdfgen/all/test_package/test_package.cpp @@ -4,26 +4,9 @@ #include int main(int argc, char **argv) { - if (argc < 2) { - std::cerr << "Need at least one argument\n"; - return 1; - } - msdfgen::FreetypeHandle *ft = msdfgen::initializeFreetype(); if (ft) { - msdfgen::FontHandle *font = msdfgen::loadFont(ft, argv[1]); - if (font) { - msdfgen::Shape shape; - if (msdfgen::loadGlyph(shape, font, 'A')) { - shape.normalize(); - msdfgen::edgeColoringSimple(shape, 3.0); - msdfgen::Bitmap msdf(32, 32); - msdfgen::generateMSDF(msdf, shape, 4.0, 1.0, msdfgen::Vector2(4.0, 4.0)); - msdfgen::savePng(msdf, "output.png"); - } - msdfgen::destroyFont(font); - } - msdfgen::deinitializeFreetype(ft); + std::cout << "Test" << std::endl; // This should be printed } return 0; } diff --git a/recipes/msdfgen/all/test_v1_package/conanfile.py b/recipes/msdfgen/all/test_v1_package/conanfile.py index 7b775db727c08..38f4483872d47 100644 --- a/recipes/msdfgen/all/test_v1_package/conanfile.py +++ b/recipes/msdfgen/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - ttf_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") - self.run(f"{bin_path} {ttf_path}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/msdfgen/config.yml b/recipes/msdfgen/config.yml index 9f326bdd6e1a4..aa26d962008db 100644 --- a/recipes/msdfgen/config.yml +++ b/recipes/msdfgen/config.yml @@ -1,4 +1,8 @@ versions: + "1.12": + folder: all + "1.11": + folder: all "1.10": folder: all "1.9.1": diff --git a/recipes/msgpack-cxx/all/conandata.yml b/recipes/msgpack-cxx/all/conandata.yml index 6af577efebddf..7f56a30465e39 100644 --- a/recipes/msgpack-cxx/all/conandata.yml +++ b/recipes/msgpack-cxx/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.1.1": + url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-6.1.1/msgpack-cxx-6.1.1.tar.gz" + sha256: "5fd555742e37bbd58d166199e669f01f743c7b3c6177191dd7b31fb0c37fa191" "6.1.0": url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-6.1.0/msgpack-cxx-6.1.0.tar.gz" sha256: "23ede7e93c8efee343ad8c6514c28f3708207e5106af3b3e4969b3a9ed7039e7" diff --git a/recipes/msgpack-cxx/config.yml b/recipes/msgpack-cxx/config.yml index 934a0432a27c7..ed41d0a75c634 100644 --- a/recipes/msgpack-cxx/config.yml +++ b/recipes/msgpack-cxx/config.yml @@ -1,4 +1,6 @@ versions: + "6.1.1": + folder: all "6.1.0": folder: all "6.0.0": diff --git a/recipes/msix/all/CMakeLists.txt b/recipes/msix/all/CMakeLists.txt deleted file mode 100644 index c477e0c1e565e..0000000000000 --- a/recipes/msix/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory("source_subfolder") diff --git a/recipes/msix/all/conandata.yml b/recipes/msix/all/conandata.yml index ef22231170ffe..0de96c69cb0d4 100644 --- a/recipes/msix/all/conandata.yml +++ b/recipes/msix/all/conandata.yml @@ -4,7 +4,8 @@ sources: sha256: "23179d577d0b9d34e93374ae38284ab9f1247ff6cc9175851983fb114ab00087" patches: "1.7": - - base_path: "source_subfolder" - patch_file: "patches/1.7/cmake.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.7/signaturevalidator.patch" + - patch_file: "patches/1.7/cmake.patch" + - patch_file: "patches/1.7/signaturevalidator.patch" + - patch_file: "patches/1.7/001-fix-missing-include.patch" + patch_description: "Fix missing #include " + patch_type: "portability" diff --git a/recipes/msix/all/conanfile.py b/recipes/msix/all/conanfile.py index 0c62a718f8c29..9a1d7b90fe8e0 100644 --- a/recipes/msix/all/conanfile.py +++ b/recipes/msix/all/conanfile.py @@ -1,19 +1,26 @@ -from conans import CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration +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, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get +from conan.tools.scm import Version -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class MsixConan(ConanFile): name = "msix" + description = "An SDK for creating MSIX packages" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/microsoft/msix-packaging" - description = "An SDK for creating MSIX packages" - topics = ("msix", "sdk", "packaging", "conan-recipe") + topics = ("sdk", "packaging", "conan-recipe") - settings = "os", "compiler", "build_type", "arch" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -22,7 +29,7 @@ class MsixConan(ConanFile): "skip_bundles": [True, False], "use_external_zlib": [True, False], "use_validation_parser": [True, False], - "xml_parser": ["applexml", "javaxml", "msxml6", "xerces"] + "with_xerces": [True, False], } default_options = { "shared": False, @@ -32,126 +39,134 @@ class MsixConan(ConanFile): "skip_bundles": False, "use_external_zlib": True, "use_validation_parser": False, - "xml_parser": "msxml6" + "with_xerces": False, } - generators = "cmake" - exports_sources = "CMakeLists.txt", "patches/**" - - _cmake = None + @property + def _min_cppstd(self): + return 14 @property - def _minimum_compilers_version(self): + def _compilers_minimum_version(self): return { - "Visual Studio": "15" + "apple-clang": "10", + "clang": "7", + "msvc": "191", + "Visual Studio": "15", } - @property - def _source_subfolder(self): - return "source_subfolder" - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - if self.settings.os == "Android": - self._cmake.definitions["AOSP"] = True - if self.settings.os == "Linux": - self._cmake.definitions["LINUX"] = True - if self.settings.os == "Macos": - self._cmake.definitions["MACOS"] = True - self._cmake.definitions["CRYPTO_LIB"] = self.options.crypto_lib - self._cmake.definitions["MSIX_PACK"] = self.options.pack - self._cmake.definitions["MSIX_SAMPLES"] = False - self._cmake.definitions["MSIX_TESTS"] = False - self._cmake.definitions["SKIP_BUNDLES"] = self.options.skip_bundles - self._cmake.definitions["USE_MSIX_SDK_ZLIB"] = self.options.use_external_zlib - self._cmake.definitions["USE_SHARED_ZLIB"] = self.options["zlib"].shared - self._cmake.definitions["USE_VALIDATION_PARSER"] = self.options.use_validation_parser - self._cmake.definitions["XML_PARSER"] = self.options.xml_parser - self._cmake.definitions["CALCULATE_VERSION"] = False - self._cmake.definitions["ENABLE_NUGET_PACKAGING"] = False - self._cmake.configure() - return self._cmake - - def _validate_compiler_settings(self): - compiler = self.settings.compiler - if compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "17") - - 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)) - elif 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 export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - self.options.crypto_lib = "crypt32" + if self.settings.os != "Windows": + del self.options.crypto_lib + if not is_apple_os(self) and self.settings.os not in ["Windows", "Android"]: + # with_xerces is required + del self.options.with_xerces def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - if self.settings.os == "Linux" and not self.options.skip_bundles: - self.requires("icu/71.1") - if self.options.crypto_lib == "openssl": - self.requires("openssl/1.1.1q") + if self.settings.os in ["Linux", "FreeBSD"] and not self.options.skip_bundles: + self.requires("icu/74.2") + if self.options.get_safe("crypto_lib", "openssl") == "openssl": + self.requires("openssl/[>=1.1 <4]") if self.options.use_external_zlib: - self.requires("zlib/1.2.12") - if self.options.xml_parser == "xerces": - self.requires("xerces-c/3.2.3") + self.requires("zlib/[>=1.2.11 <2]") + if self.options.get_safe("with_xerces", True): + self.requires("xerces-c/3.2.5") + + def _validate_compiler_settings(self): + compiler = self.settings.compiler + if compiler.get_safe("cppstd"): + 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." + ) def validate(self): - if self.settings.os != "Android" and self.options.xml_parser == "javaxml": - raise ConanInvalidConfiguration("javaxml is supported only for Android") - if self.settings.os == "Linux" and self.settings.compiler != "clang": - raise ConanInvalidConfiguration("Only clang is supported on Linux") - if self.settings.os != "Macos" and self.options.xml_parser == "applexml": - raise ConanInvalidConfiguration("applexml is supported only for MacOS") - if self.settings.os != "Windows" and self.options.crypto_lib == "crypt32": - raise ConanInvalidConfiguration("crypt32 is supported only for Windows") - if self.settings.os != "Windows" and self.options.xml_parser == "msxml6": - raise ConanInvalidConfiguration("msxml6 is supported only for Windows") + if self.settings.os in ["Linux", "FreeBSD"] and self.settings.compiler != "clang": + raise ConanInvalidConfiguration(f"Only clang is supported on {self.settings.os}") + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= "12" and self.version == "1.7": + # AppxPackaging.hpp:706:5: error: templates must have C++ linkage + raise ConanInvalidConfiguration("Clang 12 and newer are not supported") if self.options.pack: - if self.settings.os == "Macos": + if is_apple_os(self): if not self.options.use_external_zlib: raise ConanInvalidConfiguration("Using libCompression APIs and packaging features is not supported") - if self.options.xml_parser != "xerces": + if not self.options.get_safe("with_xerces", True): raise ConanInvalidConfiguration("Xerces is the only supported parser for MacOS pack") if not self.options.use_validation_parser: raise ConanInvalidConfiguration("Packaging requires validation parser") - if (self.options.xml_parser == "xerces" and - self.options["xerces-c"].char_type != "char16_t"): - raise ConanInvalidConfiguration("Only char16_t is supported for xerces-c") - + if self.options.get_safe("with_xerces", True) and self.dependencies["xerces-c"].options.char_type != "char16_t": + raise ConanInvalidConfiguration("Only char16_t is supported for xerces-c") + self._validate_compiler_settings() 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) + if self.settings.os == "Android": + tc.variables["AOSP"] = True + if self.settings.os in ["Linux", "FreeBSD"]: + tc.variables["LINUX"] = True + if is_apple_os(self): + tc.variables["MACOS"] = True + tc.variables["CRYPTO_LIB"] = self.options.get_safe("crypto_lib", "openssl") + tc.variables["MSIX_PACK"] = self.options.pack + tc.variables["MSIX_SAMPLES"] = False + tc.variables["MSIX_TESTS"] = False + tc.variables["SKIP_BUNDLES"] = self.options.skip_bundles + tc.variables["USE_MSIX_SDK_ZLIB"] = self.options.use_external_zlib + tc.variables["USE_VALIDATION_PARSER"] = self.options.use_validation_parser + if self.options.get_safe("with_xerces", True): + tc.variables["XML_PARSER"] = "xerces" + elif self.settings.os == "Android": + tc.variables["XML_PARSER"] = "javaxml" + elif is_apple_os(self): + tc.variables["XML_PARSER"] = "applexml" + elif self.settings.os == "Windows": + tc.variables["XML_PARSER"] = "msxml6" + tc.variables["CALCULATE_VERSION"] = False + tc.variables["ENABLE_NUGET_PACKAGING"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + tc = CMakeDeps(self) + 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): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) if self.settings.os == "Windows": - self.cpp_info.system_libs = ["runtimeobject"] - if self.settings.compiler == "Visual Studio": - self.cpp_info.system_libs.append("delayimp") - if self.options.crypto_lib == "crypt32": - self.cpp_info.system_libs.extend(["bcrypt", "crypt32", "wintrust"]) - if self.options.xml_parser == "msxml6": + # https://github.com/microsoft/msix-packaging/blob/v1.7/src/msix/CMakeLists.txt#L271 + self.cpp_info.system_libs.extend(["bcrypt", "crypt32", "wintrust", "runtimeobject", "delayimp"]) + if not self.options.with_xerces: self.cpp_info.system_libs.append("msxml6") + if is_apple_os(self): + # https://github.com/microsoft/msix-packaging/blob/v1.7/src/msix/CMakeLists.txt#L364 + self.cpp_info.frameworks.extend(["CoreFoundation", "Foundation"]) + if not self.options.use_external_zlib: + # https://github.com/microsoft/msix-packaging/blob/v1.7/src/msix/CMakeLists.txt#L285 + self.cpp_info.frameworks.append("Compression") diff --git a/recipes/msix/all/patches/1.7/001-fix-missing-include.patch b/recipes/msix/all/patches/1.7/001-fix-missing-include.patch new file mode 100644 index 0000000000000..60cdf07427a6c --- /dev/null +++ b/recipes/msix/all/patches/1.7/001-fix-missing-include.patch @@ -0,0 +1,11 @@ +Fixes https://github.com/microsoft/msix-packaging/issues/596 +--- src/inc/Encoding.hpp ++++ src/inc/Encoding.hpp +@@ -5,6 +5,7 @@ + #pragma once + ++#include + #include + + namespace MSIX { namespace Encoding { + diff --git a/recipes/msix/all/patches/1.7/cmake.patch b/recipes/msix/all/patches/1.7/cmake.patch index b64f3d1cd79c0..6f72f3b88aaf0 100644 --- a/recipes/msix/all/patches/1.7/cmake.patch +++ b/recipes/msix/all/patches/1.7/cmake.patch @@ -103,31 +103,29 @@ index 92b082e6..ebae9789 100644 +# define installing rules for target files +install(TARGETS ${PROJECT_NAME}) diff --git a/src/msix/CMakeLists.txt b/src/msix/CMakeLists.txt -index 75d3afdf..e1fb2984 100644 --- a/src/msix/CMakeLists.txt +++ b/src/msix/CMakeLists.txt -@@ -6,6 +6,11 @@ cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR) +@@ -5,6 +5,11 @@ + cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR) project(msix) - ++ +# Define the library +add_library(${PROJECT_NAME} + msix.cpp +) -+ + # Handle exports and flags we need to set list(APPEND MSIX_UNPACK_EXPORTS - "UnpackPackage" -@@ -144,7 +149,7 @@ if(NOT SKIP_BUNDLES) - if (WIN32) +@@ -145,6 +150,7 @@ list(APPEND MsixSrc PAL/Applicability/Win32/Applicability.cpp) elseif(LINUX) -- find_package(ICU REQUIRED COMPONENTS uc) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::icu) + find_package(ICU REQUIRED COMPONENTS uc) ++ target_link_libraries(${PROJECT_NAME} PRIVATE ICU::uc) list(APPEND MsixSrc PAL/Applicability/Linux/Applicability.cpp) elseif(AOSP) list(APPEND MsixSrc PAL/Applicability/AOSP/Applicability.cpp) -@@ -195,14 +200,16 @@ if(CRYPTO_LIB MATCHES crypt32) +@@ -195,14 +201,17 @@ PAL/Signature/Win32/SignatureValidator.cpp ) elseif(CRYPTO_LIB MATCHES openssl) @@ -136,22 +134,23 @@ index 75d3afdf..e1fb2984 100644 - PAL/Crypto/OpenSSL/Crypto.cpp - PAL/Signature/OpenSSL/SignatureValidator.cpp - ) ++ find_package(OpenSSL REQUIRED CONFIG) + list(APPEND MsixSrc + PAL/Crypto/OpenSSL/Crypto.cpp + PAL/Signature/OpenSSL/SignatureValidator.cpp + ) + if((IOS) OR (MACOS)) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::openssl -Wl,-dead_strip) ++ target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::SSL -Wl,-dead_strip) + elseif(NOT MSVC) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::openssl -Wl,--gc-sections) ++ target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::SSL -Wl,--gc-sections) else() - # ... and were done here... :/ - message(FATAL_ERROR "OpenSSL NOT FOUND!") -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::openssl) ++ target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::SSL) endif() endif() -@@ -220,14 +227,7 @@ foreach(FILE ${MsixSrc}) +@@ -220,14 +229,7 @@ message(STATUS "\t${FILE}") endforeach() @@ -167,7 +166,7 @@ index 75d3afdf..e1fb2984 100644 # Copy out public headers to /src/unpack configure_file(../inc/MSIXWindows.hpp ${CMAKE_CURRENT_BINARY_DIR}/MSIXWindows.hpp ) -@@ -260,7 +260,7 @@ if(WIN32) +@@ -260,7 +262,7 @@ "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll") string(REPLACE ";" " " DELAYFLAGS "${DELAYFLAGS}") set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS "${DELAYFLAGS} /LTCG") @@ -176,48 +175,44 @@ index 75d3afdf..e1fb2984 100644 if(USE_STATIC_MSVC) if(CMAKE_BUILD_TYPE MATCHES Debug) set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS " /NODEFAULTLIB:MSVCRTD") -@@ -285,29 +285,20 @@ if(((IOS) OR (MACOS)) AND (NOT USE_MSIX_SDK_ZLIB)) - target_link_libraries(${PROJECT_NAME} PRIVATE libcompression.dylib) - elseif((AOSP) AND (NOT USE_MSIX_SDK_ZLIB)) - # for AOSP, use the libz.so from the android ndk. -- find_package(ZLIB REQUIRED) +@@ -288,17 +290,8 @@ + find_package(ZLIB REQUIRED) target_link_libraries(${PROJECT_NAME} PRIVATE -lz) --else() # WIN32 or USE_MSIX_SDK_ZLIB + else() # WIN32 or USE_MSIX_SDK_ZLIB - target_include_directories(${PROJECT_NAME} PRIVATE - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/zlib - ${MSIX_PROJECT_ROOT}/lib/zlib - ) -+else() - if(USE_SHARED_ZLIB) - message(STATUS "MSIX takes a dynamic dependency on zlib") +- if(USE_SHARED_ZLIB) +- message(STATUS "MSIX takes a dynamic dependency on zlib") - target_link_libraries(${PROJECT_NAME} PRIVATE zlib) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::zlib) - else() - message(STATUS "MSIX takes a static dependency on zlib") +- else() +- message(STATUS "MSIX takes a static dependency on zlib") - target_link_libraries(${PROJECT_NAME} PRIVATE zlibstatic) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::zlib) - endif() +- endif() ++ find_package(ZLIB REQUIRED CONFIG) ++ target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB) endif() # Parser - if(XML_PARSER MATCHES xerces) -- target_include_directories(${PROJECT_NAME} PRIVATE -- ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/xerces/src -- ${MSIX_PROJECT_ROOT}/lib/xerces/src -- ) +@@ -307,7 +299,8 @@ + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/xerces/src + ${MSIX_PROJECT_ROOT}/lib/xerces/src + ) - target_link_libraries(${PROJECT_NAME} PRIVATE xerces-c) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::xerces-c) ++ find_package(XercesC REQUIRED CONFIG) ++ target_link_libraries(${PROJECT_NAME} PRIVATE XercesC::XercesC) endif() if(XML_PARSER MATCHES applexml) -@@ -363,18 +354,6 @@ endif() +@@ -363,18 +356,6 @@ if((IOS) OR (MACOS)) target_link_libraries(${PROJECT_NAME} PRIVATE ${COREFOUNDATION_LIBRARY} ${FOUNDATION_LIBRARY}) endif() -if(LINUX) - target_link_libraries(${PROJECT_NAME} PRIVATE ${ICU_LIBRARIES}) -endif() - +- -if(OpenSSL_FOUND) - # include the libraries needed to use OpenSSL - target_include_directories(${PROJECT_NAME} PRIVATE ${OpenSSL_INCLUDE_PATH}) @@ -229,5 +224,6 @@ index 75d3afdf..e1fb2984 100644 - target_link_libraries(${PROJECT_NAME} PRIVATE crypto) - endif() -endif() ++ +# define installing rules for target files +install(TARGETS ${PROJECT_NAME}) diff --git a/recipes/msix/all/patches/1.7/signaturevalidator.patch b/recipes/msix/all/patches/1.7/signaturevalidator.patch index bc8cdf9e699db..06071e85ee658 100644 --- a/recipes/msix/all/patches/1.7/signaturevalidator.patch +++ b/recipes/msix/all/patches/1.7/signaturevalidator.patch @@ -22,7 +22,7 @@ index 1cc34b20..ccbf68dc 100644 if (!X509V3_EXT_print(extbio.get(), ext, 0, 0)) { - M_ASN1_OCTET_STRING_print(extbio.get(), ext->value); -+ M_ASN1_OCTET_STRING_print(extbio.get(), X509_EXTENSION_get_data(ext)); ++ ASN1_STRING_print(extbio.get(), X509_EXTENSION_get_data(ext)); } // null terminate the string. BIO_write(extbio.get(), "", 1); diff --git a/recipes/msix/all/test_package/CMakeLists.txt b/recipes/msix/all/test_package/CMakeLists.txt index e28b2e2b66dd9..5ad357dd7587a 100644 --- a/recipes/msix/all/test_package/CMakeLists.txt +++ b/recipes/msix/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(TARGETS) +find_package(msix REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.cpp) - -conan_target_link_libraries(${PROJECT_NAME}) +target_link_libraries(${PROJECT_NAME} PRIVATE msix::msix) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/msix/all/test_package/conanfile.py b/recipes/msix/all/test_package/conanfile.py index bee328a3e1aa7..ef5d7042163ec 100644 --- a/recipes/msix/all/test_package/conanfile.py +++ b/recipes/msix/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 MsixTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def 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/msix/all/test_v1_package/CMakeLists.txt b/recipes/msix/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/msix/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/msix/all/test_v1_package/conanfile.py b/recipes/msix/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..28b18e54620ea --- /dev/null +++ b/recipes/msix/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class MsixTestConan(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/msys2/all/conanfile.py b/recipes/msys2/all/conanfile.py index 2606f171ddcec..752c04acf11c3 100644 --- a/recipes/msys2/all/conanfile.py +++ b/recipes/msys2/all/conanfile.py @@ -156,8 +156,9 @@ def _do_build(self): os.utime(tmp_name, None) # Prepend the PKG_CONFIG_PATH environment variable with an eventual PKG_CONFIG_PATH environment variable + # Note: this is no longer needed when we exclusively support Conan 2 integrations replace_in_file(self, os.path.join(self._msys_dir, "etc", "profile"), - 'PKG_CONFIG_PATH="', 'PKG_CONFIG_PATH="$PKG_CONFIG_PATH:') + 'PKG_CONFIG_PATH="', 'PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}:}') def package(self): excludes = None diff --git a/recipes/mujs/all/conandata.yml b/recipes/mujs/all/conandata.yml index 3a69126dc4af3..eb2092fbfdd74 100644 --- a/recipes/mujs/all/conandata.yml +++ b/recipes/mujs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.5": + url: "https://mujs.com/downloads/mujs-1.3.5.tar.gz" + sha256: "78a311ae4224400774cb09ef5baa2633c26971513f8b931d3224a0eb85b13e0b" "1.3.4": url: "https://mujs.com/downloads/mujs-1.3.4.tar.gz" sha256: "c015475880f6a382e706169c94371a7dd6cc22078832f6e0865af8289c2ef42b" diff --git a/recipes/mujs/all/conanfile.py b/recipes/mujs/all/conanfile.py index 4d4b59f453109..9a9dbc2ba3805 100644 --- a/recipes/mujs/all/conanfile.py +++ b/recipes/mujs/all/conanfile.py @@ -11,10 +11,9 @@ class MujsConan(ConanFile): description = "MuJS is a lightweight Javascript interpreter designed for " \ "embedding in other software to extend them with scripting capabilities." license = "ISC" - topics = ("interpreter", "javascript") - homepage = "https://mujs.com" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://mujs.com" + topics = ("interpreter", "javascript") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { diff --git a/recipes/mujs/config.yml b/recipes/mujs/config.yml index f0766a7d62e0c..233cb2080473e 100644 --- a/recipes/mujs/config.yml +++ b/recipes/mujs/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.5": + folder: all "1.3.4": folder: all "1.1.2": diff --git a/recipes/ncurses/all/conandata.yml b/recipes/ncurses/all/conandata.yml index fc77450ebeca3..6777bbc70de06 100644 --- a/recipes/ncurses/all/conandata.yml +++ b/recipes/ncurses/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "6.5": + url: + - "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.5.tar.gz" + - "https://invisible-mirror.net/archives/ncurses/ncurses-6.5.tar.gz" + sha256: "136d91bc269a9a5785e5f9e980bc76ab57428f604ce3e5a5a90cebc767971cc6" "6.4": url: - "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.4.tar.gz" @@ -9,46 +14,3 @@ sources: - "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.3.tar.gz" - "https://invisible-mirror.net/archives/ncurses/ncurses-6.3.tar.gz" sha256: "97fc51ac2b085d4cde31ef4d2c3122c21abc217e9090a43a30fc5ec21684e059" - "6.2": - url: - - "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.2.tar.gz" - - "https://invisible-mirror.net/archives/ncurses/ncurses-6.2.tar.gz" - sha256: "30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d" -patches: - "6.2": - - patch_file: "patches/6.2.0-0001-Look-for-pcre2posix-instead-of-pcre2-posix.h.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0002-Optionally-include-sys-time.h.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0003-Do-not-redeclare-exit.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0004-fix-win32con.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0005-api-must-be-placed-next-to-variable-name.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0006-Add-potentially-missing-STDOUT_FILENO.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0007-No-import-export-declaration-on-class-members.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0008-Add-include-file-to-add-export-annotation.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0010-Pass-BUILDING_XXX-compile-definition-while-building-.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0011-Let-each-sublibrary-do-its-own-import-exporting.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0012-Learn-configure-about-msvc.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0013-Fix-lib_gen.c.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0014-avoid-macro-expansion-in-args-by-defining-NCURSES_NO.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0015-MSVC-access-does-not-support-X_OK.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0016-msvc-has-wchar-support.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0017-msvc-fix-tests.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0018-missing-functions-c-linkage.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0019-Run-autoreconf.patch" - patch_type: "portability" diff --git a/recipes/ncurses/all/patches/6.2.0-0001-Look-for-pcre2posix-instead-of-pcre2-posix.h.patch b/recipes/ncurses/all/patches/6.2.0-0001-Look-for-pcre2posix-instead-of-pcre2-posix.h.patch deleted file mode 100644 index c9d1dc8e8178a..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0001-Look-for-pcre2posix-instead-of-pcre2-posix.h.patch +++ /dev/null @@ -1,59 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From 7699b26096801fe462233ecb86484bdc3a2f0beb Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:22:08 +0100 -Subject: [PATCH 01/15] Look for pcre2posix instead of pcre2-posix.h - ---- - aclocal.m4 | 2 +- - form/fty_regex.c | 4 ++-- - include/ncurses_defs | 2 +- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/aclocal.m4 b/aclocal.m4 -index c27cc368..e6ccc42f 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -8506,7 +8506,7 @@ if test "x$with_pcre2" != xno ; then - esac - - # either way, check for the library header files -- AC_CHECK_HEADERS(pcre2-posix.h pcreposix.h) -+ AC_CHECK_HEADERS(pcre2posix.h pcreposix.h) - fi - ])dnl - dnl --------------------------------------------------------------------------- -diff --git a/form/fty_regex.c b/form/fty_regex.c -index da0ef08c..d1daf714 100644 ---- a/form/fty_regex.c -+++ b/form/fty_regex.c -@@ -39,8 +39,8 @@ MODULE_ID("$Id: fty_regex.c,v 1.28 2020/02/02 23:34:34 tom Exp $") - - #if HAVE_REGEX_H_FUNCS || HAVE_LIB_PCRE2 /* We prefer POSIX regex */ - --#if HAVE_PCRE2_POSIX_H --#include -+#if HAVE_PCRE2POSIX_H -+#include - #elif HAVE_PCREPOSIX_H - #include - #else -diff --git a/include/ncurses_defs b/include/ncurses_defs -index e37fc901..a0339457 100644 ---- a/include/ncurses_defs -+++ b/include/ncurses_defs -@@ -120,7 +120,7 @@ HAVE_NANOSLEEP - HAVE_NC_ALLOC_H - HAVE_NEWPAD 1 - HAVE_PANEL_H --HAVE_PCRE2_POSIX_H -+HAVE_PCRE2POSIX_H - HAVE_PCREPOSIX_H - HAVE_POLL - HAVE_POLL_H --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0002-Optionally-include-sys-time.h.patch b/recipes/ncurses/all/patches/6.2.0-0002-Optionally-include-sys-time.h.patch deleted file mode 100644 index b8cb861a2599a..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0002-Optionally-include-sys-time.h.patch +++ /dev/null @@ -1,51 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From 3737faf9325859a33d8288337c312fb9ad5b3e02 Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:24:34 +0100 -Subject: [PATCH 02/15] Optionally include sys/time.h - ---- - include/nc_mingw.h | 2 ++ - ncurses/tty/lib_twait.c | 2 +- - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/include/nc_mingw.h b/include/nc_mingw.h -index 68a41849..b47bb2cf 100644 ---- a/include/nc_mingw.h -+++ b/include/nc_mingw.h -@@ -52,10 +52,16 @@ - #undef gettimeofday - #define gettimeofday(tv,tz) _nc_gettimeofday(tv,tz) - -+#if HAVE_SYS_TIME_H - #include /* for struct timeval */ -+#endif - -+#ifdef _MSC_VER -+#include /* for struct timeval */ -+#endif -+ - extern int _nc_gettimeofday(struct timeval *, void *); - - #undef HAVE_GETTIMEOFDAY - #define HAVE_GETTIMEOFDAY 1 - -diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c -index 3ab168dd..74d267c7 100644 ---- a/ncurses/tty/lib_twait.c -+++ b/ncurses/tty/lib_twait.c -@@ -71,7 +71,7 @@ - # include - # endif - #endif --#ifdef _WIN32 -+#if HAVE_SYS_TIME_H - # include - #endif - #undef CUR --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0003-Do-not-redeclare-exit.patch b/recipes/ncurses/all/patches/6.2.0-0003-Do-not-redeclare-exit.patch deleted file mode 100644 index 758bbc562ec77..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0003-Do-not-redeclare-exit.patch +++ /dev/null @@ -1,28 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From 8e12095e0af72dd9414fcdb35831f585d5b8d67e Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:25:00 +0100 -Subject: [PATCH 03/15] Do not redeclare exit - ---- - c++/etip.h.in | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/c++/etip.h.in b/c++/etip.h.in -index 9334f9d3..1155c5fd 100644 ---- a/c++/etip.h.in -+++ b/c++/etip.h.in -@@ -341,7 +341,6 @@ using std::endl; - # else - # include - # endif -- extern "C" void exit(int); - #endif - - inline void THROW(const NCursesException *e) { --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0004-fix-win32con.patch b/recipes/ncurses/all/patches/6.2.0-0004-fix-win32con.patch deleted file mode 100644 index 4af53ed568c0d..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0004-fix-win32con.patch +++ /dev/null @@ -1,91 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From 5cb87b2244c1e944e13478b7bb98d0984b7dfdf7 Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:25:57 +0100 -Subject: [PATCH 04/15] fix win32con ---- - ncurses/win32con/gettimeofday.c | 4 ++++ - ncurses/win32con/win_driver.c | 14 +++++++------- - 2 files changed, 11 insertions(+), 7 deletions(-) - -diff --git a/ncurses/win32con/gettimeofday.c b/ncurses/win32con/gettimeofday.c -index 8fad9a62..319937c6 100644 ---- a/ncurses/win32con/gettimeofday.c -+++ b/ncurses/win32con/gettimeofday.c -@@ -40,6 +40,10 @@ MODULE_ID("$Id: gettimeofday.c,v 1.4 2020/02/02 23:34:34 tom Exp $") - - #define JAN1970 116444736000000000LL /* the value for 01/01/1970 00:00 */ - -+#ifdef _MSC_VER -+#include -+#endif -+ - int - gettimeofday(struct timeval *tv, void *tz GCC_UNUSED) - { -diff --git a/ncurses/win32con/win_driver.c b/ncurses/win32con/win_driver.c -index 280aa6dc..1bd45bb7 100644 ---- a/ncurses/win32con/win_driver.c -+++ b/ncurses/win32con/win_driver.c -@@ -58,7 +58,7 @@ - MODULE_ID("$Id: win_driver.c,v 1.63 2020/02/02 23:34:34 tom Exp $") - - #ifndef __GNUC__ --# error We need GCC to compile for MinGW -+//# error We need GCC to compile for MinGW - #endif - - #define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) -@@ -262,7 +262,7 @@ static BOOL - con_write16(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, cchar_t *str, int limit) - { - int actual = 0; -- CHAR_INFO ci[limit]; -+ CHAR_INFO * ci = (CHAR_INFO*) _alloca(sizeof(CHAR_INFO) * limit); - COORD loc, siz; - SMALL_RECT rec; - int i; -@@ -311,7 +311,7 @@ con_write16(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, cchar_t *str, int limit) - static BOOL - con_write8(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, chtype *str, int n) - { -- CHAR_INFO ci[n]; -+ CHAR_INFO * ci = (CHAR_INFO*) _alloca(sizeof(CHAR_INFO) * n); - COORD loc, siz; - SMALL_RECT rec; - int i; -@@ -510,7 +510,7 @@ wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB) - if ((CurScreen(sp)->_clear || NewScreen(sp)->_clear)) { - int x; - #if USE_WIDEC_SUPPORT -- cchar_t empty[Width]; -+ cchar_t * empty = (cchar_t*) _alloca(sizeof(cchar_t) * Width); - wchar_t blank[2] = - { - L' ', L'\0' -@@ -519,7 +519,7 @@ wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB) - for (x = 0; x < Width; x++) - setcchar(&empty[x], blank, 0, 0, 0); - #else -- chtype empty[Width]; -+ chtype * empty = (chtype*) _alloca(sizeof(chtype) * Width); - - for (x = 0; x < Width; x++) - empty[x] = ' '; -@@ -675,8 +675,8 @@ wcon_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, - int max_cells = (high * wide); - int i; - -- CHAR_INFO this_screen[max_cells]; -- CHAR_INFO that_screen[max_cells]; -+ CHAR_INFO * this_screen = (CHAR_INFO*) _alloca(sizeof(CHAR_INFO) * max_cells); -+ CHAR_INFO * that_screen = (CHAR_INFO*) _alloca(sizeof(CHAR_INFO) * max_cells); - COORD this_size; - SMALL_RECT this_region; - COORD bufferCoord; --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0005-api-must-be-placed-next-to-variable-name.patch b/recipes/ncurses/all/patches/6.2.0-0005-api-must-be-placed-next-to-variable-name.patch deleted file mode 100644 index 9d34795fa33af..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0005-api-must-be-placed-next-to-variable-name.patch +++ /dev/null @@ -1,45 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From c225d0ccd87b45fbaf92a4b048887f8f136cedcd Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:26:55 +0100 -Subject: [PATCH 05/15] api must be placed next to variable name - ---- - include/term_entry.h | 4 ++-- - ncurses/tinfo/comp_parse.c | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/include/term_entry.h b/include/term_entry.h -index df13f53f..c4702012 100644 ---- a/include/term_entry.h -+++ b/include/term_entry.h -@@ -200,8 +200,8 @@ extern NCURSES_EXPORT(bool) _nc_entry_match (char *, char *); - extern NCURSES_EXPORT(int) _nc_resolve_uses (bool); /* obs 20040705 */ - extern NCURSES_EXPORT(int) _nc_resolve_uses2 (bool, bool); - extern NCURSES_EXPORT(void) _nc_free_entries (ENTRY *); --extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype)(TERMTYPE *); /* obs 20040705 */ --extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype2)(TERMTYPE2 *, bool); -+extern NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype)(TERMTYPE *); /* obs 20040705 */ -+extern NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2)(TERMTYPE2 *, bool); - - /* trace_xnames.c */ - extern NCURSES_EXPORT(void) _nc_trace_xnames (TERMTYPE *); -diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c -index ab25d5b1..d320129e 100644 ---- a/ncurses/tinfo/comp_parse.c -+++ b/ncurses/tinfo/comp_parse.c -@@ -51,7 +51,7 @@ - MODULE_ID("$Id: comp_parse.c,v 1.109 2020/02/02 23:34:34 tom Exp $") - - static void sanity_check2(TERMTYPE2 *, bool); --NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2; -+NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2; - - static void fixup_acsc(TERMTYPE2 *, int); - --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0006-Add-potentially-missing-STDOUT_FILENO.patch b/recipes/ncurses/all/patches/6.2.0-0006-Add-potentially-missing-STDOUT_FILENO.patch deleted file mode 100644 index 60a2039b3f9e1..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0006-Add-potentially-missing-STDOUT_FILENO.patch +++ /dev/null @@ -1,31 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From 536b8ba02682dcf367efba46b9616a9695341797 Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:27:22 +0100 -Subject: [PATCH 06/15] Add potentially missing STDOUT_FILENO - ---- - progs/progs.priv.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/progs/progs.priv.h b/progs/progs.priv.h -index da7a5154..4734e740 100644 ---- a/progs/progs.priv.h -+++ b/progs/progs.priv.h -@@ -155,6 +155,10 @@ extern int optind; - #endif /* gcc workarounds */ - - /* usually in */ -+#ifndef STDIN_FILENO -+#define STDIN_FILENO 0 -+#endif -+ - #ifndef STDOUT_FILENO - #define STDOUT_FILENO 1 - #endif --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0007-No-import-export-declaration-on-class-members.patch b/recipes/ncurses/all/patches/6.2.0-0007-No-import-export-declaration-on-class-members.patch deleted file mode 100644 index ef00f1218a927..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0007-No-import-export-declaration-on-class-members.patch +++ /dev/null @@ -1,53 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From ff6bd063127225360332a938ed8e6babd90d9798 Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:28:30 +0100 -Subject: [PATCH 07/15] No import/export declaration on class members - ---- - c++/cursslk.h | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/c++/cursslk.h b/c++/cursslk.h -index 5a7b78c3..10364c1d 100644 ---- a/c++/cursslk.h -+++ b/c++/cursslk.h -@@ -101,10 +101,10 @@ public: - } Label_Layout; - - private: -- static long NCURSES_IMPEXP count; // Number of Key Sets -- static Label_Layout NCURSES_IMPEXP format; // Layout of the Key Sets -- static int NCURSES_IMPEXP num_labels; // Number Of Labels in Key Sets -- bool NCURSES_IMPEXP b_attrInit; // Are attributes initialized -+ static long count; // Number of Key Sets -+ static Label_Layout format; // Layout of the Key Sets -+ static int num_labels; // Number Of Labels in Key Sets -+ bool b_attrInit; // Are attributes initialized - - Soft_Label_Key *slk_array; // The array of SLK's - -@@ -144,7 +144,7 @@ public: - - // This constructor assumes, that you already constructed a Key Set - // with a layout by the constructor above. This layout will be reused. -- NCURSES_IMPEXP Soft_Label_Key_Set(); -+ Soft_Label_Key_Set(); - - Soft_Label_Key_Set& operator=(const Soft_Label_Key_Set& rhs) - { -@@ -165,7 +165,7 @@ public: - virtual ~Soft_Label_Key_Set() THROWS(NCursesException); - - // Get Label# i. Label counting starts with 1! -- NCURSES_IMPEXP Soft_Label_Key& operator[](int i); -+ Soft_Label_Key& operator[](int i); - - // Retrieve number of Labels - inline int labels() const { return num_labels; } --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0008-Add-include-file-to-add-export-annotation.patch b/recipes/ncurses/all/patches/6.2.0-0008-Add-include-file-to-add-export-annotation.patch deleted file mode 100644 index d29108c2fbbb7..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0008-Add-include-file-to-add-export-annotation.patch +++ /dev/null @@ -1,100 +0,0 @@ -Upstreamed in 3e37c7d3fa122563a9d88168926f61286ef30cd3 - -ncurses 6.2 - patch 20200523 - -this patch differs with upstream: -upstream has integrated this fine in ncurses_dll.h.in (instead of creating a new file) -This change is small, so don't care. - -From ffcd8b69aa8346e94aceefdc4593ad74635708f9 Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Sat, 14 Mar 2020 12:38:41 +0100 -Subject: [PATCH 08/15] Add include file to add export annotation - ---- - configure.in | 1 + - include/headers | 1 + - include/ncurses_exports.h.in | 47 ++++++++++++++++++++++++++++++++++++ - 3 files changed, 49 insertions(+) - create mode 100644 include/ncurses_exports.h.in - -diff --git a/configure.in b/configure.in -index 2183a978..fc00f9dc 100644 ---- a/configure.in -+++ b/configure.in -@@ -2395,6 +2395,7 @@ AC_OUTPUT( \ - include/MKterm.h.awk \ - include/curses.head:include/curses.h.in \ - include/ncurses_dll.h \ -+ include/ncurses_exports.h \ - include/termcap.h \ - include/unctrl.h \ - $SUB_MAKEFILES \ -diff --git a/include/headers b/include/headers -index dbb134d1..e20798b4 100644 ---- a/include/headers -+++ b/include/headers -@@ -33,6 +33,7 @@ - curses.h - unctrl.h - ncurses_dll.h -+ncurses_exports.h - - # Support for termcap (and tic, etc.), which can be a separate library - @ termlib -diff --git a/include/ncurses_exports.h.in b/include/ncurses_exports.h.in -new file mode 100644 -index 00000000..252f5021 ---- /dev/null -+++ b/include/ncurses_exports.h.in -@@ -0,0 +1,47 @@ -+/**************************************************************************** -+ * Copyright 2020 Thomas E. Dickey * -+ * * -+ * Permission is hereby granted, free of charge, to any person obtaining a * -+ * copy of this software and associated documentation files (the * -+ * "Software"), to deal in the Software without restriction, including * -+ * without limitation the rights to use, copy, modify, merge, publish, * -+ * distribute, distribute with modifications, sublicense, and/or sell * -+ * copies of the Software, and to permit persons to whom the Software is * -+ * furnished to do so, subject to the following conditions: * -+ * * -+ * The above copyright notice and this permission notice shall be included * -+ * in all copies or substantial portions of the Software. * -+ * * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * -+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * -+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * -+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * -+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * -+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * -+ * * -+ * Except as contained in this notice, the name(s) of the above copyright * -+ * holders shall not be used in advertising or otherwise to promote the * -+ * sale, use or other dealings in this Software without prior written * -+ * authorization. * -+ ****************************************************************************/ -+/* $Id: ncurses_exports.h.in,v 1.13 2020/02/29 21:53:14 tom Exp $ */ -+ -+#ifndef NCURSES_EXPORTS_H_incl -+#define NCURSES_EXPORTS_H_incl 1 -+ -+#if defined(__CYGWIN__) || defined(_WIN32) -+# if defined(NCURSES_DLL) -+# define NCURSES_EXPORT __declspec(dllexport) -+# elif !defined(NCURSES_STATIC) -+# define NCURSES_EXPORT __declspec(dllimport) -+# else -+# define NCURSES_EXPORT -+# endif -+#endif -+ -+#if !defined(NCURSES_EXPORT) -+# define NCURSES_EXPORT @NCURSES_EXPORT@ -+#endif -+ -+#endif /* NCURSES_EXPORTS_H_incl */ --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0010-Pass-BUILDING_XXX-compile-definition-while-building-.patch b/recipes/ncurses/all/patches/6.2.0-0010-Pass-BUILDING_XXX-compile-definition-while-building-.patch deleted file mode 100644 index ffa1320f610fb..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0010-Pass-BUILDING_XXX-compile-definition-while-building-.patch +++ /dev/null @@ -1,242 +0,0 @@ -Upstreamed in 04d942c3d98cf0a929c6afb17be8c10d4ae39af0 - -ncurses 6.2 - patch 20200704 - -From ed3ad1962ab885b9a9c6e6a3437eb6db274110b5 Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Sat, 14 Mar 2020 14:15:41 +0100 -Subject: [PATCH 10/15] Pass BUILDING_XXX compile definition while building - library XXX - ---- - c++/Makefile.in | 6 ++--- - form/Makefile.in | 6 ++--- - include/ncurses_dll.h.in | 49 ++++++------------------------------ - include/ncurses_exports.h.in | 23 +++++++++-------- - menu/Makefile.in | 6 ++--- - ncurses/Makefile.in | 8 +++--- - panel/Makefile.in | 6 ++--- - 7 files changed, 35 insertions(+), 69 deletions(-) - -diff --git a/c++/Makefile.in b/c++/Makefile.in -index 9b22b6ac..17b3e069 100644 ---- a/c++/Makefile.in -+++ b/c++/Makefile.in -@@ -89,7 +89,7 @@ CXXFLAGS = @CXXFLAGS@ @EXTRA_CXXFLAGS@ - CXXLIBS = @CXXLIBS@ - - INCDIR = ../include --CPPFLAGS = -DHAVE_CONFIG_H -I../c++ @CPPFLAGS@ -+CPPFLAGS = -DHAVE_CONFIG_H -DBUILDING_NCURSES_CXX -I../c++ @CPPFLAGS@ - - CTAGS = @CTAGS@ - ETAGS = @ETAGS@ -@@ -97,8 +97,8 @@ ETAGS = @ETAGS@ - CC = ${CXX} - CCFLAGS = $(CPPFLAGS) $(CXXFLAGS) - --CFLAGS_LIBTOOL = $(CCFLAGS) --CFLAGS_NORMAL = $(CCFLAGS) -+CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC -+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC - CFLAGS_DEBUG = $(CCFLAGS) @CXX_G_OPT@ -DTRACE - CFLAGS_PROFILE = $(CCFLAGS) -pg - CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ -diff --git a/form/Makefile.in b/form/Makefile.in -index 3e5be8da..34bfd172 100644 ---- a/form/Makefile.in -+++ b/form/Makefile.in -@@ -92,12 +92,12 @@ CC = @CC@ - CPP = @CPP@ - CFLAGS = @CFLAGS@ - --CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -+CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -DBUILDING_FORM - - CCFLAGS = $(CPPFLAGS) $(CFLAGS) - --CFLAGS_LIBTOOL = $(CCFLAGS) --CFLAGS_NORMAL = $(CCFLAGS) -+CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC -+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC - CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE - CFLAGS_PROFILE = $(CCFLAGS) -pg - CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ -diff --git a/include/ncurses_dll.h.in b/include/ncurses_dll.h.in -index f439d480..568112e2 100644 ---- a/include/ncurses_dll.h.in -+++ b/include/ncurses_dll.h.in -@@ -68,50 +68,15 @@ - #define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name - #define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void) - --/* no longer needed on cygwin or mingw, thanks to auto-import */ --/* but this structure may be useful at some point for an MSVC build */ --/* so, for now unconditionally define the important flags */ --/* "the right way" for proper static and dll+auto-import behavior */ --#undef NCURSES_DLL --#define NCURSES_STATIC -+#include "ncurses_exports.h" - --#if defined(__CYGWIN__) || defined(_WIN32) --# if defined(NCURSES_DLL) --# if defined(NCURSES_STATIC) --# undef NCURSES_STATIC --# endif --# endif --# undef NCURSES_IMPEXP --# undef NCURSES_API --# undef NCURSES_EXPORT --# undef NCURSES_EXPORT_VAR --# if defined(NCURSES_DLL) --/* building a DLL */ --# define NCURSES_IMPEXP __declspec(dllexport) --# elif defined(NCURSES_STATIC) --/* building or linking to a static library */ --# define NCURSES_IMPEXP /* nothing */ --# else --/* linking to the DLL */ --# define NCURSES_IMPEXP __declspec(dllimport) --# endif --# define NCURSES_API __cdecl --# define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API --# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type -+#if defined(BUILDING_NCURSES) -+# define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT -+#else -+# define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT - #endif - --/* Take care of non-cygwin platforms */ --#if !defined(NCURSES_IMPEXP) --# define NCURSES_IMPEXP /* nothing */ --#endif --#if !defined(NCURSES_API) --# define NCURSES_API /* nothing */ --#endif --#if !defined(NCURSES_EXPORT) --# define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API --#endif --#if !defined(NCURSES_EXPORT_VAR) --# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type --#endif -+#define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API -+#define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type - - #endif /* NCURSES_DLL_H_incl */ -diff --git a/include/ncurses_exports.h.in b/include/ncurses_exports.h.in -index 252f5021..61655f65 100644 ---- a/include/ncurses_exports.h.in -+++ b/include/ncurses_exports.h.in -@@ -31,17 +31,18 @@ - #define NCURSES_EXPORTS_H_incl 1 - - #if defined(__CYGWIN__) || defined(_WIN32) --# if defined(NCURSES_DLL) --# define NCURSES_EXPORT __declspec(dllexport) --# elif !defined(NCURSES_STATIC) --# define NCURSES_EXPORT __declspec(dllimport) --# else --# define NCURSES_EXPORT --# endif --#endif -- --#if !defined(NCURSES_EXPORT) --# define NCURSES_EXPORT @NCURSES_EXPORT@ -+# if defined(NCURSES_STATIC) -+# define NCURSES_EXPORT_GENERAL_IMPORT -+# define NCURSES_EXPORT_GENERAL_EXPORT -+# else -+# define NCURSES_EXPORT_GENERAL_IMPORT __declspec(dllimport) -+# define NCURSES_EXPORT_GENERAL_EXPORT __declspec(dllexport) -+# endif -+# define NCURSES_API __cdecl -+#else -+# define NCURSES_EXPORT_GENERAL_IMPORT -+# define NCURSES_EXPORT_GENERAL_EXPORT -+# define NCURSES_API /* FIXME: __attribute__ ((cdecl)) is only available on x86 */ - #endif - - #endif /* NCURSES_EXPORTS_H_incl */ -diff --git a/menu/Makefile.in b/menu/Makefile.in -index 495651c2..bf153602 100644 ---- a/menu/Makefile.in -+++ b/menu/Makefile.in -@@ -92,12 +92,12 @@ CC = @CC@ - CPP = @CPP@ - CFLAGS = @CFLAGS@ - --CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -+CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -DBUILDING_MENU - - CCFLAGS = $(CPPFLAGS) $(CFLAGS) - --CFLAGS_LIBTOOL = $(CCFLAGS) --CFLAGS_NORMAL = $(CCFLAGS) -+CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC -+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC - CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE - CFLAGS_PROFILE = $(CCFLAGS) -pg - CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ -diff --git a/ncurses/Makefile.in b/ncurses/Makefile.in -index b2420788..00129d0b 100644 ---- a/ncurses/Makefile.in -+++ b/ncurses/Makefile.in -@@ -102,11 +102,11 @@ CPP = @CPP@ - CFLAGS = @CFLAGS@ - - INCDIR = $(srcdir)/../include --CPPFLAGS = -DHAVE_CONFIG_H -I../ncurses @CPPFLAGS@ -+CPPFLAGS = -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses @CPPFLAGS@ - - CCFLAGS = $(CPPFLAGS) $(CFLAGS) - --BUILD_CPPFLAGS = -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I$(srcdir) -I../include -I$(INCDIR) @BUILD_CPPFLAGS@ -+BUILD_CPPFLAGS = -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I$(srcdir) -I../include -I$(INCDIR) @BUILD_CPPFLAGS@ - BUILD_CC = @BUILD_CC@ - BUILD_CCFLAGS = @BUILD_CFLAGS@ - BUILD_LDFLAGS = @BUILD_LDFLAGS@ -@@ -118,8 +118,8 @@ BUILD_LIBS = @BUILD_LIBS@ - BUILD_EXEEXT = @BUILD_EXEEXT@ - x = @EXEEXT@ - --CFLAGS_LIBTOOL = $(CCFLAGS) --CFLAGS_NORMAL = $(CCFLAGS) -+CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC -+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC - CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE - CFLAGS_PROFILE = $(CCFLAGS) -pg - CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ -diff --git a/panel/Makefile.in b/panel/Makefile.in -index 5f7b5b92..e1f7e705 100644 ---- a/panel/Makefile.in -+++ b/panel/Makefile.in -@@ -94,12 +94,12 @@ CC = @CC@ - CPP = @CPP@ - CFLAGS = @CFLAGS@ - --CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -+CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -DBUILDING_PANEL - - CCFLAGS = $(CPPFLAGS) $(CFLAGS) - --CFLAGS_LIBTOOL = $(CCFLAGS) --CFLAGS_NORMAL = $(CCFLAGS) -+CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC -+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC - CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE - CFLAGS_PROFILE = $(CCFLAGS) -pg - CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ ---- a/progs/Makefile.in -+++ b/progs/Makefile.in -@@ -97,8 +97,8 @@ - - CCFLAGS = $(CPPFLAGS) $(CFLAGS) - --CFLAGS_LIBTOOL = $(CCFLAGS) --CFLAGS_NORMAL = $(CCFLAGS) -+CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC -+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC - CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE - CFLAGS_PROFILE = $(CCFLAGS) -pg - CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ diff --git a/recipes/ncurses/all/patches/6.2.0-0011-Let-each-sublibrary-do-its-own-import-exporting.patch b/recipes/ncurses/all/patches/6.2.0-0011-Let-each-sublibrary-do-its-own-import-exporting.patch deleted file mode 100644 index 38de8ccbe5b84..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0011-Let-each-sublibrary-do-its-own-import-exporting.patch +++ /dev/null @@ -1,3326 +0,0 @@ -Upstreamed in 04d942c3d98cf0a929c6afb17be8c10d4ae39af0 - -ncurses 6.2 - patch 20200704 - -d61c3c6a ("ncurses 6.2 - patch 20200711", 2020-07-12) - ---- ncurses/win32con/wcwidth.c -+++ ncurses/win32con/wcwidth.c -@@ -36,10 +36,10 @@ MODULE_ID("$Id: wcwidth.c,v 1.3 2020/02/02 23:34:34 tom Exp $") - #define mk_wcwidth_cjk(ucs) _nc_wcwidth_cjk(ucs) - #define mk_wcswidth_cjk(pwcs, n) _nc_wcswidth_cjk(pwcs, n) - --extern int mk_wcwidth(wchar_t); --extern int mk_wcswidth(const wchar_t *, size_t); --extern int mk_wcwidth_cjk(wchar_t); --extern int mk_wcswidth_cjk(const wchar_t *, size_t); -+NCURSES_EXPORT(int) mk_wcwidth(wchar_t); -+NCURSES_EXPORT(int) mk_wcswidth(const wchar_t *, size_t); -+NCURSES_EXPORT(int) mk_wcwidth_cjk(wchar_t); -+NCURSES_EXPORT(int) mk_wcswidth_cjk(const wchar_t *, size_t); - - #include - #else ---- ncurses/wcwidth.h -+++ ncurses/wcwidth.h -@@ -119,7 +119,7 @@ - * in ISO 10646. - */ - --int mk_wcwidth(wchar_t ucs) -+NCURSES_EXPORT(int) mk_wcwidth(wchar_t ucs) - { - /* sorted list of non-overlapping intervals of non-spacing characters */ - /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */ -@@ -207,7 +207,7 @@ int mk_wcwidth(wchar_t ucs) - } - - --int mk_wcswidth(const wchar_t *pwcs, size_t n) -+NCURSES_EXPORT(int) mk_wcswidth(const wchar_t *pwcs, size_t n) - { - int w, width = 0; - -@@ -230,7 +230,7 @@ int mk_wcswidth(const wchar_t *pwcs, size_t n) - * the traditional terminal character-width behaviour. It is not - * otherwise recommended for general use. - */ --int mk_wcwidth_cjk(wchar_t ucs) -+NCURSES_EXPORT(int) mk_wcwidth_cjk(wchar_t ucs) - { - /* sorted list of non-overlapping intervals of East Asian Ambiguous - * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */ -@@ -298,7 +298,7 @@ int mk_wcwidth_cjk(wchar_t ucs) - } - - --int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) -+NCURSES_EXPORT(int) mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) - { - int w, width = 0; - -diff --git a/c++/cursesapp.h b/c++/cursesapp.h -index a09a3b63..e423089c 100644 ---- a/c++/cursesapp.h -+++ b/c++/cursesapp.h -@@ -39,7 +39,7 @@ - - #include - --class NCURSES_IMPEXP NCursesApplication { -+class NCURSES_CXX_IMPEXP NCursesApplication { - public: - typedef struct _slk_link { // This structure is used to maintain - struct _slk_link* prev; // a stack of SLKs -diff --git a/c++/cursesf.h b/c++/cursesf.h -index 17d4c70e..1e90c360 100644 ---- a/c++/cursesf.h -+++ b/c++/cursesf.h -@@ -51,11 +51,11 @@ extern "C" { - // The abstract base class for builtin and user defined Fieldtypes. - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP NCursesFormField; // forward declaration -+class NCURSES_CXX_IMPEXP NCursesFormField; // forward declaration - - // Class to represent builtin field types as well as C++ written new - // fieldtypes (see classes UserDefineFieldType... --class NCURSES_IMPEXP NCursesFieldType -+class NCURSES_CXX_IMPEXP NCursesFieldType - { - friend class NCursesFormField; - -@@ -101,7 +101,7 @@ public: - // The class representing a forms field, wrapping the lowlevel FIELD struct - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP NCursesFormField -+class NCURSES_CXX_IMPEXP NCursesFormField - { - friend class NCursesForm; - -@@ -338,7 +338,7 @@ extern "C" { - // The class representing a form, wrapping the lowlevel FORM struct - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP NCursesForm : public NCursesPanel -+class NCURSES_CXX_IMPEXP NCursesForm : public NCursesPanel - { - protected: - FORM* form; // the lowlevel structure -@@ -629,7 +629,7 @@ public: - // data belongs to some class T. Use T as template argument - // to create a UserField. - // ------------------------------------------------------------------------- --template class NCURSES_IMPEXP NCursesUserField : public NCursesFormField -+template class NCURSES_CXX_IMPEXP NCursesUserField : public NCursesFormField - { - public: - NCursesUserField (int rows, -@@ -662,7 +662,7 @@ public: - // The same mechanism is used to attach user data to a form - // ------------------------------------------------------------------------- - // --template class NCURSES_IMPEXP NCursesUserForm : public NCursesForm -+template class NCURSES_CXX_IMPEXP NCursesUserForm : public NCursesForm - { - protected: - // 'Internal' constructor, builds an object without association to a -@@ -721,7 +721,7 @@ public: - // Builtin Fieldtypes - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP Alpha_Field : public NCursesFieldType - { - private: - int min_field_width; -@@ -737,7 +737,7 @@ public: - } - }; - --class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP Alphanumeric_Field : public NCursesFieldType - { - private: - int min_field_width; -@@ -753,7 +753,7 @@ public: - } - }; - --class NCURSES_IMPEXP Integer_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP Integer_Field : public NCursesFieldType - { - private: - int precision; -@@ -771,7 +771,7 @@ public: - } - }; - --class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP Numeric_Field : public NCursesFieldType - { - private: - int precision; -@@ -789,7 +789,7 @@ public: - } - }; - --class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP Regular_Expression_Field : public NCursesFieldType - { - private: - char* regex; -@@ -834,7 +834,7 @@ public: - } - }; - --class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP Enumeration_Field : public NCursesFieldType - { - private: - const char** list; -@@ -873,7 +873,7 @@ public: - } - }; - --class NCURSES_IMPEXP IPV4_Address_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP IPV4_Address_Field : public NCursesFieldType - { - private: - void set(NCursesFormField& f) { -@@ -896,7 +896,7 @@ extern "C" { - // Abstract base class for User-Defined Fieldtypes - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP UserDefinedFieldType : public NCursesFieldType -+class NCURSES_CXX_IMPEXP UserDefinedFieldType : public NCursesFieldType - { - friend class UDF_Init; // Internal helper to set up statics - private: -@@ -939,7 +939,7 @@ extern "C" { - // Abstract base class for User-Defined Fieldtypes with Choice functions - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType -+class NCURSES_CXX_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType - { - friend class UDF_Init; // Internal helper to set up statics - private: -diff --git a/c++/cursesm.h b/c++/cursesm.h -index 413da764..0eab3861 100644 ---- a/c++/cursesm.h -+++ b/c++/cursesm.h -@@ -47,7 +47,7 @@ extern "C" { - // This wraps the ITEM type of - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP NCursesMenuItem -+class NCURSES_CXX_IMPEXP NCursesMenuItem - { - friend class NCursesMenu; - -@@ -153,7 +153,7 @@ typedef bool ITEMCALLBACK(NCursesMenuItem&); - // If you don't like to create a child class for individual items to - // overload action(), you may use this class and provide a callback - // function pointer for items. --class NCURSES_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem -+class NCURSES_CXX_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem - { - private: - ITEMCALLBACK* p_fct; -@@ -200,7 +200,7 @@ extern "C" { - // This wraps the MENU type of - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP NCursesMenu : public NCursesPanel -+class NCURSES_CXX_IMPEXP NCursesMenu : public NCursesPanel - { - protected: - MENU *menu; -@@ -596,7 +596,7 @@ public: - // to create a UserItem. - // ------------------------------------------------------------------------- - // --template class NCURSES_IMPEXP NCursesUserItem : public NCursesMenuItem -+template class NCURSES_CXX_IMPEXP NCursesUserItem : public NCursesMenuItem - { - public: - NCursesUserItem (const char* p_name, -@@ -623,7 +623,7 @@ public: - // The same mechanism is used to attach user data to a menu - // ------------------------------------------------------------------------- - // --template class NCURSES_IMPEXP NCursesUserMenu : public NCursesMenu -+template class NCURSES_CXX_IMPEXP NCursesUserMenu : public NCursesMenu - { - protected: - NCursesUserMenu( int nlines, -diff --git a/c++/cursesp.h b/c++/cursesp.h -index d1eea968..af97b022 100644 ---- a/c++/cursesmain.cc -+++ b/c++/cursesmain.cc -@@ -60,7 +60,7 @@ MODULE_ID("$Id: cursesmain.cc,v 1.18 2020/04/04 23:25:34 tom Exp $") - * You only have to instantiate a static NCursesApplication object in your - * main application source file and link this module with your application. - */ --int main(int argc, char* argv[]) -+NCURSES_CXX_IMPEXP int main(int argc, char* argv[]) - { - setlocale(LC_ALL, ""); - ---- a/c++/cursesp.h -+++ b/c++/cursesp.h -@@ -43,7 +43,7 @@ extern "C" { - # include - } - --class NCURSES_IMPEXP NCursesPanel -+class NCURSES_CXX_IMPEXP NCursesPanel - : public NCursesWindow - { - protected: -diff --git a/c++/cursesw.h b/c++/cursesw.h -index 10a2da7e..62721495 100644 ---- a/c++/cursesw.h -+++ b/c++/cursesw.h -@@ -38,6 +38,19 @@ extern "C" { - # include - } - -+#include "ncurses_exports.h" -+ -+#if defined(BUILDING_NCURSES_CXX) -+# define NCURSES_CXX_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT -+#else -+# define NCURSES_CXX_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT -+#endif -+ -+#define NCURSES_CXX_WRAPPED_VAR(type,name) extern NCURSES_CXX_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) -+ -+#define NCURSES_CXX_EXPORT(type) NCURSES_CXX_IMPEXP type NCURSES_API -+#define NCURSES_CXX_EXPORT_VAR(type) NCURSES_CXX_IMPEXP type -+ - #include - - /* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro. -@@ -757,7 +770,7 @@ extern "C" int _nc_ripoffline(int, int (*init)(WINDOW*, int)); - extern "C" int _nc_xx_ripoff_init(WINDOW *, int); - extern "C" int _nc_has_mouse(void); - --class NCURSES_IMPEXP NCursesWindow -+class NCURSES_CXX_IMPEXP NCursesWindow - { - friend class NCursesMenu; - friend class NCursesForm; -@@ -1371,7 +1384,7 @@ public: - // ------------------------------------------------------------------------- - // We leave this here for compatibility reasons. - // ------------------------------------------------------------------------- --class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow -+class NCURSES_CXX_IMPEXP NCursesColorWindow : public NCursesWindow - { - public: - NCursesColorWindow(WINDOW* &window) // useful only for stdscr -@@ -1417,7 +1430,7 @@ public: - // Pad Support. We allow an association of a pad with a "real" window - // through which the pad may be viewed. - // ------------------------------------------------------------------------- --class NCURSES_IMPEXP NCursesPad : public NCursesWindow -+class NCURSES_CXX_IMPEXP NCursesPad : public NCursesWindow - { - private: - NCursesWindow* viewWin; // the "viewport" window -@@ -1533,7 +1546,7 @@ public: - // A FramedPad is constructed always with a viewport window. This viewport - // will be framed (by a box() command) and the interior of the box is the - // viewport subwindow. On the frame we display scrollbar sliders. --class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad -+class NCURSES_CXX_IMPEXP NCursesFramedPad : public NCursesPad - { - protected: - virtual void OnOperation(int pad_req); -diff --git a/c++/cursslk.h b/c++/cursslk.h -index 10364c1d..d69f27d5 100644 ---- a/c++/cursslk.h -+++ b/c++/cursslk.h -@@ -39,10 +39,10 @@ - - #include - --class NCURSES_IMPEXP Soft_Label_Key_Set { -+class NCURSES_CXX_IMPEXP Soft_Label_Key_Set { - public: - // This inner class represents the attributes of a Soft Label Key (SLK) -- class NCURSES_IMPEXP Soft_Label_Key { -+ class NCURSES_CXX_IMPEXP Soft_Label_Key { - friend class Soft_Label_Key_Set; - public: - typedef enum { Left=0, Center=1, Right=2 } Justification; -diff --git a/c++/demo.cc b/c++/demo.cc -index 2b5451a4..b5480808 100644 ---- a/c++/demo.cc -+++ b/c++/demo.cc -@@ -187,7 +187,7 @@ public: - }; - - template class MyAction; --template class NCURSES_IMPEXP NCursesUserItem; -+template class NCURSES_CXX_IMPEXP NCursesUserItem; - - class QuitItem : public NCursesMenuItem - { -diff --git a/c++/etip.h.in b/c++/etip.h.in -index 1155c5fd..65a5b450 100644 ---- a/c++/etip.h.in -+++ b/c++/etip.h.in -@@ -140,11 +140,11 @@ extern "C" { - #endif - - // Forward Declarations --class NCURSES_IMPEXP NCursesPanel; --class NCURSES_IMPEXP NCursesMenu; --class NCURSES_IMPEXP NCursesForm; -+class NCURSES_CXX_IMPEXP NCursesPanel; -+class NCURSES_CXX_IMPEXP NCursesMenu; -+class NCURSES_CXX_IMPEXP NCursesForm; - --class NCURSES_IMPEXP NCursesException -+class NCURSES_CXX_IMPEXP NCursesException - { - public: - const char *message; -@@ -178,7 +178,7 @@ public: - } - }; - --class NCURSES_IMPEXP NCursesPanelException : public NCursesException -+class NCURSES_CXX_IMPEXP NCursesPanelException : public NCursesException - { - public: - const NCursesPanel* p; -@@ -229,7 +229,7 @@ public: - } - }; - --class NCURSES_IMPEXP NCursesMenuException : public NCursesException -+class NCURSES_CXX_IMPEXP NCursesMenuException : public NCursesException - { - public: - const NCursesMenu* m; -@@ -280,7 +280,7 @@ public: - } - }; - --class NCURSES_IMPEXP NCursesFormException : public NCursesException -+class NCURSES_CXX_IMPEXP NCursesFormException : public NCursesException - { - public: - const NCursesForm* f; -diff --git a/form/f_trace.c b/form/f_trace.c -index d24708ce..6efc5225 100644 ---- a/form/f_trace.c -+++ b/form/f_trace.c -@@ -35,35 +35,35 @@ - - MODULE_ID("$Id: f_trace.c,v 1.5 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(FIELD **) -+FORM_EXPORT(FIELD **) - _nc_retrace_field_ptr(FIELD **code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(FIELD *) -+FORM_EXPORT(FIELD *) - _nc_retrace_field(FIELD *code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_retrace_field_type(FIELDTYPE *code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(FORM *) -+FORM_EXPORT(FORM *) - _nc_retrace_form(FORM *code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(Form_Hook) -+FORM_EXPORT(Form_Hook) - _nc_retrace_form_hook(Form_Hook code) - { - TR_FUNC_BFR(1); -diff --git a/form/fld_arg.c b/form/fld_arg.c -index e7555f65..852cd6a8 100644 ---- a/form/fld_arg.c -+++ b/form/fld_arg.c -@@ -61,7 +61,7 @@ MODULE_ID("$Id: fld_arg.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid argument - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_fieldtype_arg(FIELDTYPE *typ, - void *(*const make_arg)(va_list *), - void *(*const copy_arg)(const void *), -@@ -94,7 +94,7 @@ set_fieldtype_arg(FIELDTYPE *typ, - | - | Return Values : Pointer to structure or NULL if none is defined. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void *) -+FORM_EXPORT(void *) - field_arg(const FIELD *field) - { - T((T_CALLED("field_arg(%p)"), (const void *)field)); -diff --git a/form/fld_attr.c b/form/fld_attr.c -index 50e2c73d..c974f72d 100644 ---- a/form/fld_attr.c -+++ b/form/fld_attr.c -@@ -40,7 +40,7 @@ MODULE_ID("$Id: fld_attr.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - --------------------------------------------------------------------------*/ - /* "Template" macro to generate a function to set a fields attribute */ - #define GEN_FIELD_ATTR_SET_FCT( name ) \ --NCURSES_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\ -+FORM_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\ - {\ - int res = E_BAD_ARGUMENT;\ - T((T_CALLED("set_field_" #name "(%p,%s)"), (void *)field, _traceattr(attr)));\ -@@ -65,7 +65,7 @@ NCURSES_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\ - - /* "Template" macro to generate a function to get a fields attribute */ - #define GEN_FIELD_ATTR_GET_FCT( name ) \ --NCURSES_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\ -+FORM_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\ - {\ - T((T_CALLED("field_" #name "(%p)"), (const void *) field));\ - returnAttr( A_ATTRIBUTES & (Normalize_Field( field ) -> name) );\ -diff --git a/form/fld_current.c b/form/fld_current.c -index 75e68edd..14e80e34 100644 ---- a/form/fld_current.c -+++ b/form/fld_current.c -@@ -48,7 +48,7 @@ MODULE_ID("$Id: fld_current.c,v 1.15 2020/02/02 23:34:34 tom Exp $") - | E_INVALID_FIELD - current field can't be left - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_current_field(FORM *form, FIELD *field) - { - int err = E_OK; -@@ -113,7 +113,7 @@ set_current_field(FORM *form, FIELD *field) - | E_BAD_ARGUMENT - invalid form pointer - | E_REQUEST_DENIED - there is no current field to unfocus - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - unfocus_current_field(FORM *const form) - { - T((T_CALLED("unfocus_current_field(%p)"), (const void *)form)); -@@ -137,7 +137,7 @@ unfocus_current_field(FORM *const form) - | - | Return Values : Pointer to the current field. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELD *) -+FORM_EXPORT(FIELD *) - current_field(const FORM *form) - { - T((T_CALLED("current_field(%p)"), (const void *)form)); -@@ -154,7 +154,7 @@ current_field(const FORM *form) - | Return Values : >= 0 : field index - | -1 : fieldpointer invalid or field not connected - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_index(const FIELD *field) - { - T((T_CALLED("field_index(%p)"), (const void *)field)); -diff --git a/form/fld_def.c b/form/fld_def.c -index e529b3c0..a9d2abf7 100644 ---- a/form/fld_def.c -+++ b/form/fld_def.c -@@ -66,7 +66,7 @@ static FIELD default_field = - NCURSES_FIELD_EXTENSION - }; - --NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; -+FORM_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; - - /*--------------------------------------------------------------------------- - | Facility : libnform -@@ -82,7 +82,7 @@ NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; - | Return Values : Pointer to argument structure. Maybe NULL. - | In case of an error in *err an error counter is increased. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(TypeArgument *) -+FORM_EXPORT(TypeArgument *) - _nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err) - { - TypeArgument *res = (TypeArgument *)0; -@@ -130,7 +130,7 @@ _nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err) - | Return Values : Pointer to argument structure. Maybe NULL. - | In case of an error in *err an error counter is increased. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(TypeArgument *) -+FORM_EXPORT(TypeArgument *) - _nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err) - { - TypeArgument *res = (TypeArgument *)0; -@@ -179,7 +179,7 @@ _nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+FORM_EXPORT(void) - _nc_Free_Argument(const FIELDTYPE *typ, TypeArgument *argp) - { - if (typ != 0 && (typ->status & _HAS_ARGS) != 0) -@@ -212,7 +212,7 @@ _nc_Free_Argument(const FIELDTYPE *typ, TypeArgument *argp) - | Return Values : TRUE - copy worked - | FALSE - error occurred - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+FORM_EXPORT(bool) - _nc_Copy_Type(FIELD *dst, FIELD const *src) - { - int err = 0; -@@ -247,7 +247,7 @@ _nc_Copy_Type(FIELD *dst, FIELD const *src) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+FORM_EXPORT(void) - _nc_Free_Type(FIELD *field) - { - assert(field != 0); -@@ -274,7 +274,7 @@ _nc_Free_Type(FIELD *field) - | - | Return Values : Pointer to the new field or NULL if failure. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELD *) -+FORM_EXPORT(FIELD *) - new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf) - { - static const FIELD_CELL blank = BLANK; -@@ -354,7 +354,7 @@ new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf) - | E_BAD_ARGUMENT - invalid field pointer - | E_CONNECTED - field is connected - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - free_field(FIELD *field) - { - T((T_CALLED("free_field(%p)"), (void *)field)); -diff --git a/form/fld_dup.c b/form/fld_dup.c -index 9859a09f..08356b13 100644 ---- a/form/fld_dup.c -+++ b/form/fld_dup.c -@@ -48,7 +48,7 @@ MODULE_ID("$Id: fld_dup.c,v 1.15 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : Pointer to the new field or NULL if failure - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELD *) -+FORM_EXPORT(FIELD *) - dup_field(FIELD *field, int frow, int fcol) - { - FIELD *New_Field = (FIELD *)0; -diff --git a/form/fld_ftchoice.c b/form/fld_ftchoice.c -index 5dc5f4a9..4119e76e 100644 ---- a/form/fld_ftchoice.c -+++ b/form/fld_ftchoice.c -@@ -47,7 +47,7 @@ MODULE_ID("$Id: fld_ftchoice.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid arguments - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_fieldtype_choice(FIELDTYPE *typ, - bool (*const next_choice) (FIELD *, const void *), - bool (*const prev_choice) (FIELD *, const void *)) -diff --git a/form/fld_ftlink.c b/form/fld_ftlink.c -index afa488b3..23bf0912 100644 ---- a/form/fld_ftlink.c -+++ b/form/fld_ftlink.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: fld_ftlink.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : Fieldtype pointer or NULL if error occurred. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - link_fieldtype(FIELDTYPE *type1, FIELDTYPE *type2) - { - FIELDTYPE *nftyp = (FIELDTYPE *)0; -diff --git a/form/fld_info.c b/form/fld_info.c -index 9963b5b3..34defdea 100644 ---- a/form/fld_info.c -+++ b/form/fld_info.c -@@ -47,7 +47,7 @@ MODULE_ID("$Id: fld_info.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid field pointer - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_info(const FIELD *field, - int *rows, int *cols, - int *frow, int *fcol, -@@ -89,7 +89,7 @@ field_info(const FIELD *field, - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid argument - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - dynamic_field_info(const FIELD *field, int *drows, int *dcols, int *maxgrow) - { - T((T_CALLED("dynamic_field_info(%p,%p,%p,%p)"), -diff --git a/form/fld_just.c b/form/fld_just.c -index 8097019d..f15cdcaa 100644 ---- a/form/fld_just.c -+++ b/form/fld_just.c -@@ -45,7 +45,7 @@ MODULE_ID("$Id: fld_just.c,v 1.14 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - one of the arguments was incorrect - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_just(FIELD *field, int just) - { - int res = E_BAD_ARGUMENT; -@@ -77,7 +77,7 @@ set_field_just(FIELD *field, int just) - | - | Return Values : The justification type. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_just(const FIELD *field) - { - T((T_CALLED("field_just(%p)"), (const void *)field)); -diff --git a/form/fld_link.c b/form/fld_link.c -index cb67ac07..b6f4ff75 100644 ---- a/form/fld_link.c -+++ b/form/fld_link.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: fld_link.c,v 1.14 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : Pointer to the new field or NULL if failure - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELD *) -+FORM_EXPORT(FIELD *) - link_field(FIELD *field, int frow, int fcol) - { - FIELD *New_Field = (FIELD *)0; -diff --git a/form/fld_max.c b/form/fld_max.c -index 7d0e146d..8fb873b5 100644 ---- a/form/fld_max.c -+++ b/form/fld_max.c -@@ -45,7 +45,7 @@ MODULE_ID("$Id: fld_max.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid argument - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_max_field(FIELD *field, int maxgrow) - { - T((T_CALLED("set_max_field(%p,%d)"), (void *)field, maxgrow)); -diff --git a/form/fld_move.c b/form/fld_move.c -index 0d6692f3..245f26c1 100644 ---- a/form/fld_move.c -+++ b/form/fld_move.c -@@ -46,7 +46,7 @@ MODULE_ID("$Id: fld_move.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid argument passed - | E_CONNECTED - field is connected - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - move_field(FIELD *field, int frow, int fcol) - { - T((T_CALLED("move_field(%p,%d,%d)"), (void *)field, frow, fcol)); -diff --git a/form/fld_newftyp.c b/form/fld_newftyp.c -index 18a7c073..53162f33 100644 ---- a/form/fld_newftyp.c -+++ b/form/fld_newftyp.c -@@ -53,7 +53,7 @@ static FIELDTYPE default_fieldtype = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE *) -+FORM_EXPORT_VAR(FIELDTYPE *) - _nc_Default_FieldType = &default_fieldtype; - - /*--------------------------------------------------------------------------- -@@ -71,7 +71,7 @@ NCURSES_EXPORT_VAR(FIELDTYPE *) - | - | Return Values : Fieldtype pointer or NULL if error occurred - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - new_fieldtype(bool (*const field_check) (FIELD *, const void *), - bool (*const char_check) (int, const void *)) - { -@@ -121,7 +121,7 @@ new_fieldtype(bool (*const field_check) (FIELD *, const void *), - | E_CONNECTED - there are fields referencing the type - | E_BAD_ARGUMENT - invalid fieldtype pointer - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - free_fieldtype(FIELDTYPE *typ) - { - T((T_CALLED("free_fieldtype(%p)"), (void *)typ)); -diff --git a/form/fld_opts.c b/form/fld_opts.c -index fee5804a..17ab8027 100644 ---- a/form/fld_opts.c -+++ b/form/fld_opts.c -@@ -51,7 +51,7 @@ MODULE_ID("$Id: fld_opts.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid options - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_opts(FIELD *field, Field_Options opts) - { - int res = E_BAD_ARGUMENT; -@@ -72,7 +72,7 @@ set_field_opts(FIELD *field, Field_Options opts) - | - | Return Values : The options. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(Field_Options) -+FORM_EXPORT(Field_Options) - field_opts(const FIELD *field) - { - T((T_CALLED("field_opts(%p)"), (const void *)field)); -@@ -92,7 +92,7 @@ field_opts(const FIELD *field) - | E_BAD_ARGUMENT - invalid options - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_opts_on(FIELD *field, Field_Options opts) - { - int res = E_BAD_ARGUMENT; -@@ -120,7 +120,7 @@ field_opts_on(FIELD *field, Field_Options opts) - | E_BAD_ARGUMENT - invalid options - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_opts_off(FIELD *field, Field_Options opts) - { - int res = E_BAD_ARGUMENT; -diff --git a/form/fld_pad.c b/form/fld_pad.c -index b6d59e2c..260ec407 100644 ---- a/form/fld_pad.c -+++ b/form/fld_pad.c -@@ -46,7 +46,7 @@ MODULE_ID("$Id: fld_pad.c,v 1.11 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid field pointer or pad character - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_pad(FIELD *field, int ch) - { - int res = E_BAD_ARGUMENT; -@@ -75,7 +75,7 @@ set_field_pad(FIELD *field, int ch) - | - | Return Values : The pad character. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_pad(const FIELD *field) - { - T((T_CALLED("field_pad(%p)"), (const void *)field)); -diff --git a/form/fld_page.c b/form/fld_page.c -index c6fb37c8..7310202c 100644 ---- a/form/fld_page.c -+++ b/form/fld_page.c -@@ -45,7 +45,7 @@ MODULE_ID("$Id: fld_page.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_CONNECTED - field is connected - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_new_page(FIELD *field, bool new_page_flag) - { - T((T_CALLED("set_new_page(%p,%d)"), (void *)field, new_page_flag)); -@@ -72,7 +72,7 @@ set_new_page(FIELD *field, bool new_page_flag) - | Return Values : TRUE - field starts a new page - | FALSE - field doesn't start a new page - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+FORM_EXPORT(bool) - new_page(const FIELD *field) - { - T((T_CALLED("new_page(%p)"), (const void *)field)); -diff --git a/form/fld_stat.c b/form/fld_stat.c -index 487a21dc..19000af2 100644 ---- a/form/fld_stat.c -+++ b/form/fld_stat.c -@@ -44,7 +44,7 @@ MODULE_ID("$Id: fld_stat.c,v 1.15 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_status(FIELD *field, bool status) - { - T((T_CALLED("set_field_status(%p,%d)"), (void *)field, status)); -@@ -69,7 +69,7 @@ set_field_status(FIELD *field, bool status) - | Return Values : TRUE - buffer has been changed - | FALSE - buffer has not been changed - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+FORM_EXPORT(bool) - field_status(const FIELD *field) - { - T((T_CALLED("field_status(%p)"), (const void *)field)); -diff --git a/form/fld_type.c b/form/fld_type.c -index a445fa4d..69ebe4ca 100644 ---- a/form/fld_type.c -+++ b/form/fld_type.c -@@ -46,7 +46,7 @@ MODULE_ID("$Id: fld_type.c,v 1.17 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_type(FIELD *field, FIELDTYPE *type,...) - { - va_list ap; -@@ -88,7 +88,7 @@ set_field_type(FIELD *field, FIELDTYPE *type,...) - | - | Return Values : Pointer to fieldtype of NULL if none is defined. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - field_type(const FIELD *field) - { - T((T_CALLED("field_type(%p)"), (const void *)field)); -diff --git a/form/fld_user.c b/form/fld_user.c -index 5cd165c8..2deb68e6 100644 ---- a/form/fld_user.c -+++ b/form/fld_user.c -@@ -44,7 +44,7 @@ MODULE_ID("$Id: fld_user.c,v 1.17 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - on success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_userptr(FIELD *field, void *usrptr) - { - T((T_CALLED("set_field_userptr(%p,%p)"), (void *)field, (void *)usrptr)); -@@ -63,7 +63,7 @@ set_field_userptr(FIELD *field, void *usrptr) - | Return Values : Value of pointer. If no such pointer has been set, - | NULL is returned - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void *) -+FORM_EXPORT(void *) - field_userptr(const FIELD *field) - { - T((T_CALLED("field_userptr(%p)"), (const void *)field)); -diff --git a/form/form.h b/form/form.h -index dabe6764..3c584357 100644 ---- a/form/form.h -+++ b/form/form.h -@@ -44,6 +44,19 @@ - extern "C" { - #endif - -+#include "ncurses_exports.h" -+ -+#if defined(BUILDING_FORM) -+# define FORM_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT -+#else -+# define FORM_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT -+#endif -+ -+#define FORM_WRAPPED_VAR(type,name) extern FORM_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) -+ -+#define FORM_EXPORT(type) FORM_IMPEXP type NCURSES_API -+#define FORM_EXPORT_VAR(type) FORM_IMPEXP type -+ - #ifndef FORM_PRIV_H - typedef void *FIELD_CELL; - #endif -@@ -309,136 +322,136 @@ typedef void (*Form_Hook)(FORM *); - /************************* - * standard field types * - *************************/ --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA; --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM; --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM; --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER; --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC; --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP; -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA; -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM; -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM; -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER; -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC; -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP; - - /************************************ - * built-in additional field types * - * They are not defined in SVr4 * - ************************************/ --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */ -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */ - - /*********************** - * FIELDTYPE routines * - ***********************/ --extern NCURSES_EXPORT(FIELDTYPE *) new_fieldtype ( -+extern FORM_EXPORT(FIELDTYPE *) new_fieldtype ( - bool (* const field_check)(FIELD *,const void *), - bool (* const char_check)(int,const void *)); --extern NCURSES_EXPORT(FIELDTYPE *) link_fieldtype( -+extern FORM_EXPORT(FIELDTYPE *) link_fieldtype( - FIELDTYPE *, FIELDTYPE *); - --extern NCURSES_EXPORT(int) free_fieldtype (FIELDTYPE *); --extern NCURSES_EXPORT(int) set_fieldtype_arg (FIELDTYPE *, -+extern FORM_EXPORT(int) free_fieldtype (FIELDTYPE *); -+extern FORM_EXPORT(int) set_fieldtype_arg (FIELDTYPE *, - void * (* const make_arg)(va_list *), - void * (* const copy_arg)(const void *), - void (* const free_arg)(void *)); --extern NCURSES_EXPORT(int) set_fieldtype_choice (FIELDTYPE *, -+extern FORM_EXPORT(int) set_fieldtype_choice (FIELDTYPE *, - bool (* const next_choice)(FIELD *,const void *), - bool (* const prev_choice)(FIELD *,const void *)); - - /******************* - * FIELD routines * - *******************/ --extern NCURSES_EXPORT(FIELD *) new_field (int,int,int,int,int,int); --extern NCURSES_EXPORT(FIELD *) dup_field (FIELD *,int,int); --extern NCURSES_EXPORT(FIELD *) link_field (FIELD *,int,int); -- --extern NCURSES_EXPORT(int) free_field (FIELD *); --extern NCURSES_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *); --extern NCURSES_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *); --extern NCURSES_EXPORT(int) set_max_field ( FIELD *,int); --extern NCURSES_EXPORT(int) move_field (FIELD *,int,int); --extern NCURSES_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...); --extern NCURSES_EXPORT(int) set_new_page (FIELD *,bool); --extern NCURSES_EXPORT(int) set_field_just (FIELD *,int); --extern NCURSES_EXPORT(int) field_just (const FIELD *); --extern NCURSES_EXPORT(int) set_field_fore (FIELD *,chtype); --extern NCURSES_EXPORT(int) set_field_back (FIELD *,chtype); --extern NCURSES_EXPORT(int) set_field_pad (FIELD *,int); --extern NCURSES_EXPORT(int) field_pad (const FIELD *); --extern NCURSES_EXPORT(int) set_field_buffer (FIELD *,int,const char *); --extern NCURSES_EXPORT(int) set_field_status (FIELD *,bool); --extern NCURSES_EXPORT(int) set_field_userptr (FIELD *, void *); --extern NCURSES_EXPORT(int) set_field_opts (FIELD *,Field_Options); --extern NCURSES_EXPORT(int) field_opts_on (FIELD *,Field_Options); --extern NCURSES_EXPORT(int) field_opts_off (FIELD *,Field_Options); -- --extern NCURSES_EXPORT(chtype) field_fore (const FIELD *); --extern NCURSES_EXPORT(chtype) field_back (const FIELD *); -- --extern NCURSES_EXPORT(bool) new_page (const FIELD *); --extern NCURSES_EXPORT(bool) field_status (const FIELD *); -- --extern NCURSES_EXPORT(void *) field_arg (const FIELD *); -- --extern NCURSES_EXPORT(void *) field_userptr (const FIELD *); -- --extern NCURSES_EXPORT(FIELDTYPE *) field_type (const FIELD *); -- --extern NCURSES_EXPORT(char *) field_buffer (const FIELD *,int); -- --extern NCURSES_EXPORT(Field_Options) field_opts (const FIELD *); -+extern FORM_EXPORT(FIELD *) new_field (int,int,int,int,int,int); -+extern FORM_EXPORT(FIELD *) dup_field (FIELD *,int,int); -+extern FORM_EXPORT(FIELD *) link_field (FIELD *,int,int); -+ -+extern FORM_EXPORT(int) free_field (FIELD *); -+extern FORM_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *); -+extern FORM_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *); -+extern FORM_EXPORT(int) set_max_field ( FIELD *,int); -+extern FORM_EXPORT(int) move_field (FIELD *,int,int); -+extern FORM_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...); -+extern FORM_EXPORT(int) set_new_page (FIELD *,bool); -+extern FORM_EXPORT(int) set_field_just (FIELD *,int); -+extern FORM_EXPORT(int) field_just (const FIELD *); -+extern FORM_EXPORT(int) set_field_fore (FIELD *,chtype); -+extern FORM_EXPORT(int) set_field_back (FIELD *,chtype); -+extern FORM_EXPORT(int) set_field_pad (FIELD *,int); -+extern FORM_EXPORT(int) field_pad (const FIELD *); -+extern FORM_EXPORT(int) set_field_buffer (FIELD *,int,const char *); -+extern FORM_EXPORT(int) set_field_status (FIELD *,bool); -+extern FORM_EXPORT(int) set_field_userptr (FIELD *, void *); -+extern FORM_EXPORT(int) set_field_opts (FIELD *,Field_Options); -+extern FORM_EXPORT(int) field_opts_on (FIELD *,Field_Options); -+extern FORM_EXPORT(int) field_opts_off (FIELD *,Field_Options); -+ -+extern FORM_EXPORT(chtype) field_fore (const FIELD *); -+extern FORM_EXPORT(chtype) field_back (const FIELD *); -+ -+extern FORM_EXPORT(bool) new_page (const FIELD *); -+extern FORM_EXPORT(bool) field_status (const FIELD *); -+ -+extern FORM_EXPORT(void *) field_arg (const FIELD *); -+ -+extern FORM_EXPORT(void *) field_userptr (const FIELD *); -+ -+extern FORM_EXPORT(FIELDTYPE *) field_type (const FIELD *); -+ -+extern FORM_EXPORT(char *) field_buffer (const FIELD *,int); -+ -+extern FORM_EXPORT(Field_Options) field_opts (const FIELD *); - - /****************** - * FORM routines * - ******************/ - --extern NCURSES_EXPORT(FORM *) new_form (FIELD **); -- --extern NCURSES_EXPORT(FIELD **) form_fields (const FORM *); --extern NCURSES_EXPORT(FIELD *) current_field (const FORM *); -- --extern NCURSES_EXPORT(WINDOW *) form_win (const FORM *); --extern NCURSES_EXPORT(WINDOW *) form_sub (const FORM *); -- --extern NCURSES_EXPORT(Form_Hook) form_init (const FORM *); --extern NCURSES_EXPORT(Form_Hook) form_term (const FORM *); --extern NCURSES_EXPORT(Form_Hook) field_init (const FORM *); --extern NCURSES_EXPORT(Form_Hook) field_term (const FORM *); -- --extern NCURSES_EXPORT(int) free_form (FORM *); --extern NCURSES_EXPORT(int) set_form_fields (FORM *,FIELD **); --extern NCURSES_EXPORT(int) field_count (const FORM *); --extern NCURSES_EXPORT(int) set_form_win (FORM *,WINDOW *); --extern NCURSES_EXPORT(int) set_form_sub (FORM *,WINDOW *); --extern NCURSES_EXPORT(int) set_current_field (FORM *,FIELD *); --extern NCURSES_EXPORT(int) unfocus_current_field (FORM *); --extern NCURSES_EXPORT(int) field_index (const FIELD *); --extern NCURSES_EXPORT(int) set_form_page (FORM *,int); --extern NCURSES_EXPORT(int) form_page (const FORM *); --extern NCURSES_EXPORT(int) scale_form (const FORM *,int *,int *); --extern NCURSES_EXPORT(int) set_form_init (FORM *,Form_Hook); --extern NCURSES_EXPORT(int) set_form_term (FORM *,Form_Hook); --extern NCURSES_EXPORT(int) set_field_init (FORM *,Form_Hook); --extern NCURSES_EXPORT(int) set_field_term (FORM *,Form_Hook); --extern NCURSES_EXPORT(int) post_form (FORM *); --extern NCURSES_EXPORT(int) unpost_form (FORM *); --extern NCURSES_EXPORT(int) pos_form_cursor (FORM *); --extern NCURSES_EXPORT(int) form_driver (FORM *,int); -+extern FORM_EXPORT(FORM *) new_form (FIELD **); -+ -+extern FORM_EXPORT(FIELD **) form_fields (const FORM *); -+extern FORM_EXPORT(FIELD *) current_field (const FORM *); -+ -+extern FORM_EXPORT(WINDOW *) form_win (const FORM *); -+extern FORM_EXPORT(WINDOW *) form_sub (const FORM *); -+ -+extern FORM_EXPORT(Form_Hook) form_init (const FORM *); -+extern FORM_EXPORT(Form_Hook) form_term (const FORM *); -+extern FORM_EXPORT(Form_Hook) field_init (const FORM *); -+extern FORM_EXPORT(Form_Hook) field_term (const FORM *); -+ -+extern FORM_EXPORT(int) free_form (FORM *); -+extern FORM_EXPORT(int) set_form_fields (FORM *,FIELD **); -+extern FORM_EXPORT(int) field_count (const FORM *); -+extern FORM_EXPORT(int) set_form_win (FORM *,WINDOW *); -+extern FORM_EXPORT(int) set_form_sub (FORM *,WINDOW *); -+extern FORM_EXPORT(int) set_current_field (FORM *,FIELD *); -+extern FORM_EXPORT(int) unfocus_current_field (FORM *); -+extern FORM_EXPORT(int) field_index (const FIELD *); -+extern FORM_EXPORT(int) set_form_page (FORM *,int); -+extern FORM_EXPORT(int) form_page (const FORM *); -+extern FORM_EXPORT(int) scale_form (const FORM *,int *,int *); -+extern FORM_EXPORT(int) set_form_init (FORM *,Form_Hook); -+extern FORM_EXPORT(int) set_form_term (FORM *,Form_Hook); -+extern FORM_EXPORT(int) set_field_init (FORM *,Form_Hook); -+extern FORM_EXPORT(int) set_field_term (FORM *,Form_Hook); -+extern FORM_EXPORT(int) post_form (FORM *); -+extern FORM_EXPORT(int) unpost_form (FORM *); -+extern FORM_EXPORT(int) pos_form_cursor (FORM *); -+extern FORM_EXPORT(int) form_driver (FORM *,int); - # if NCURSES_WIDECHAR --extern NCURSES_EXPORT(int) form_driver_w (FORM *,int,wchar_t); -+extern FORM_EXPORT(int) form_driver_w (FORM *,int,wchar_t); - # endif --extern NCURSES_EXPORT(int) set_form_userptr (FORM *,void *); --extern NCURSES_EXPORT(int) set_form_opts (FORM *,Form_Options); --extern NCURSES_EXPORT(int) form_opts_on (FORM *,Form_Options); --extern NCURSES_EXPORT(int) form_opts_off (FORM *,Form_Options); --extern NCURSES_EXPORT(int) form_request_by_name (const char *); -+extern FORM_EXPORT(int) set_form_userptr (FORM *,void *); -+extern FORM_EXPORT(int) set_form_opts (FORM *,Form_Options); -+extern FORM_EXPORT(int) form_opts_on (FORM *,Form_Options); -+extern FORM_EXPORT(int) form_opts_off (FORM *,Form_Options); -+extern FORM_EXPORT(int) form_request_by_name (const char *); - --extern NCURSES_EXPORT(const char *) form_request_name (int); -+extern FORM_EXPORT(const char *) form_request_name (int); - --extern NCURSES_EXPORT(void *) form_userptr (const FORM *); -+extern FORM_EXPORT(void *) form_userptr (const FORM *); - --extern NCURSES_EXPORT(Form_Options) form_opts (const FORM *); -+extern FORM_EXPORT(Form_Options) form_opts (const FORM *); - --extern NCURSES_EXPORT(bool) data_ahead (const FORM *); --extern NCURSES_EXPORT(bool) data_behind (const FORM *); -+extern FORM_EXPORT(bool) data_ahead (const FORM *); -+extern FORM_EXPORT(bool) data_behind (const FORM *); - - #if NCURSES_SP_FUNCS --extern NCURSES_EXPORT(FORM *) NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **); -+extern FORM_EXPORT(FORM *) NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **); - #endif - - #ifdef __cplusplus -diff --git a/form/form.priv.h b/form/form.priv.h -index 53c717c6..fe60b91a 100644 ---- a/form/form.priv.h -+++ b/form/form.priv.h -@@ -69,9 +69,9 @@ - /*********************** - * Default objects * - ***********************/ --extern NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form; --extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field; --extern NCURSES_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType; -+extern FORM_EXPORT_VAR(FORM *) _nc_Default_Form; -+extern FORM_EXPORT_VAR(FIELD *) _nc_Default_Field; -+extern FORM_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType; - - /* form status values */ - #define _OVLMODE (0x04U) /* Form is in overlay mode */ -@@ -176,32 +176,32 @@ TypeArgument; - - #define C_ZEROS '\0' - --extern NCURSES_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*, va_list*, int*); --extern NCURSES_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*, const TypeArgument*, int*); --extern NCURSES_EXPORT(void) _nc_Free_Argument (const FIELDTYPE*, TypeArgument*); --extern NCURSES_EXPORT(bool) _nc_Copy_Type (FIELD*, FIELD const *); --extern NCURSES_EXPORT(void) _nc_Free_Type (FIELD *); -- --extern NCURSES_EXPORT(int) _nc_Synchronize_Attributes (FIELD*); --extern NCURSES_EXPORT(int) _nc_Synchronize_Options (FIELD*, Field_Options); --extern NCURSES_EXPORT(int) _nc_Set_Form_Page (FORM*, int, FIELD*); --extern NCURSES_EXPORT(int) _nc_Refresh_Current_Field (FORM*); --extern NCURSES_EXPORT(FIELD *) _nc_First_Active_Field (FORM*); --extern NCURSES_EXPORT(bool) _nc_Internal_Validation (FORM*); --extern NCURSES_EXPORT(int) _nc_Set_Current_Field (FORM*, FIELD*); --extern NCURSES_EXPORT(int) _nc_Position_Form_Cursor (FORM*); --extern NCURSES_EXPORT(void) _nc_Unset_Current_Field(FORM *form); -+extern FORM_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*, va_list*, int*); -+extern FORM_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*, const TypeArgument*, int*); -+extern FORM_EXPORT(void) _nc_Free_Argument (const FIELDTYPE*, TypeArgument*); -+extern FORM_EXPORT(bool) _nc_Copy_Type (FIELD*, FIELD const *); -+extern FORM_EXPORT(void) _nc_Free_Type (FIELD *); -+ -+extern FORM_EXPORT(int) _nc_Synchronize_Attributes (FIELD*); -+extern FORM_EXPORT(int) _nc_Synchronize_Options (FIELD*, Field_Options); -+extern FORM_EXPORT(int) _nc_Set_Form_Page (FORM*, int, FIELD*); -+extern FORM_EXPORT(int) _nc_Refresh_Current_Field (FORM*); -+extern FORM_EXPORT(FIELD *) _nc_First_Active_Field (FORM*); -+extern FORM_EXPORT(bool) _nc_Internal_Validation (FORM*); -+extern FORM_EXPORT(int) _nc_Set_Current_Field (FORM*, FIELD*); -+extern FORM_EXPORT(int) _nc_Position_Form_Cursor (FORM*); -+extern FORM_EXPORT(void) _nc_Unset_Current_Field(FORM *form); - - #if NCURSES_INTEROP_FUNCS --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_INTEGER(void); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ALNUM(void); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ALPHA(void); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ENUM(void); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_NUMERIC(void); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_REGEXP(void); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_IPV4(void); -- --extern NCURSES_EXPORT(FIELDTYPE *) -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_INTEGER(void); -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_ALNUM(void); -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_ALPHA(void); -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_ENUM(void); -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_NUMERIC(void); -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_REGEXP(void); -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_IPV4(void); -+ -+extern FORM_EXPORT(FIELDTYPE *) - _nc_generic_fieldtype(bool (*const field_check) (FORM*, - FIELD *, - const void *), -@@ -212,18 +212,18 @@ _nc_generic_fieldtype(bool (*const field_check) (FORM*, - bool (*const next)(FORM*,FIELD*,const void*), - bool (*const prev)(FORM*,FIELD*,const void*), - void (*freecallback)(void*)); --extern NCURSES_EXPORT(int) _nc_set_generic_fieldtype(FIELD*, FIELDTYPE*, int (*)(void**)); --extern NCURSES_EXPORT(WINDOW*) _nc_form_cursor(const FORM* , int* , int* ); -+extern FORM_EXPORT(int) _nc_set_generic_fieldtype(FIELD*, FIELDTYPE*, int (*)(void**)); -+extern FORM_EXPORT(WINDOW*) _nc_form_cursor(const FORM* , int* , int* ); - - #define INIT_FT_FUNC(func) {func} - #else - #define INIT_FT_FUNC(func) func - #endif - --extern NCURSES_EXPORT(void) _nc_get_fieldbuffer(FORM*, FIELD*, FIELD_CELL*); -+extern FORM_EXPORT(void) _nc_get_fieldbuffer(FORM*, FIELD*, FIELD_CELL*); - - #if USE_WIDEC_SUPPORT --extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *); -+extern FORM_EXPORT(wchar_t *) _nc_Widen_String(char *, int *); - #endif - - #ifdef TRACE -@@ -234,11 +234,11 @@ extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *); - #define returnFieldType(code) TRACE_RETURN1(code,field_type) - #define returnFormHook(code) TRACE_RETURN1(code,form_hook) - --extern NCURSES_EXPORT(FIELD **) _nc_retrace_field_ptr (FIELD **); --extern NCURSES_EXPORT(FIELD *) _nc_retrace_field (FIELD *); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_retrace_field_type (FIELDTYPE *); --extern NCURSES_EXPORT(FORM *) _nc_retrace_form (FORM *); --extern NCURSES_EXPORT(Form_Hook) _nc_retrace_form_hook (Form_Hook); -+extern FORM_EXPORT(FIELD **) _nc_retrace_field_ptr (FIELD **); -+extern FORM_EXPORT(FIELD *) _nc_retrace_field (FIELD *); -+extern FORM_EXPORT(FIELDTYPE *) _nc_retrace_field_type (FIELDTYPE *); -+extern FORM_EXPORT(FORM *) _nc_retrace_form (FORM *); -+extern FORM_EXPORT(Form_Hook) _nc_retrace_form_hook (Form_Hook); - - #else /* !TRACE */ - -diff --git a/form/frm_cursor.c b/form/frm_cursor.c -index 8ff42bf8..8ec64f73 100644 ---- a/form/frm_cursor.c -+++ b/form/frm_cursor.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: frm_cursor.c,v 1.11 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - Invalid form pointer - | E_NOT_POSTED - Form is not posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - pos_form_cursor(FORM *form) - { - int res; -diff --git a/form/frm_data.c b/form/frm_data.c -index 5c3b2a04..2860fad7 100644 ---- a/form/frm_data.c -+++ b/form/frm_data.c -@@ -45,7 +45,7 @@ MODULE_ID("$Id: frm_data.c,v 1.17 2020/02/02 23:34:34 tom Exp $") - | Return Values : TRUE - there are off-screen data behind - | FALSE - there are no off-screen data behind - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+FORM_EXPORT(bool) - data_behind(const FORM *form) - { - bool result = FALSE; -@@ -132,7 +132,7 @@ Only_Padding(WINDOW *w, int len, int pad) - | Return Values : TRUE - there are off-screen data ahead - | FALSE - there are no off-screen data ahead - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+FORM_EXPORT(bool) - data_ahead(const FORM *form) - { - bool result = FALSE; -diff --git a/form/frm_def.c b/form/frm_def.c -index 0722d517..273d0441 100644 ---- a/form/frm_def.c -+++ b/form/frm_def.c -@@ -62,7 +62,7 @@ static FORM default_form = - NULL /* fieldterm */ - }; - --NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form; -+FORM_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form; - - /*--------------------------------------------------------------------------- - | Facility : libnform -@@ -295,7 +295,7 @@ Associate_Fields(FORM *form, FIELD **fields) - | E_CONNECTED - a field is already connected - | E_SYSTEM_ERROR - not enough memory - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FORM *) -+FORM_EXPORT(FORM *) - NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields) - { - int err = E_SYSTEM_ERROR; -@@ -344,7 +344,7 @@ NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields) - | E_SYSTEM_ERROR - not enough memory - +--------------------------------------------------------------------------*/ - #if NCURSES_SP_FUNCS --NCURSES_EXPORT(FORM *) -+FORM_EXPORT(FORM *) - new_form(FIELD **fields) - { - return NCURSES_SP_NAME(new_form) (CURRENT_SCREEN, fields); -@@ -361,7 +361,7 @@ new_form(FIELD **fields) - | E_BAD_ARGUMENT - invalid form pointer - | E_POSTED - form is posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - free_form(FORM *form) - { - T((T_CALLED("free_form(%p)"), (void *)form)); -@@ -392,7 +392,7 @@ free_form(FORM *form) - | E_POSTED - form is posted - | E_SYSTEM_ERROR - not enough memory - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_form_fields(FORM *form, FIELD **fields) - { - FIELD **old; -@@ -423,7 +423,7 @@ set_form_fields(FORM *form, FIELD **fields) - | - | Return Values : Pointer to field array - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELD **) -+FORM_EXPORT(FIELD **) - form_fields(const FORM *form) - { - T((T_CALLED("form_field(%p)"), (const void *)form)); -@@ -438,7 +438,7 @@ form_fields(const FORM *form) - | - | Return Values : Number of fields, -1 if none are defined - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_count(const FORM *form) - { - T((T_CALLED("field_count(%p)"), (const void *)form)); -diff --git a/form/frm_driver.c b/form/frm_driver.c -index b9f91e12..7b92a2ad 100644 ---- a/form/frm_driver.c -+++ b/form/frm_driver.c -@@ -548,7 +548,7 @@ Buffer_To_Window(const FIELD *field, WINDOW *win) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+FORM_EXPORT(void) - _nc_get_fieldbuffer(FORM *form, FIELD *field, FIELD_CELL *buf) - { - int pad; -@@ -826,7 +826,7 @@ Field_encloses(FIELD *field, int ry, int rx) - | E_SYSTEM_ERROR - form has no current field or - | field-window - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_Position_Form_Cursor(FORM *form) - { - FIELD *field; -@@ -868,7 +868,7 @@ _nc_Position_Form_Cursor(FORM *form) - | E_SYSTEM_ERROR - general error - +--------------------------------------------------------------------------*/ - static bool move_after_insert = TRUE; --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_Refresh_Current_Field(FORM *form) - { - WINDOW *formwin; -@@ -1271,7 +1271,7 @@ Synchronize_Linked_Fields(FIELD *field) - | E_BAD_ARGUMENT - invalid field pointer - | E_SYSTEM_ERROR - some severe basic error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_Synchronize_Attributes(FIELD *field) - { - FORM *form; -@@ -1338,7 +1338,7 @@ _nc_Synchronize_Attributes(FIELD *field) - | E_CURRENT - field is the current one - | E_SYSTEM_ERROR - some severe basic error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_Synchronize_Options(FIELD *field, Field_Options newopts) - { - Field_Options oldopts; -@@ -1491,7 +1491,7 @@ _nc_Unset_Current_Field(FORM *form) - | E_SYSTEM_ERROR - some severe basic error - | E_NOT_CONNECTED - no fields are connected to the form - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_Set_Current_Field(FORM *form, FIELD *newfield) - { - FIELD *field; -@@ -3225,7 +3225,7 @@ Check_Field(FORM *form, FIELDTYPE *typ, FIELD *field, TypeArgument *argp) - | Return Values : TRUE - field is valid - | FALSE - field is invalid - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+FORM_EXPORT(bool) - _nc_Internal_Validation(FORM *form) - { - FIELD *field; -@@ -3319,7 +3319,7 @@ Next_Field_On_Page(FIELD *field) - | - | Return Values : Pointer to calculated field. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELD *) -+FORM_EXPORT(FIELD *) - _nc_First_Active_Field(FORM *form) - { - FIELD **last_on_page = &form->field[form->page[form->curpage].pmax]; -@@ -3873,7 +3873,7 @@ FN_Down_Field(FORM *form) - | E_BAD_ARGUMENT - invalid field pointer - | E_SYSTEM_ERROR - some severe basic error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_Set_Form_Page(FORM *form, int page, FIELD *field) - { - int res = E_OK; -@@ -4354,7 +4354,7 @@ static const Binding_Info bindings[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1] = - | E_NOT_CONNECTED - no fields are connected to the form - | E_UNKNOWN_COMMAND - command not known - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - form_driver(FORM *form, int c) - { - const Binding_Info *BI = (Binding_Info *) 0; -@@ -4561,7 +4561,7 @@ form_driver(FORM *form, int c) - | E_NOT_CONNECTED - no fields are connected to the form - | E_UNKNOWN_COMMAND - command not known - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - form_driver_w(FORM *form, int type, wchar_t c) - { - const Binding_Info *BI = (Binding_Info *) 0; -@@ -4743,7 +4743,7 @@ form_driver_w(FORM *form, int type, wchar_t c) - | E_BAD_ARGUMENT - invalid argument - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_buffer(FIELD *field, int buffer, const char *value) - { - FIELD_CELL *p; -@@ -4860,7 +4860,7 @@ set_field_buffer(FIELD *field, int buffer, const char *value) - | - | Return Values : Pointer to buffer or NULL if arguments were invalid. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(char *) -+FORM_EXPORT(char *) - field_buffer(const FIELD *field, int buffer) - { - char *result = 0; -@@ -4928,7 +4928,7 @@ field_buffer(const FIELD *field, int buffer) - | Convert a multibyte string to a wide-character string. The result must be - | freed by the caller. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(wchar_t *) -+FORM_EXPORT(wchar_t *) - _nc_Widen_String(char *source, int *lengthp) - { - wchar_t *result = 0; -diff --git a/form/frm_hook.c b/form/frm_hook.c -index 3051cddc..0feb01c2 100644 ---- a/form/frm_hook.c -+++ b/form/frm_hook.c -@@ -37,7 +37,7 @@ MODULE_ID("$Id: frm_hook.c,v 1.19 2020/02/02 23:34:34 tom Exp $") - - /* "Template" macro to generate function to set application specific hook */ - #define GEN_HOOK_SET_FUNCTION( typ, name ) \ --NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\ -+FORM_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\ - {\ - TR_FUNC_BFR(1); \ - T((T_CALLED("set_" #typ"_"#name"(%p,%s)"), (void *) form, TR_FUNC_ARG(0, func)));\ -@@ -47,7 +47,7 @@ NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook f - - /* "Template" macro to generate function to get application specific hook */ - #define GEN_HOOK_GET_FUNCTION( typ, name ) \ --NCURSES_IMPEXP Form_Hook NCURSES_API typ ## _ ## name ( const FORM *form )\ -+FORM_IMPEXP Form_Hook NCURSES_API typ ## _ ## name ( const FORM *form )\ - {\ - T((T_CALLED(#typ "_" #name "(%p)"), (const void *) form));\ - returnFormHook( Normalize_Form( form ) -> typ ## name );\ -diff --git a/form/frm_opts.c b/form/frm_opts.c -index 18ab2938..c6455466 100644 ---- a/form/frm_opts.c -+++ b/form/frm_opts.c -@@ -45,7 +45,7 @@ MODULE_ID("$Id: frm_opts.c,v 1.18 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_form_opts(FORM *form, Form_Options opts) - { - T((T_CALLED("set_form_opts(%p,%d)"), (void *)form, opts)); -@@ -68,7 +68,7 @@ set_form_opts(FORM *form, Form_Options opts) - | - | Return Values : The option flags. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(Form_Options) -+FORM_EXPORT(Form_Options) - form_opts(const FORM *form) - { - T((T_CALLED("form_opts(%p)"), (const void *)form)); -@@ -85,7 +85,7 @@ form_opts(const FORM *form) - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - form_opts_on(FORM *form, Form_Options opts) - { - T((T_CALLED("form_opts_on(%p,%d)"), (void *)form, opts)); -@@ -110,7 +110,7 @@ form_opts_on(FORM *form, Form_Options opts) - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - form_opts_off(FORM *form, Form_Options opts) - { - T((T_CALLED("form_opts_off(%p,%d)"), (void *)form, opts)); -diff --git a/form/frm_page.c b/form/frm_page.c -index c8569eef..e07655b7 100644 ---- a/form/frm_page.c -+++ b/form/frm_page.c -@@ -47,7 +47,7 @@ MODULE_ID("$Id: frm_page.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - | E_INVALID_FIELD - current field can't be left - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_form_page(FORM *form, int page) - { - int err = E_OK; -@@ -96,7 +96,7 @@ set_form_page(FORM *form, int page) - | Return Values : >= 0 : current page number - | -1 : invalid form pointer - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - form_page(const FORM *form) - { - T((T_CALLED("form_page(%p)"), (const void *)form)); -diff --git a/form/frm_post.c b/form/frm_post.c -index 2f1ad813..894c7c4c 100644 ---- a/form/frm_post.c -+++ b/form/frm_post.c -@@ -48,7 +48,7 @@ MODULE_ID("$Id: frm_post.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - | E_NO_ROOM - form doesn't fit into subwindow - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - post_form(FORM *form) - { - WINDOW *formwin; -@@ -98,7 +98,7 @@ post_form(FORM *form) - | E_NOT_POSTED - form isn't posted - | E_BAD_STATE - called from a hook routine - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - unpost_form(FORM *form) - { - T((T_CALLED("unpost_form(%p)"), (void *)form)); -diff --git a/form/frm_req_name.c b/form/frm_req_name.c -index 1e56c3dc..2f734f18 100644 ---- a/form/frm_req_name.c -+++ b/form/frm_req_name.c -@@ -120,7 +120,7 @@ static const char request_names[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1][13] = - | Return Values : Pointer to name - on success - | NULL - on invalid request code - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(const char *) -+FORM_EXPORT(const char *) - form_request_name(int request) - { - T((T_CALLED("form_request_name(%d)"), request)); -@@ -143,7 +143,7 @@ form_request_name(int request) - | Return Values : Request Id - on success - | E_NO_MATCH - request not found - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - form_request_by_name(const char *str) - { - /* because the table is so small, it doesn't really hurt -diff --git a/form/frm_scale.c b/form/frm_scale.c -index 34c3611d..e0e025aa 100644 ---- a/form/frm_scale.c -+++ b/form/frm_scale.c -@@ -45,7 +45,7 @@ MODULE_ID("$Id: frm_scale.c,v 1.11 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid form pointer - | E_NOT_CONNECTED - no fields connected to form - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - scale_form(const FORM *form, int *rows, int *cols) - { - T((T_CALLED("scale_form(%p,%p,%p)"), -diff --git a/form/frm_sub.c b/form/frm_sub.c -index 9621e302..ebfcb10d 100644 ---- a/form/frm_sub.c -+++ b/form/frm_sub.c -@@ -44,7 +44,7 @@ MODULE_ID("$Id: frm_sub.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_POSTED - form is posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_form_sub(FORM *form, WINDOW *win) - { - T((T_CALLED("set_form_sub(%p,%p)"), (void *)form, (void *)win)); -@@ -73,7 +73,7 @@ set_form_sub(FORM *form, WINDOW *win) - | - | Return Values : The pointer to the Subwindow. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(WINDOW *) -+FORM_EXPORT(WINDOW *) - form_sub(const FORM *form) - { - const FORM *f; -diff --git a/form/frm_user.c b/form/frm_user.c -index e1210f2d..2a415fbe 100644 ---- a/form/frm_user.c -+++ b/form/frm_user.c -@@ -44,7 +44,7 @@ MODULE_ID("$Id: frm_user.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - on success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_form_userptr(FORM *form, void *usrptr) - { - T((T_CALLED("set_form_userptr(%p,%p)"), (void *)form, (void *)usrptr)); -@@ -63,7 +63,7 @@ set_form_userptr(FORM *form, void *usrptr) - | Return Values : Value of pointer. If no such pointer has been set, - | NULL is returned - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void *) -+FORM_EXPORT(void *) - form_userptr(const FORM *form) - { - T((T_CALLED("form_userptr(%p)"), (const void *)form)); -diff --git a/form/frm_win.c b/form/frm_win.c -index b7d1272d..465ceb3c 100644 ---- a/form/frm_win.c -+++ b/form/frm_win.c -@@ -44,7 +44,7 @@ MODULE_ID("$Id: frm_win.c,v 1.17 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_POSTED - form is posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_form_win(FORM *form, WINDOW *win) - { - T((T_CALLED("set_form_win(%p,%p)"), (void *)form, (void *)win)); -@@ -73,7 +73,7 @@ set_form_win(FORM *form, WINDOW *win) - | - | Return Values : The pointer to the Window or stdscr if there is none. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(WINDOW *) -+FORM_EXPORT(WINDOW *) - form_win(const FORM *form) - { - WINDOW *result; -diff --git a/form/fty_alnum.c b/form/fty_alnum.c -index a2ca3514..5504ba98 100644 ---- a/form/fty_alnum.c -+++ b/form/fty_alnum.c -@@ -186,14 +186,14 @@ static FIELDTYPE typeTHIS = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeTHIS; -+FORM_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeTHIS; - - #if NCURSES_INTEROP_FUNCS - /* The next routines are to simplify the use of ncurses from - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_ALNUM(void) - { - return TYPE_ALNUM; -diff --git a/form/fty_alpha.c b/form/fty_alpha.c -index 7dec23f5..15e27143 100644 ---- a/form/fty_alpha.c -+++ b/form/fty_alpha.c -@@ -186,14 +186,14 @@ static FIELDTYPE typeTHIS = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeTHIS; -+FORM_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeTHIS; - - #if NCURSES_INTEROP_FUNCS - /* The next routines are to simplify the use of ncurses from - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_ALPHA(void) - { - return TYPE_ALPHA; -diff --git a/form/fty_enum.c b/form/fty_enum.c -index 71978e3a..2633eff4 100644 ---- a/form/fty_enum.c -+++ b/form/fty_enum.c -@@ -425,7 +425,7 @@ static FIELDTYPE typeENUM = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE *) -+FORM_EXPORT_VAR(FIELDTYPE *) - TYPE_ENUM = &typeENUM; - - #if NCURSES_INTEROP_FUNCS -@@ -433,7 +433,7 @@ TYPE_ENUM = &typeENUM; - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_ENUM(void) - { - return TYPE_ENUM; -diff --git a/form/fty_generic.c b/form/fty_generic.c -index 159d3059..f4332f43 100644 ---- a/form/fty_generic.c -+++ b/form/fty_generic.c -@@ -99,7 +99,7 @@ Generic_This_Type(void *arg) - | - | Return Values : Fieldtype pointer or NULL if error occurred - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_generic_fieldtype(bool (*const field_check) (FORM *, FIELD *, const void *), - bool (*const char_check) (int, FORM *, FIELD *, const - void *), -@@ -220,7 +220,7 @@ GenericArgument(const FIELDTYPE *typ, - | Return Values : E_OK if all went well - | E_SYSTEM_ERROR if an error occurred - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_set_generic_fieldtype(FIELD *field, - FIELDTYPE *ftyp, - int (*argiterator) (void **)) -@@ -275,7 +275,7 @@ _nc_set_generic_fieldtype(FIELD *field, - | - | Return Values : The fields Window or NULL on error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(WINDOW *) -+FORM_EXPORT(WINDOW *) - _nc_form_cursor(const FORM *form, int *pRow, int *pCol) - { - int code = E_SYSTEM_ERROR; -diff --git a/form/fty_int.c b/form/fty_int.c -index 71056404..5e619462 100644 ---- a/form/fty_int.c -+++ b/form/fty_int.c -@@ -278,14 +278,14 @@ static FIELDTYPE typeTHIS = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeTHIS; -+FORM_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeTHIS; - - #if NCURSES_INTEROP_FUNCS - /* The next routines are to simplify the use of ncurses from - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_INTEGER(void) - { - return TYPE_INTEGER; -diff --git a/form/fty_ipv4.c b/form/fty_ipv4.c -index 37133770..6d558668 100644 ---- a/form/fty_ipv4.c -+++ b/form/fty_ipv4.c -@@ -104,14 +104,14 @@ static FIELDTYPE typeIPV4 = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4; -+FORM_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4; - - #if NCURSES_INTEROP_FUNCS - /* The next routines are to simplify the use of ncurses from - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_IPV4(void) - { - return TYPE_IPV4; -diff --git a/form/fty_num.c b/form/fty_num.c -index b4dfeb97..8216cd74 100644 ---- a/form/fty_num.c -+++ b/form/fty_num.c -@@ -324,14 +324,14 @@ static FIELDTYPE typeTHIS = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeTHIS; -+FORM_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeTHIS; - - #if NCURSES_INTEROP_FUNCS - /* The next routines are to simplify the use of ncurses from - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_NUMERIC(void) - { - return TYPE_NUMERIC; -diff --git a/form/fty_regex.c b/form/fty_regex.c -index d1daf714..61378050 100644 ---- a/form/fty_regex.c -+++ b/form/fty_regex.c -@@ -340,14 +340,14 @@ static FIELDTYPE typeREGEXP = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP; -+FORM_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP; - - #if NCURSES_INTEROP_FUNCS - /* The next routines are to simplify the use of ncurses from - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_REGEXP(void) - { - return TYPE_REGEXP; -diff --git a/include/ncurses_dll.h.in b/include/ncurses_dll.h.in -index 568112e2..ca1f0749 100644 ---- a/include/ncurses_dll.h.in -+++ b/include/ncurses_dll.h.in -@@ -66,7 +66,6 @@ - * using functions to access them. - */ - #define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name --#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void) - - #include "ncurses_exports.h" - -@@ -76,6 +75,8 @@ - # define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT - #endif - -+#define NCURSES_WRAPPED_VAR(type,name) extern NCURSES_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) -+ - #define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API - #define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type - ---- include/nc_mingw.h -+++ include/nc_mingw.h -@@ -60,7 +60,9 @@ - #include /* for struct timeval */ - #endif - --extern int _nc_gettimeofday(struct timeval *, void *); -+#include -+ -+NCURSES_EXPORT(int) _nc_gettimeofday(struct timeval *, void *); - - #undef HAVE_GETTIMEOFDAY - #define HAVE_GETTIMEOFDAY 1 -@@ -71,7 +73,7 @@ extern int _nc_gettimeofday(struct timeval *, void *); - - #undef wcwidth - #define wcwidth(ucs) _nc_wcwidth((wchar_t)(ucs)) --extern int _nc_wcwidth(wchar_t); -+NCURSES_EXPORT(int) _nc_wcwidth(wchar_t); - - #endif /* _WIN32 */ - -diff --git a/menu/m_cursor.c b/menu/m_cursor.c -index 3f8e5480..786d9e6c 100644 ---- a/menu/m_cursor.c -+++ b/menu/m_cursor.c -@@ -50,7 +50,7 @@ MODULE_ID("$Id: m_cursor.c,v 1.23 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid menu - | E_NOT_POSTED - Menu is not posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - _nc_menu_cursor_pos(const MENU * menu, const ITEM * item, int *pY, int *pX) - { - if (!menu || !pX || !pY) -@@ -80,7 +80,7 @@ _nc_menu_cursor_pos(const MENU * menu, const ITEM * item, int *pY, int *pX) - | E_BAD_ARGUMENT - invalid menu - | E_NOT_POSTED - Menu is not posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - pos_menu_cursor(const MENU * menu) - { - WINDOW *win, *sub; -diff --git a/menu/m_driver.c b/menu/m_driver.c -index e592bab4..98d7fdf1 100644 ---- a/menu/m_driver.c -+++ b/menu/m_driver.c -@@ -115,7 +115,7 @@ Is_Sub_String( - | Return Values : E_OK - an item matching the pattern was found - | E_NO_MATCH - nothing found - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - _nc_Match_Next_Character_In_Item_Name - (MENU * menu, int ch, ITEM ** item) - { -@@ -209,7 +209,7 @@ _nc_Match_Next_Character_In_Item_Name - | E_BAD_STATE - menu is in user hook routine - | E_NOT_POSTED - menu is not posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - menu_driver(MENU * menu, int c) - { - #define NAVIGATE(dir) \ -diff --git a/menu/m_format.c b/menu/m_format.c -index 9738dbf2..96d331e4 100644 ---- a/menu/m_format.c -+++ b/menu/m_format.c -@@ -56,7 +56,7 @@ MODULE_ID("$Id: m_format.c,v 1.19 2020/02/02 23:34:34 tom Exp $") - | E_NOT_CONNECTED - there are no items connected - | E_POSTED - the menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_format(MENU * menu, int rows, int cols) - { - int total_rows, total_cols; -@@ -120,7 +120,7 @@ set_menu_format(MENU * menu, int rows, int cols) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - menu_format(const MENU * menu, int *rows, int *cols) - { - if (rows) -diff --git a/menu/m_global.c b/menu/m_global.c -index 489987fe..f2d6c001 100644 ---- a/menu/m_global.c -+++ b/menu/m_global.c -@@ -42,7 +42,7 @@ MODULE_ID("$Id: m_global.c,v 1.30 2020/02/02 23:34:34 tom Exp $") - - static char mark[] = "-"; - /* *INDENT-OFF* */ --NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { -+MENU_EXPORT_VAR(MENU) _nc_Default_Menu = { - 16, /* Nr. of chars high */ - 1, /* Nr. of chars wide */ - 16, /* Nr. of items high */ -@@ -81,7 +81,7 @@ NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { - 0 /* status */ - }; - --NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = { -+MENU_EXPORT_VAR(ITEM) _nc_Default_Item = { - { (char *)0, 0 }, /* name */ - { (char *)0, 0 }, /* description */ - (MENU *)0, /* Pointer to parent menu */ -@@ -171,7 +171,7 @@ ResetConnectionInfo(MENU * menu, ITEM ** items) - | Return Values : TRUE - successful connection - | FALSE - connection failed - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+MENU_EXPORT(bool) - _nc_Connect_Items(MENU * menu, ITEM ** items) - { - ITEM **item; -@@ -233,7 +233,7 @@ _nc_Connect_Items(MENU * menu, ITEM ** items) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_Disconnect_Items(MENU * menu) - { - if (menu && menu->items) -@@ -248,7 +248,7 @@ _nc_Disconnect_Items(MENU * menu) - | - | Return Values : the width - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - _nc_Calculate_Text_Width(const TEXT * item /*FIXME: limit length */ ) - { - #if USE_WIDEC_SUPPORT -@@ -337,7 +337,7 @@ calculate_actual_width(MENU * menu, bool name) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_Calculate_Item_Length_and_Width(MENU * menu) - { - int l; -@@ -376,7 +376,7 @@ _nc_Calculate_Item_Length_and_Width(MENU * menu) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_Link_Items(MENU * menu) - { - if (menu && menu->items && *(menu->items)) -@@ -503,7 +503,7 @@ _nc_Link_Items(MENU * menu) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_Show_Menu(const MENU * menu) - { - WINDOW *win; -@@ -543,7 +543,7 @@ _nc_Show_Menu(const MENU * menu) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_New_TopRow_and_CurrentItem( - MENU * menu, - int new_toprow, -diff --git a/menu/m_item_cur.c b/menu/m_item_cur.c -index c09bf311..10435e7a 100644 ---- a/menu/m_item_cur.c -+++ b/menu/m_item_cur.c -@@ -48,7 +48,7 @@ MODULE_ID("$Id: m_item_cur.c,v 1.19 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_current_item(MENU * menu, ITEM * item) - { - T((T_CALLED("set_current_item(%p,%p)"), (void *)menu, (void *)item)); -@@ -89,7 +89,7 @@ set_current_item(MENU * menu, ITEM * item) - | - | Return Values : Item pointer or NULL if failure - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(ITEM *) -+MENU_EXPORT(ITEM *) - current_item(const MENU * menu) - { - T((T_CALLED("current_item(%p)"), (const void *)menu)); -@@ -104,7 +104,7 @@ current_item(const MENU * menu) - | - | Return Values : The index or ERR if this is an invalid item pointer - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - item_index(const ITEM * item) - { - T((T_CALLED("item_index(%p)"), (const void *)item)); -diff --git a/menu/m_item_nam.c b/menu/m_item_nam.c -index aaf54e0a..dc4d66c6 100644 ---- a/menu/m_item_nam.c -+++ b/menu/m_item_nam.c -@@ -48,7 +48,7 @@ MODULE_ID("$Id: m_item_nam.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : See above; returns NULL if item is invalid - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(const char *) -+MENU_EXPORT(const char *) - item_name(const ITEM * item) - { - T((T_CALLED("item_name(%p)"), (const void *)item)); -@@ -63,7 +63,7 @@ item_name(const ITEM * item) - | - | Return Values : See above; Returns NULL if item is invalid - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(const char *) -+MENU_EXPORT(const char *) - item_description(const ITEM * item) - { - T((T_CALLED("item_description(%p)"), (const void *)item)); -diff --git a/menu/m_item_new.c b/menu/m_item_new.c -index 1e7950db..493977ad 100644 ---- a/menu/m_item_new.c -+++ b/menu/m_item_new.c -@@ -107,7 +107,7 @@ Is_Printable_String(const char *s) - | - | Return Values : The item pointer or NULL if creation failed. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(ITEM *) -+MENU_EXPORT(ITEM *) - new_item(const char *name, const char *description) - { - ITEM *item; -@@ -160,7 +160,7 @@ new_item(const char *name, const char *description) - | E_BAD_ARGUMENT - invalid value has been passed - | E_CONNECTED - item is still connected to a menu - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - free_item(ITEM * item) - { - T((T_CALLED("free_item(%p)"), (void *)item)); -@@ -193,7 +193,7 @@ free_item(ITEM * item) - | E_BAD_ARGUMENT - an invalid value has been passed - | E_SYSTEM_ERROR - no memory to store mark - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_mark(MENU * menu, const char *mark) - { - short l; -@@ -265,7 +265,7 @@ set_menu_mark(MENU * menu, const char *mark) - | - | Return Values : The marker string pointer or NULL if no marker defined - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(const char *) -+MENU_EXPORT(const char *) - menu_mark(const MENU * menu) - { - T((T_CALLED("menu_mark(%p)"), (const void *)menu)); -diff --git a/menu/m_item_opt.c b/menu/m_item_opt.c -index f8df2205..b6a5e151 100644 ---- a/menu/m_item_opt.c -+++ b/menu/m_item_opt.c -@@ -51,7 +51,7 @@ MODULE_ID("$Id: m_item_opt.c,v 1.19 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid item options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_item_opts(ITEM * item, Item_Options opts) - { - T((T_CALLED("set_menu_opts(%p,%d)"), (void *)item, opts)); -@@ -94,7 +94,7 @@ set_item_opts(ITEM * item, Item_Options opts) - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - item_opts_off(ITEM * item, Item_Options opts) - { - ITEM *citem = item; /* use a copy because set_item_opts must detect -@@ -122,7 +122,7 @@ item_opts_off(ITEM * item, Item_Options opts) - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - item_opts_on(ITEM * item, Item_Options opts) - { - ITEM *citem = item; /* use a copy because set_item_opts must detect -@@ -150,7 +150,7 @@ item_opts_on(ITEM * item, Item_Options opts) - | - | Return Values : Items options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(Item_Options) -+MENU_EXPORT(Item_Options) - item_opts(const ITEM * item) - { - T((T_CALLED("item_opts(%p)"), (const void *)item)); -diff --git a/menu/m_item_top.c b/menu/m_item_top.c -index 9417e72b..ab60e0f9 100644 ---- a/menu/m_item_top.c -+++ b/menu/m_item_top.c -@@ -50,7 +50,7 @@ MODULE_ID("$Id: m_item_top.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - not a menu pointer or invalid row - | E_NOT_CONNECTED - there are no items for the menu - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_top_row(MENU * menu, int row) - { - ITEM *item; -@@ -92,7 +92,7 @@ set_top_row(MENU * menu, int row) - | - | Return Values : The row number or ERR if there is no row - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - top_row(const MENU * menu) - { - T((T_CALLED("top_row(%p)"), (const void *)menu)); -diff --git a/menu/m_item_use.c b/menu/m_item_use.c -index 30814327..a2e6cfa6 100644 ---- a/menu/m_item_use.c -+++ b/menu/m_item_use.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_item_use.c,v 1.19 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_item_userptr(ITEM * item, void *userptr) - { - T((T_CALLED("set_item_userptr(%p,%p)"), (void *)item, (void *)userptr)); -@@ -67,7 +67,7 @@ set_item_userptr(ITEM * item, void *userptr) - | Return Values : Value of the pointer. If no such pointer has been set, - | NULL is returned. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void *) -+MENU_EXPORT(void *) - item_userptr(const ITEM * item) - { - T((T_CALLED("item_userptr(%p)"), (const void *)item)); -diff --git a/menu/m_item_val.c b/menu/m_item_val.c -index d8d11f21..825c9a2f 100644 ---- a/menu/m_item_val.c -+++ b/menu/m_item_val.c -@@ -53,7 +53,7 @@ MODULE_ID("$Id: m_item_val.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_REQUEST_DENIED - not selectable or single valued menu - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_item_value(ITEM * item, bool value) - { - MENU *menu; -@@ -95,7 +95,7 @@ set_item_value(ITEM * item, bool value) - | Return Values : TRUE - if item is selected - | FALSE - if item is not selected - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+MENU_EXPORT(bool) - item_value(const ITEM * item) - { - T((T_CALLED("item_value(%p)"), (const void *)item)); -diff --git a/menu/m_item_vis.c b/menu/m_item_vis.c -index 8e993413..5959548a 100644 ---- a/menu/m_item_vis.c -+++ b/menu/m_item_vis.c -@@ -50,7 +50,7 @@ MODULE_ID("$Id: m_item_vis.c,v 1.17 2020/02/02 23:34:34 tom Exp $") - | Return Values : TRUE if visible - | FALSE if invisible - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+MENU_EXPORT(bool) - item_visible(const ITEM * item) - { - MENU *menu; -diff --git a/menu/m_items.c b/menu/m_items.c -index 9f46c8be..8c6d4bfc 100644 ---- a/menu/m_items.c -+++ b/menu/m_items.c -@@ -53,7 +53,7 @@ MODULE_ID("$Id: m_items.c,v 1.18 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - An incorrect menu or item array was - | passed to the function - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_items(MENU * menu, ITEM ** items) - { - T((T_CALLED("set_menu_items(%p,%p)"), (void *)menu, (void *)items)); -@@ -85,7 +85,7 @@ set_menu_items(MENU * menu, ITEM ** items) - | - | Return Values : NULL on error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(ITEM **) -+MENU_EXPORT(ITEM **) - menu_items(const MENU * menu) - { - T((T_CALLED("menu_items(%p)"), (const void *)menu)); -@@ -101,7 +101,7 @@ menu_items(const MENU * menu) - | - | Return Values : Number of items or -1 to indicate error. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - item_count(const MENU * menu) - { - T((T_CALLED("item_count(%p)"), (const void *)menu)); -diff --git a/menu/m_new.c b/menu/m_new.c -index cf89196a..f78c702c 100644 ---- a/menu/m_new.c -+++ b/menu/m_new.c -@@ -51,7 +51,7 @@ MODULE_ID("$Id: m_new.c,v 1.22 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : NULL on error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(MENU *) -+MENU_EXPORT(MENU *) - NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items) - { - int err = E_SYSTEM_ERROR; -@@ -102,7 +102,7 @@ NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items) - | Return Values : NULL on error - +--------------------------------------------------------------------------*/ - #if NCURSES_SP_FUNCS --NCURSES_EXPORT(MENU *) -+MENU_EXPORT(MENU *) - new_menu(ITEM ** items) - { - return NCURSES_SP_NAME(new_menu) (CURRENT_SCREEN, items); -@@ -120,7 +120,7 @@ new_menu(ITEM ** items) - | E_BAD_ARGUMENT - Invalid menu pointer passed - | E_POSTED - Menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - free_menu(MENU * menu) - { - T((T_CALLED("free_menu(%p)"), (void *)menu)); -diff --git a/menu/m_opts.c b/menu/m_opts.c -index 4c29f333..b8dc653d 100644 ---- a/menu/m_opts.c -+++ b/menu/m_opts.c -@@ -53,7 +53,7 @@ MODULE_ID("$Id: m_opts.c,v 1.21 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid menu options - | E_POSTED - menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_opts(MENU * menu, Menu_Options opts) - { - T((T_CALLED("set_menu_opts(%p,%d)"), (void *)menu, opts)); -@@ -113,7 +113,7 @@ set_menu_opts(MENU * menu, Menu_Options opts) - | E_BAD_ARGUMENT - invalid options - | E_POSTED - menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - menu_opts_off(MENU * menu, Menu_Options opts) - { - MENU *cmenu = menu; /* use a copy because set_menu_opts must detect -@@ -146,7 +146,7 @@ menu_opts_off(MENU * menu, Menu_Options opts) - | E_BAD_ARGUMENT - invalid menu options - | E_POSTED - menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - menu_opts_on(MENU * menu, Menu_Options opts) - { - MENU *cmenu = menu; /* use a copy because set_menu_opts must detect -@@ -174,7 +174,7 @@ menu_opts_on(MENU * menu, Menu_Options opts) - | - | Return Values : Menu options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(Menu_Options) -+MENU_EXPORT(Menu_Options) - menu_opts(const MENU * menu) - { - T((T_CALLED("menu_opts(%p)"), (const void *)menu)); -diff --git a/menu/m_pad.c b/menu/m_pad.c -index 3d5702ae..e56d3748 100644 ---- a/menu/m_pad.c -+++ b/menu/m_pad.c -@@ -59,7 +59,7 @@ MODULE_ID("$Id: m_pad.c,v 1.14 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - an invalid value has been passed - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_pad(MENU * menu, int pad) - { - bool do_refresh = (menu != (MENU *) 0); -@@ -86,7 +86,7 @@ set_menu_pad(MENU * menu, int pad) - | - | Return Values : The pad character - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - menu_pad(const MENU * menu) - { - T((T_CALLED("menu_pad(%p)"), (const void *)menu)); -diff --git a/menu/m_pattern.c b/menu/m_pattern.c -index 9ff02304..f91f3223 100644 ---- a/menu/m_pattern.c -+++ b/menu/m_pattern.c -@@ -51,7 +51,7 @@ MODULE_ID("$Id: m_pattern.c,v 1.17 2020/02/02 23:34:34 tom Exp $") - | pattern is stored - | PatternString - as expected - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(char *) -+MENU_EXPORT(char *) - menu_pattern(const MENU * menu) - { - static char empty[] = ""; -@@ -73,7 +73,7 @@ menu_pattern(const MENU * menu) - | E_NOT_CONNECTED - no items connected to menu - | E_NO_MATCH - no item matches pattern - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_pattern(MENU * menu, const char *p) - { - ITEM *matchitem; -diff --git a/menu/m_post.c b/menu/m_post.c -index 2cc0ea09..6d81b7c9 100644 ---- a/menu/m_post.c -+++ b/menu/m_post.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_post.c,v 1.32 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_Post_Item(const MENU * menu, const ITEM * item) - { - int i; -@@ -197,7 +197,7 @@ _nc_Post_Item(const MENU * menu, const ITEM * item) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_Draw_Menu(const MENU * menu) - { - ITEM *item = menu->items[0]; -@@ -267,7 +267,7 @@ _nc_Draw_Menu(const MENU * menu) - | E_BAD_STATE - Menu in userexit routine - | E_POSTED - Menu already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - post_menu(MENU * menu) - { - T((T_CALLED("post_menu(%p)"), (void *)menu)); -@@ -339,7 +339,7 @@ post_menu(MENU * menu) - | E_BAD_STATE - menu in userexit routine - | E_NOT_POSTED - menu is not posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - unpost_menu(MENU * menu) - { - WINDOW *win; -diff --git a/menu/m_req_name.c b/menu/m_req_name.c -index d3f04c1d..beeea0f1 100644 ---- a/menu/m_req_name.c -+++ b/menu/m_req_name.c -@@ -74,7 +74,7 @@ static const char request_names[MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1][14] = - | Return Values : Pointer to name - on success - | NULL - on invalid request code - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(const char *) -+MENU_EXPORT(const char *) - menu_request_name(int request) - { - T((T_CALLED("menu_request_name(%d)"), request)); -@@ -96,7 +96,7 @@ menu_request_name(int request) - | Return Values : Request Id - on success - | E_NO_MATCH - request not found - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - menu_request_by_name(const char *str) - { - /* because the table is so small, it doesn't really hurt -diff --git a/menu/m_scale.c b/menu/m_scale.c -index e013acd8..ba986955 100644 ---- a/menu/m_scale.c -+++ b/menu/m_scale.c -@@ -51,7 +51,7 @@ MODULE_ID("$Id: m_scale.c,v 1.11 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid menu pointer - | E_NOT_CONNECTED - no items are connected to menu - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - scale_menu(const MENU * menu, int *rows, int *cols) - { - T((T_CALLED("scale_menu(%p,%p,%p)"), -diff --git a/menu/m_spacing.c b/menu/m_spacing.c -index 9bb746a0..6d68e268 100644 ---- a/menu/m_spacing.c -+++ b/menu/m_spacing.c -@@ -52,7 +52,7 @@ MODULE_ID("$Id: m_spacing.c,v 1.20 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - on success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col) - { - MENU *m; /* split for ATAC workaround */ -@@ -87,7 +87,7 @@ set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col) - | - | Return Values : E_OK - on success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - menu_spacing(const MENU * menu, int *s_desc, int *s_row, int *s_col) - { - const MENU *m; /* split for ATAC workaround */ -diff --git a/menu/m_sub.c b/menu/m_sub.c -index 4658e90e..e69994d5 100644 ---- a/menu/m_sub.c -+++ b/menu/m_sub.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_sub.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_POSTED - menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_sub(MENU * menu, WINDOW *win) - { - T((T_CALLED("set_menu_sub(%p,%p)"), (void *)menu, (void *)win)); -@@ -89,7 +89,7 @@ set_menu_sub(MENU * menu, WINDOW *win) - | - | Return Values : NULL on error, otherwise a pointer to the window - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(WINDOW *) -+MENU_EXPORT(WINDOW *) - menu_sub(const MENU * menu) - { - const MENU *m = Normalize_Menu(menu); -diff --git a/menu/m_trace.c b/menu/m_trace.c -index f5332b18..f4d3373d 100644 ---- a/menu/m_trace.c -+++ b/menu/m_trace.c -@@ -35,35 +35,35 @@ - - MODULE_ID("$Id: m_trace.c,v 1.7 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(ITEM *) -+MENU_EXPORT(ITEM *) - _nc_retrace_item(ITEM * code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(ITEM **) -+MENU_EXPORT(ITEM **) - _nc_retrace_item_ptr(ITEM ** code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(Item_Options) -+MENU_EXPORT(Item_Options) - _nc_retrace_item_opts(Item_Options code) - { - T((T_RETURN("%d"), code)); - return code; - } - --NCURSES_EXPORT(MENU *) -+MENU_EXPORT(MENU *) - _nc_retrace_menu(MENU * code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(Menu_Hook) -+MENU_EXPORT(Menu_Hook) - _nc_retrace_menu_hook(Menu_Hook code) - { - TR_FUNC_BFR(1); -@@ -71,7 +71,7 @@ _nc_retrace_menu_hook(Menu_Hook code) - return code; - } - --NCURSES_EXPORT(Menu_Options) -+MENU_EXPORT(Menu_Options) - _nc_retrace_menu_opts(Menu_Options code) - { - T((T_RETURN("%d"), code)); -diff --git a/menu/m_userptr.c b/menu/m_userptr.c -index df3a45f8..6b1ca551 100644 ---- a/menu/m_userptr.c -+++ b/menu/m_userptr.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_userptr.c,v 1.19 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_userptr(MENU * menu, void *userptr) - { - T((T_CALLED("set_menu_userptr(%p,%p)"), (void *)menu, (void *)userptr)); -@@ -67,7 +67,7 @@ set_menu_userptr(MENU * menu, void *userptr) - | Return Values : Value of the pointer. If no such pointer has been set, - | NULL is returned - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void *) -+MENU_EXPORT(void *) - menu_userptr(const MENU * menu) - { - T((T_CALLED("menu_userptr(%p)"), (const void *)menu)); -diff --git a/menu/m_win.c b/menu/m_win.c -index f06c5808..e67cc92e 100644 ---- a/menu/m_win.c -+++ b/menu/m_win.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_win.c,v 1.18 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_POSTED - menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_win(MENU * menu, WINDOW *win) - { - T((T_CALLED("set_menu_win(%p,%p)"), (void *)menu, (void *)win)); -@@ -89,7 +89,7 @@ set_menu_win(MENU * menu, WINDOW *win) - | - | Return Values : NULL on error, otherwise pointer to window - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(WINDOW *) -+MENU_EXPORT(WINDOW *) - menu_win(const MENU * menu) - { - const MENU *m = Normalize_Menu(menu); -diff --git a/menu/menu.h b/menu/menu.h -index b2e845c6..09bc6c0a 100644 ---- a/menu/menu.h -+++ b/menu/menu.h -@@ -47,6 +47,19 @@ - extern "C" { - #endif - -+#include "ncurses_exports.h" -+ -+#if defined(BUILDING_MENU) -+# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT -+#else -+# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT -+#endif -+ -+#define MENU_WRAPPED_VAR(type,name) extern MENU_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) -+ -+#define MENU_EXPORT(type) MENU_IMPEXP type NCURSES_API -+#define MENU_EXPORT_VAR(type) MENU_IMPEXP type -+ - typedef int Menu_Options; - typedef int Item_Options; - -@@ -183,85 +196,85 @@ MENU; - - /* --------- prototypes for libmenu functions ----------------------------- */ - --extern NCURSES_EXPORT(ITEM **) menu_items (const MENU *); --extern NCURSES_EXPORT(ITEM *) current_item (const MENU *); --extern NCURSES_EXPORT(ITEM *) new_item (const char *,const char *); -- --extern NCURSES_EXPORT(MENU *) new_menu (ITEM **); -- --extern NCURSES_EXPORT(Item_Options) item_opts (const ITEM *); --extern NCURSES_EXPORT(Menu_Options) menu_opts (const MENU *); -- --extern NCURSES_EXPORT(Menu_Hook) item_init (const MENU *); --extern NCURSES_EXPORT(Menu_Hook) item_term (const MENU *); --extern NCURSES_EXPORT(Menu_Hook) menu_init (const MENU *); --extern NCURSES_EXPORT(Menu_Hook) menu_term (const MENU *); -- --extern NCURSES_EXPORT(WINDOW *) menu_sub (const MENU *); --extern NCURSES_EXPORT(WINDOW *) menu_win (const MENU *); -- --extern NCURSES_EXPORT(const char *) item_description (const ITEM *); --extern NCURSES_EXPORT(const char *) item_name (const ITEM *); --extern NCURSES_EXPORT(const char *) menu_mark (const MENU *); --extern NCURSES_EXPORT(const char *) menu_request_name (int); -- --extern NCURSES_EXPORT(char *) menu_pattern (const MENU *); -- --extern NCURSES_EXPORT(void *) menu_userptr (const MENU *); --extern NCURSES_EXPORT(void *) item_userptr (const ITEM *); -- --extern NCURSES_EXPORT(chtype) menu_back (const MENU *); --extern NCURSES_EXPORT(chtype) menu_fore (const MENU *); --extern NCURSES_EXPORT(chtype) menu_grey (const MENU *); -- --extern NCURSES_EXPORT(int) free_item (ITEM *); --extern NCURSES_EXPORT(int) free_menu (MENU *); --extern NCURSES_EXPORT(int) item_count (const MENU *); --extern NCURSES_EXPORT(int) item_index (const ITEM *); --extern NCURSES_EXPORT(int) item_opts_off (ITEM *,Item_Options); --extern NCURSES_EXPORT(int) item_opts_on (ITEM *,Item_Options); --extern NCURSES_EXPORT(int) menu_driver (MENU *,int); --extern NCURSES_EXPORT(int) menu_opts_off (MENU *,Menu_Options); --extern NCURSES_EXPORT(int) menu_opts_on (MENU *,Menu_Options); --extern NCURSES_EXPORT(int) menu_pad (const MENU *); --extern NCURSES_EXPORT(int) pos_menu_cursor (const MENU *); --extern NCURSES_EXPORT(int) post_menu (MENU *); --extern NCURSES_EXPORT(int) scale_menu (const MENU *,int *,int *); --extern NCURSES_EXPORT(int) set_current_item (MENU *menu,ITEM *item); --extern NCURSES_EXPORT(int) set_item_init (MENU *, Menu_Hook); --extern NCURSES_EXPORT(int) set_item_opts (ITEM *,Item_Options); --extern NCURSES_EXPORT(int) set_item_term (MENU *, Menu_Hook); --extern NCURSES_EXPORT(int) set_item_userptr (ITEM *, void *); --extern NCURSES_EXPORT(int) set_item_value (ITEM *,bool); --extern NCURSES_EXPORT(int) set_menu_back (MENU *,chtype); --extern NCURSES_EXPORT(int) set_menu_fore (MENU *,chtype); --extern NCURSES_EXPORT(int) set_menu_format (MENU *,int,int); --extern NCURSES_EXPORT(int) set_menu_grey (MENU *,chtype); --extern NCURSES_EXPORT(int) set_menu_init (MENU *, Menu_Hook); --extern NCURSES_EXPORT(int) set_menu_items (MENU *,ITEM **); --extern NCURSES_EXPORT(int) set_menu_mark (MENU *, const char *); --extern NCURSES_EXPORT(int) set_menu_opts (MENU *,Menu_Options); --extern NCURSES_EXPORT(int) set_menu_pad (MENU *,int); --extern NCURSES_EXPORT(int) set_menu_pattern (MENU *,const char *); --extern NCURSES_EXPORT(int) set_menu_sub (MENU *,WINDOW *); --extern NCURSES_EXPORT(int) set_menu_term (MENU *, Menu_Hook); --extern NCURSES_EXPORT(int) set_menu_userptr (MENU *,void *); --extern NCURSES_EXPORT(int) set_menu_win (MENU *,WINDOW *); --extern NCURSES_EXPORT(int) set_top_row (MENU *,int); --extern NCURSES_EXPORT(int) top_row (const MENU *); --extern NCURSES_EXPORT(int) unpost_menu (MENU *); --extern NCURSES_EXPORT(int) menu_request_by_name (const char *); --extern NCURSES_EXPORT(int) set_menu_spacing (MENU *,int,int,int); --extern NCURSES_EXPORT(int) menu_spacing (const MENU *,int *,int *,int *); -- -- --extern NCURSES_EXPORT(bool) item_value (const ITEM *); --extern NCURSES_EXPORT(bool) item_visible (const ITEM *); -- --extern NCURSES_EXPORT(void) menu_format (const MENU *,int *,int *); -+extern MENU_EXPORT(ITEM **) menu_items (const MENU *); -+extern MENU_EXPORT(ITEM *) current_item (const MENU *); -+extern MENU_EXPORT(ITEM *) new_item (const char *,const char *); -+ -+extern MENU_EXPORT(MENU *) new_menu (ITEM **); -+ -+extern MENU_EXPORT(Item_Options) item_opts (const ITEM *); -+extern MENU_EXPORT(Menu_Options) menu_opts (const MENU *); -+ -+extern MENU_EXPORT(Menu_Hook) item_init (const MENU *); -+extern MENU_EXPORT(Menu_Hook) item_term (const MENU *); -+extern MENU_EXPORT(Menu_Hook) menu_init (const MENU *); -+extern MENU_EXPORT(Menu_Hook) menu_term (const MENU *); -+ -+extern MENU_EXPORT(WINDOW *) menu_sub (const MENU *); -+extern MENU_EXPORT(WINDOW *) menu_win (const MENU *); -+ -+extern MENU_EXPORT(const char *) item_description (const ITEM *); -+extern MENU_EXPORT(const char *) item_name (const ITEM *); -+extern MENU_EXPORT(const char *) menu_mark (const MENU *); -+extern MENU_EXPORT(const char *) menu_request_name (int); -+ -+extern MENU_EXPORT(char *) menu_pattern (const MENU *); -+ -+extern MENU_EXPORT(void *) menu_userptr (const MENU *); -+extern MENU_EXPORT(void *) item_userptr (const ITEM *); -+ -+extern MENU_EXPORT(chtype) menu_back (const MENU *); -+extern MENU_EXPORT(chtype) menu_fore (const MENU *); -+extern MENU_EXPORT(chtype) menu_grey (const MENU *); -+ -+extern MENU_EXPORT(int) free_item (ITEM *); -+extern MENU_EXPORT(int) free_menu (MENU *); -+extern MENU_EXPORT(int) item_count (const MENU *); -+extern MENU_EXPORT(int) item_index (const ITEM *); -+extern MENU_EXPORT(int) item_opts_off (ITEM *,Item_Options); -+extern MENU_EXPORT(int) item_opts_on (ITEM *,Item_Options); -+extern MENU_EXPORT(int) menu_driver (MENU *,int); -+extern MENU_EXPORT(int) menu_opts_off (MENU *,Menu_Options); -+extern MENU_EXPORT(int) menu_opts_on (MENU *,Menu_Options); -+extern MENU_EXPORT(int) menu_pad (const MENU *); -+extern MENU_EXPORT(int) pos_menu_cursor (const MENU *); -+extern MENU_EXPORT(int) post_menu (MENU *); -+extern MENU_EXPORT(int) scale_menu (const MENU *,int *,int *); -+extern MENU_EXPORT(int) set_current_item (MENU *menu,ITEM *item); -+extern MENU_EXPORT(int) set_item_init (MENU *, Menu_Hook); -+extern MENU_EXPORT(int) set_item_opts (ITEM *,Item_Options); -+extern MENU_EXPORT(int) set_item_term (MENU *, Menu_Hook); -+extern MENU_EXPORT(int) set_item_userptr (ITEM *, void *); -+extern MENU_EXPORT(int) set_item_value (ITEM *,bool); -+extern MENU_EXPORT(int) set_menu_back (MENU *,chtype); -+extern MENU_EXPORT(int) set_menu_fore (MENU *,chtype); -+extern MENU_EXPORT(int) set_menu_format (MENU *,int,int); -+extern MENU_EXPORT(int) set_menu_grey (MENU *,chtype); -+extern MENU_EXPORT(int) set_menu_init (MENU *, Menu_Hook); -+extern MENU_EXPORT(int) set_menu_items (MENU *,ITEM **); -+extern MENU_EXPORT(int) set_menu_mark (MENU *, const char *); -+extern MENU_EXPORT(int) set_menu_opts (MENU *,Menu_Options); -+extern MENU_EXPORT(int) set_menu_pad (MENU *,int); -+extern MENU_EXPORT(int) set_menu_pattern (MENU *,const char *); -+extern MENU_EXPORT(int) set_menu_sub (MENU *,WINDOW *); -+extern MENU_EXPORT(int) set_menu_term (MENU *, Menu_Hook); -+extern MENU_EXPORT(int) set_menu_userptr (MENU *,void *); -+extern MENU_EXPORT(int) set_menu_win (MENU *,WINDOW *); -+extern MENU_EXPORT(int) set_top_row (MENU *,int); -+extern MENU_EXPORT(int) top_row (const MENU *); -+extern MENU_EXPORT(int) unpost_menu (MENU *); -+extern MENU_EXPORT(int) menu_request_by_name (const char *); -+extern MENU_EXPORT(int) set_menu_spacing (MENU *,int,int,int); -+extern MENU_EXPORT(int) menu_spacing (const MENU *,int *,int *,int *); -+ -+ -+extern MENU_EXPORT(bool) item_value (const ITEM *); -+extern MENU_EXPORT(bool) item_visible (const ITEM *); -+ -+extern MENU_EXPORT(void) menu_format (const MENU *,int *,int *); - - #if NCURSES_SP_FUNCS --extern NCURSES_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **); -+extern MENU_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **); - #endif - - #ifdef __cplusplus -diff --git a/menu/menu.priv.h b/menu/menu.priv.h -index d084565a..eb653ba4 100644 ---- a/menu/menu.priv.h -+++ b/menu/menu.priv.h -@@ -52,8 +52,8 @@ - /* Backspace code */ - #define BS (8) - --extern NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item; --extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu; -+extern MENU_EXPORT_VAR(ITEM) _nc_Default_Item; -+extern MENU_EXPORT_VAR(MENU) _nc_Default_Menu; - - /* Normalize item to default if none was given */ - #define Normalize_Item( item ) ((item)=(item)?(item):&_nc_Default_Item) -@@ -120,17 +120,17 @@ extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu; - #define UChar(c) ((unsigned char)(c)) - - /* Internal functions. */ --extern NCURSES_EXPORT(void) _nc_Draw_Menu (const MENU *); --extern NCURSES_EXPORT(void) _nc_Show_Menu (const MENU *); --extern NCURSES_EXPORT(void) _nc_Calculate_Item_Length_and_Width (MENU *); --extern NCURSES_EXPORT(int) _nc_Calculate_Text_Width(const TEXT *); --extern NCURSES_EXPORT(void) _nc_Post_Item (const MENU *, const ITEM *); --extern NCURSES_EXPORT(bool) _nc_Connect_Items (MENU *, ITEM **); --extern NCURSES_EXPORT(void) _nc_Disconnect_Items (MENU *); --extern NCURSES_EXPORT(void) _nc_New_TopRow_and_CurrentItem (MENU *,int, ITEM *); --extern NCURSES_EXPORT(void) _nc_Link_Items (MENU *); --extern NCURSES_EXPORT(int) _nc_Match_Next_Character_In_Item_Name (MENU*,int,ITEM**); --extern NCURSES_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* item, -+extern MENU_EXPORT(void) _nc_Draw_Menu (const MENU *); -+extern MENU_EXPORT(void) _nc_Show_Menu (const MENU *); -+extern MENU_EXPORT(void) _nc_Calculate_Item_Length_and_Width (MENU *); -+extern MENU_EXPORT(int) _nc_Calculate_Text_Width(const TEXT *); -+extern MENU_EXPORT(void) _nc_Post_Item (const MENU *, const ITEM *); -+extern MENU_EXPORT(bool) _nc_Connect_Items (MENU *, ITEM **); -+extern MENU_EXPORT(void) _nc_Disconnect_Items (MENU *); -+extern MENU_EXPORT(void) _nc_New_TopRow_and_CurrentItem (MENU *,int, ITEM *); -+extern MENU_EXPORT(void) _nc_Link_Items (MENU *); -+extern MENU_EXPORT(int) _nc_Match_Next_Character_In_Item_Name (MENU*,int,ITEM**); -+extern MENU_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* item, - int* pY, int* pX); - - #ifdef TRACE -@@ -142,12 +142,12 @@ extern NCURSES_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* i - #define returnMenuHook(code) TRACE_RETURN1(code,menu_hook) - #define returnMenuOpts(code) TRACE_RETURN1(code,menu_opts) - --extern NCURSES_EXPORT(ITEM *) _nc_retrace_item (ITEM *); --extern NCURSES_EXPORT(ITEM **) _nc_retrace_item_ptr (ITEM **); --extern NCURSES_EXPORT(Item_Options) _nc_retrace_item_opts (Item_Options); --extern NCURSES_EXPORT(MENU *) _nc_retrace_menu (MENU *); --extern NCURSES_EXPORT(Menu_Hook) _nc_retrace_menu_hook (Menu_Hook); --extern NCURSES_EXPORT(Menu_Options) _nc_retrace_menu_opts (Menu_Options); -+extern MENU_EXPORT(ITEM *) _nc_retrace_item (ITEM *); -+extern MENU_EXPORT(ITEM **) _nc_retrace_item_ptr (ITEM **); -+extern MENU_EXPORT(Item_Options) _nc_retrace_item_opts (Item_Options); -+extern MENU_EXPORT(MENU *) _nc_retrace_menu (MENU *); -+extern MENU_EXPORT(Menu_Hook) _nc_retrace_menu_hook (Menu_Hook); -+extern MENU_EXPORT(Menu_Options) _nc_retrace_menu_opts (Menu_Options); - - #else /* !TRACE */ - -diff --git a/panel/p_above.c b/panel/p_above.c -index 12b5b87b..704863a7 100644 ---- a/panel/p_above.c -+++ b/panel/p_above.c -@@ -40,7 +40,7 @@ - MODULE_ID("$Id: p_above.c,v 1.10 2020/02/02 23:34:34 tom Exp $") - - #if NCURSES_SP_FUNCS --NCURSES_EXPORT(PANEL *) -+PANEL_EXPORT(PANEL *) - ground_panel(SCREEN * sp) - { - T((T_CALLED("ground_panel(%p)"), (void *)sp)); -@@ -63,7 +63,7 @@ ground_panel(SCREEN * sp) - } - #endif - --NCURSES_EXPORT(PANEL *) -+PANEL_EXPORT(PANEL *) - panel_above(const PANEL * pan) - { - PANEL *result; -diff --git a/panel/p_below.c b/panel/p_below.c -index a8b1ef47..972ec836 100644 ---- a/panel/p_below.c -+++ b/panel/p_below.c -@@ -40,7 +40,7 @@ - MODULE_ID("$Id: p_below.c,v 1.10 2020/02/02 23:34:34 tom Exp $") - - #if NCURSES_SP_FUNCS --NCURSES_EXPORT(PANEL *) -+PANEL_EXPORT(PANEL *) - ceiling_panel(SCREEN * sp) - { - T((T_CALLED("ceiling_panel(%p)"), (void *)sp)); -@@ -61,7 +61,7 @@ ceiling_panel(SCREEN * sp) - } - #endif - --NCURSES_EXPORT(PANEL *) -+PANEL_EXPORT(PANEL *) - panel_below(const PANEL * pan) - { - PANEL *result; -diff --git a/panel/p_bottom.c b/panel/p_bottom.c -index a69ac9f4..c4a170ad 100644 ---- a/panel/p_bottom.c -+++ b/panel/p_bottom.c -@@ -40,7 +40,7 @@ - - MODULE_ID("$Id: p_bottom.c,v 1.14 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - bottom_panel(PANEL * pan) - { - int err = OK; -diff --git a/panel/p_delete.c b/panel/p_delete.c -index 6b122a6c..e58875b1 100644 ---- a/panel/p_delete.c -+++ b/panel/p_delete.c -@@ -40,7 +40,7 @@ - - MODULE_ID("$Id: p_delete.c,v 1.11 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - del_panel(PANEL * pan) - { - int err = OK; -diff --git a/panel/p_hidden.c b/panel/p_hidden.c -index ddb23b13..a43ea481 100644 ---- a/panel/p_hidden.c -+++ b/panel/p_hidden.c -@@ -40,7 +40,7 @@ - - MODULE_ID("$Id: p_hidden.c,v 1.10 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - panel_hidden(const PANEL * pan) - { - int rc = ERR; -diff --git a/panel/p_hide.c b/panel/p_hide.c -index fc26f752..35e738e3 100644 ---- a/panel/p_hide.c -+++ b/panel/p_hide.c -@@ -39,7 +39,7 @@ - - MODULE_ID("$Id: p_hide.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - hide_panel(register PANEL * pan) - { - int err = ERR; -diff --git a/panel/p_move.c b/panel/p_move.c -index 02830bf5..77127be7 100644 ---- a/panel/p_move.c -+++ b/panel/p_move.c -@@ -40,7 +40,7 @@ - - MODULE_ID("$Id: p_move.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - move_panel(PANEL * pan, int starty, int startx) - { - int rc = ERR; -diff --git a/panel/p_new.c b/panel/p_new.c -index d2f8d036..659bdeb9 100644 ---- a/panel/p_new.c -+++ b/panel/p_new.c -@@ -89,7 +89,7 @@ root_panel(NCURSES_SP_DCL0) - return _nc_stdscr_pseudo_panel; - } - --NCURSES_EXPORT(PANEL *) -+PANEL_EXPORT(PANEL *) - new_panel(WINDOW *win) - { - PANEL *pan = (PANEL *) 0; -diff --git a/panel/p_replace.c b/panel/p_replace.c -index 5acbccf8..362a2ef8 100644 ---- a/panel/p_replace.c -+++ b/panel/p_replace.c -@@ -39,7 +39,7 @@ - - MODULE_ID("$Id: p_replace.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - replace_panel(PANEL * pan, WINDOW *win) - { - int rc = ERR; -diff --git a/panel/p_show.c b/panel/p_show.c -index 933bf5aa..bfee2cb8 100644 ---- a/panel/p_show.c -+++ b/panel/p_show.c -@@ -39,7 +39,7 @@ - - MODULE_ID("$Id: p_show.c,v 1.14 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - show_panel(PANEL * pan) - { - int err = ERR; -diff --git a/panel/p_top.c b/panel/p_top.c -index 09e89fcc..438086c1 100644 ---- a/panel/p_top.c -+++ b/panel/p_top.c -@@ -39,7 +39,7 @@ - - MODULE_ID("$Id: p_top.c,v 1.7 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - top_panel(PANEL * pan) - { - T((T_CALLED("top_panel(%p)"), (void *)pan)); -diff --git a/panel/p_update.c b/panel/p_update.c -index 3fe4770b..ca856795 100644 ---- a/panel/p_update.c -+++ b/panel/p_update.c -@@ -40,7 +40,7 @@ - - MODULE_ID("$Id: p_update.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0) - { - PANEL *pan; -@@ -71,7 +71,7 @@ NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0) - } - - #if NCURSES_SP_FUNCS --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - update_panels(void) - { - NCURSES_SP_NAME(update_panels) (CURRENT_SCREEN); -diff --git a/panel/p_user.c b/panel/p_user.c -index 633431ea..e6122d33 100644 ---- a/panel/p_user.c -+++ b/panel/p_user.c -@@ -39,7 +39,7 @@ - - MODULE_ID("$Id: p_user.c,v 1.9 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) - { - T((T_CALLED("set_panel_userptr(%p,%p)"), (void *)pan, (NCURSES_CONST void *)uptr)); -@@ -49,7 +49,7 @@ set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) - returnCode(OK); - } - --NCURSES_EXPORT(NCURSES_CONST void *) -+PANEL_EXPORT(NCURSES_CONST void *) - panel_userptr(const PANEL * pan) - { - T((T_CALLED("panel_userptr(%p)"), (const void *)pan)); -diff --git a/panel/p_win.c b/panel/p_win.c -index 023a71c9..0bc838f5 100644 ---- a/panel/p_win.c -+++ b/panel/p_win.c -@@ -39,7 +39,7 @@ - - MODULE_ID("$Id: p_win.c,v 1.7 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(WINDOW *) -+PANEL_EXPORT(WINDOW *) - panel_window(const PANEL * pan) - { - T((T_CALLED("panel_window(%p)"), (const void *)pan)); -diff --git a/panel/panel.c b/panel/panel.c -index a0e632d2..5d66476e 100644 ---- a/panel/panel.c -+++ b/panel/panel.c -@@ -43,7 +43,7 @@ MODULE_ID("$Id: panel.c,v 1.27 2020/02/02 23:34:34 tom Exp $") - _nc_retrace_panel (pan) - --------------------------------------------------------------------------*/ - #ifdef TRACE --NCURSES_EXPORT(PANEL *) -+PANEL_EXPORT(PANEL *) - _nc_retrace_panel(PANEL * pan) - { - T((T_RETURN("%p"), (void *)pan)); -@@ -56,7 +56,7 @@ _nc_retrace_panel(PANEL * pan) - --------------------------------------------------------------------------*/ - #ifdef TRACE - #ifndef TRACE_TXT --NCURSES_EXPORT(const char *) -+PANEL_EXPORT(const char *) - _nc_my_visbuf(const void *ptr) - { - char temp[32]; -@@ -74,7 +74,7 @@ _nc_my_visbuf(const void *ptr) - dPanel(text,pan) - --------------------------------------------------------------------------*/ - #ifdef TRACE --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - _nc_dPanel(const char *text, const PANEL * pan) - { - _tracef("%s id=%s b=%s a=%s y=%d x=%d", -@@ -89,7 +89,7 @@ _nc_dPanel(const char *text, const PANEL * pan) - dStack(fmt,num,pan) - --------------------------------------------------------------------------*/ - #ifdef TRACE --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - _nc_dStack(const char *fmt, int num, const PANEL * pan) - { - char s80[80]; -@@ -115,7 +115,7 @@ _nc_dStack(const char *fmt, int num, const PANEL * pan) - Wnoutrefresh(pan) - debugging hook for wnoutrefresh - --------------------------------------------------------------------------*/ - #ifdef TRACE --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - _nc_Wnoutrefresh(const PANEL * pan) - { - dPanel("wnoutrefresh", pan); -@@ -127,7 +127,7 @@ _nc_Wnoutrefresh(const PANEL * pan) - Touchpan(pan) - --------------------------------------------------------------------------*/ - #ifdef TRACE --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - _nc_Touchpan(const PANEL * pan) - { - dPanel("Touchpan", pan); -@@ -139,7 +139,7 @@ _nc_Touchpan(const PANEL * pan) - Touchline(pan,start,count) - --------------------------------------------------------------------------*/ - #ifdef TRACE --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - _nc_Touchline(const PANEL * pan, int start, int count) - { - char s80[80]; -diff --git a/panel/panel.h b/panel/panel.h -index 2eebe178..042cf5d4 100644 ---- a/panel/panel.h -+++ b/panel/panel.h -@@ -57,27 +57,40 @@ PANEL; - extern "C" { - #endif - --extern NCURSES_EXPORT(WINDOW*) panel_window (const PANEL *); --extern NCURSES_EXPORT(void) update_panels (void); --extern NCURSES_EXPORT(int) hide_panel (PANEL *); --extern NCURSES_EXPORT(int) show_panel (PANEL *); --extern NCURSES_EXPORT(int) del_panel (PANEL *); --extern NCURSES_EXPORT(int) top_panel (PANEL *); --extern NCURSES_EXPORT(int) bottom_panel (PANEL *); --extern NCURSES_EXPORT(PANEL*) new_panel (WINDOW *); --extern NCURSES_EXPORT(PANEL*) panel_above (const PANEL *); --extern NCURSES_EXPORT(PANEL*) panel_below (const PANEL *); --extern NCURSES_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *); --extern NCURSES_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *); --extern NCURSES_EXPORT(int) move_panel (PANEL *, int, int); --extern NCURSES_EXPORT(int) replace_panel (PANEL *,WINDOW *); --extern NCURSES_EXPORT(int) panel_hidden (const PANEL *); -+#include "ncurses_exports.h" -+ -+#if defined(BUILDING_PANEL) -+# define PANEL_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT -+#else -+# define PANEL_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT -+#endif -+ -+#define PANEL_WRAPPED_VAR(type,name) extern PANEL_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) -+ -+#define PANEL_EXPORT(type) PANEL_IMPEXP type NCURSES_API -+#define PANEL_EXPORT_VAR(type) PANEL_IMPEXP type -+ -+extern PANEL_EXPORT(WINDOW*) panel_window (const PANEL *); -+extern PANEL_EXPORT(void) update_panels (void); -+extern PANEL_EXPORT(int) hide_panel (PANEL *); -+extern PANEL_EXPORT(int) show_panel (PANEL *); -+extern PANEL_EXPORT(int) del_panel (PANEL *); -+extern PANEL_EXPORT(int) top_panel (PANEL *); -+extern PANEL_EXPORT(int) bottom_panel (PANEL *); -+extern PANEL_EXPORT(PANEL*) new_panel (WINDOW *); -+extern PANEL_EXPORT(PANEL*) panel_above (const PANEL *); -+extern PANEL_EXPORT(PANEL*) panel_below (const PANEL *); -+extern PANEL_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *); -+extern PANEL_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *); -+extern PANEL_EXPORT(int) move_panel (PANEL *, int, int); -+extern PANEL_EXPORT(int) replace_panel (PANEL *,WINDOW *); -+extern PANEL_EXPORT(int) panel_hidden (const PANEL *); - - #if NCURSES_SP_FUNCS --extern NCURSES_EXPORT(PANEL *) ground_panel(SCREEN *); --extern NCURSES_EXPORT(PANEL *) ceiling_panel(SCREEN *); -+extern PANEL_EXPORT(PANEL *) ground_panel(SCREEN *); -+extern PANEL_EXPORT(PANEL *) ceiling_panel(SCREEN *); - --extern NCURSES_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); -+extern PANEL_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); - #endif - - #if defined(__cplusplus) -diff --git a/panel/panel.priv.h b/panel/panel.priv.h -index c8e3ea79..bf9df442 100644 ---- a/panel/panel.priv.h -+++ b/panel/panel.priv.h -@@ -50,7 +50,7 @@ struct screen; /* forward declaration */ - #include "panel.h" - - #ifdef TRACE -- extern NCURSES_EXPORT(const char *) _nc_my_visbuf (const void *); -+ extern PANEL_EXPORT(const char *) _nc_my_visbuf (const void *); - # ifdef TRACE_TXT - # define USER_PTR(ptr) _nc_visbuf((const char *)ptr) - # else -@@ -59,12 +59,12 @@ struct screen; /* forward declaration */ - - # define returnPanel(code) TRACE_RETURN1(code,panel) - -- extern NCURSES_EXPORT(PANEL *) _nc_retrace_panel (PANEL *); -- extern NCURSES_EXPORT(void) _nc_dPanel (const char*, const PANEL*); -- extern NCURSES_EXPORT(void) _nc_dStack (const char*, int, const PANEL*); -- extern NCURSES_EXPORT(void) _nc_Wnoutrefresh (const PANEL*); -- extern NCURSES_EXPORT(void) _nc_Touchpan (const PANEL*); -- extern NCURSES_EXPORT(void) _nc_Touchline (const PANEL*, int, int); -+ extern PANEL_EXPORT(PANEL *) _nc_retrace_panel (PANEL *); -+ extern PANEL_EXPORT(void) _nc_dPanel (const char*, const PANEL*); -+ extern PANEL_EXPORT(void) _nc_dStack (const char*, int, const PANEL*); -+ extern PANEL_EXPORT(void) _nc_Wnoutrefresh (const PANEL*); -+ extern PANEL_EXPORT(void) _nc_Touchpan (const PANEL*); -+ extern PANEL_EXPORT(void) _nc_Touchline (const PANEL*, int, int); - - # define dBug(x) _tracef x - # define dPanel(text,pan) _nc_dPanel(text,pan) -@@ -205,7 +205,7 @@ struct screen; /* forward declaration */ - - #if NCURSES_SP_FUNCS - /* These may become later renamed and part of panel.h and the public API */ --extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*); -+extern PANEL_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*); - #endif - /* *INDENT-ON* */ - --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0012-Learn-configure-about-msvc.patch b/recipes/ncurses/all/patches/6.2.0-0012-Learn-configure-about-msvc.patch deleted file mode 100644 index 1a723cab0cac4..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0012-Learn-configure-about-msvc.patch +++ /dev/null @@ -1,423 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -Upstreamed in 3e37c7d3fa122563a9d88168926f61286ef30cd3 - -ncurses 6.2 - patch 20200523 - -Upstreamed in d61c3c6a831d18ef0ed6f797ac97d60fffc2f158 - -ncurses 6.2 - patch 20200711 - -From 4a4d205735df2634a328c03629435f440cb5dd3c Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:38:08 +0100 -Subject: [PATCH 12/15] Learn configure about msvc - ---- - aclocal.m4 | 145 +++++++++++++++++++++++++++++++++++++++++------------ - mk-1st.awk | 25 +++++---- - 2 files changed, 128 insertions(+), 42 deletions(-) - -diff --git a/aclocal.m4 b/aclocal.m4 -index 55c65d1a..3a44d63b 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -453,39 +453,55 @@ AC_DEFUN([CF_AR_FLAGS],[ - AC_REQUIRE([CF_PROG_AR]) - - AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ -- cf_cv_ar_flags=unknown -- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv -- do -+ case $cf_cv_system_name in -+ (*-msvc*) -+ cf_cv_ar_flags='' -+ cat >mk_static_lib.sh <<-EOF -+ #!$SHELL -+ MSVC_BIN="[$]AR" -+ out="\[$]1" -+ shift -+ exec \[$]MSVC_BIN -out:"\[$]out" \[$]@ -+ EOF -+ chmod +x mk_static_lib.sh -+ AR=`pwd`/mk_static_lib.sh -+ ;; -+ (*) -+ cf_cv_ar_flags=unknown -+ for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv -+ do - -- # check if $ARFLAGS already contains this choice -- if test "x$ARFLAGS" != "x" ; then -- cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` -- if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then -- cf_cv_ar_flags= -- break -+ # check if $ARFLAGS already contains this choice -+ if test "x$ARFLAGS" != "x" ; then -+ cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` -+ if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then -+ cf_cv_ar_flags= -+ break -+ fi - fi -- fi -- -- rm -f conftest.$ac_cv_objext -- rm -f conftest.a - -- cat >conftest.$ac_ext <&AC_FD_CC -- $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null -- if test -f conftest.a ; then -- cf_cv_ar_flags=$cf_ar_flags -+ rm -f conftest.$ac_cv_objext -+ rm -f conftest.a -+ -+ cat >conftest.$ac_ext <<-EOF -+ #line __oline__ "configure" -+ int testdata[[3]] = { 123, 456, 789 }; -+ EOF -+ if AC_TRY_EVAL(ac_compile) ; then -+ echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&AC_FD_CC -+ $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null -+ if test -f conftest.a ; then -+ cf_cv_ar_flags=$cf_ar_flags -+ break -+ fi -+ else -+ CF_VERBOSE(cannot compile test-program) - break - fi -- else -- CF_VERBOSE(cannot compile test-program) -- break -- fi -- done -- rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext -+ done -+ rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext -+ ;; -+ esac - ]) - - if test -n "$ARFLAGS" ; then -@@ -4008,6 +4024,9 @@ define([CF_LIB_PREFIX], - LIB_PREFIX='' - fi - ;; -+ (*-msvc*) -+ LIB_PREFIX='' -+ ;; - (*) LIB_PREFIX='lib' - ;; - esac -@@ -4036,7 +4055,7 @@ cf_prefix=$LIB_PREFIX - AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) - - case $cf_cv_shlib_version in --(cygdll|msysdll|mingw) -+(cygdll|msysdll|mingw|msvcdll) - TINFO_NAME=$TINFO_ARG_SUFFIX - TINFO_SUFFIX=.dll - ;; -@@ -4159,6 +4178,10 @@ CF_EOF - cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` - cf_add_lib="../lib/lib${cf_libname}${cf_cygsuf}" - ;; -+ (msvcdll) -+ cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` -+ cf_add_lib="../lib/${cf_libname}${cf_cygsuf}" -+ ;; - (*) - cf_add_lib= - ;; -@@ -4254,7 +4277,7 @@ CF_EOF - CXX_MODEL=$cf_ITEM - if test "$CXX_MODEL" = SHARED; then - case $cf_cv_shlib_version in -- (cygdll|msysdll|mingw) -+ (cygdll|msysdll|mingw|msvcdll) - test "x$with_shared_cxx" = xno && CF_VERBOSE(overriding CXX_MODEL to SHARED) - with_shared_cxx=yes - ;; -@@ -4649,11 +4672,25 @@ AC_DEFUN([CF_LIB_SUFFIX], - $3=[$]$2 - ;; - (Xdebug) -- $2='_g.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ $2='_g.lib' -+ ;; -+ (*) -+ $2='_g.a' -+ ;; -+ esac - $3=[$]$2 - ;; - (Xprofile) -- $2='_p.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ $2='_p.lib' -+ ;; -+ (*) -+ $2='_p.a' -+ ;; -+ esac - $3=[$]$2 - ;; - (Xshared) -@@ -4662,6 +4699,10 @@ AC_DEFUN([CF_LIB_SUFFIX], - $2='.so' - $3=[$]$2 - ;; -+ (*-msvc*) -+ $2='.dll' -+ $3='.dll.lib' -+ ;; - (cygwin*|msys*|mingw*) - $2='.dll' - $3='.dll.a' -@@ -4689,7 +4730,14 @@ AC_DEFUN([CF_LIB_SUFFIX], - esac - ;; - (*) -- $2='.a' -+ case $target in -+ (*-msvc*) -+ $2='.lib' -+ ;; -+ (*) -+ $2='.a' -+ ;; -+ esac - $3=[$]$2 - ;; - esac -@@ -6759,6 +6807,110 @@ CF_EOF - CF_SHARED_SONAME - MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' - ;; -+ (mingw*msvc*) -+ LDFLAGS="$LDFLAGS user32.lib" -+ export LDFLAGS -+ cf_cv_shlib_version=msvcdll -+ cf_cv_shlib_version_infix=msvcdll -+ shlibdir=$bindir -+ MAKE_DLLS= -+ if test "$DFT_LWR_MODEL" = "shared" ; then -+ LOCAL_LDFLAGS="-link -dll" -+ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" -+ EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS" -+ fi -+ CC_SHARED_OPTS= -+ MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ ${LD} [$]{CFLAGS}' -+ RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib" -+ cat >mk_shared_lib.sh <<-CF_EOF -+ #!$SHELL -+ SHARED_LIB=\[$]1 -+ IMPORT_LIB=\`echo "\[$]1" | sed -e 's/[[0-9]]*\.dll[$]/.dll.lib/'\` -+ shift -+ my_ld=\[$]1 -+ shift -+ cat <<-EOF -+ Linking shared library -+ ** SHARED LIB \$SHARED_LIB -+ ** IMPORT_LIB \$IMPORT_LIB -+EOF -+ args=\$(echo \[$]* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g") -+ exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args -+ mv "\${IMPORT_LIB}" "\${IMPORT_LIB}" -+CF_EOF -+ chmod +x mk_shared_lib.sh -+ cat >mk_prog.sh <<-CF_EOF -+ #!$SHELL -+ shift -+ # Ignore first argument (compiler) and use LD (link.exe) unconditionally -+ LD="[$]LD" -+ clopts=() -+ ldopts=("/subsystem:console") -+ libs=() -+ isdll=0 -+ while test \[$]# -gt 0; do -+ case "\[$]1" in -+ -link | -MT | -MD | -MTd | -MDd) -+ # ignore -link argument -+ ;; -+ -dll) -+ isdll=1 -+ ;; -+ -W* | -w*) -+ # ignore warnings -+ ;; -+ -D*) -+ clopts+=("\[$]1") -+ ;; -+ -I*) -+ clopts+=("\[$]1") -+ ;; -+ -l*) -+ libs+=("\`echo \"\[$]1\" | sed \"s/^-l//\"\`") -+ ;; -+ -L*) -+ ldopts+=("\`echo \"\[$]1\" | sed \"s/^-L/-LIBPATH:/\"\`") -+ ;; -+ *.obj | *.o) -+ ldopts+=("\[$]1") -+ ;; -+ -Wl,*) -+ for linkarg in \`echo '\[$]1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do -+ ldopts+=("\[$]{linkarg}") -+ done -+ ;; -+ *.lib) -+ ldopts+=("\[$]1") -+ ;; -+ -o) -+ shift -+ ldopts+=("-out:\[$]1") -+ ;; -+ *) -+ clopts+=("\[$]1") -+ ldopts+=("\[$]1") -+ ;; -+ esac -+ shift -+ done -+ if [[ "\$isdll" -ne 0 ]]; then -+ for lib in \[$]{libs[[*]]}; do -+ ldopts+=("\[$]lib.dll.lib") -+ done -+ else -+ for lib in \[$]{libs[[*]]}; do -+ ldopts+=("\[$]lib.lib") -+ done -+ fi -+ cat <<-EOF -+ Creating program -+ ** ld options: "\[$]{ldopts[[@]]}" -+EOF -+ exec \[$]LD \[$]{ldopts[[@]]} -+CF_EOF -+ chmod +x mk_prog.sh -+ LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh" -+ ;; - (mingw*) - cf_cv_shlib_version=mingw - cf_cv_shlib_version_infix=mingw ---- configure.in -+++ configure.in -@@ -2181,6 +2181,17 @@ fi - fi - WITH_OVERWRITE=$with_overwrite - -+### At least on MinGW a shared library build without libtool -+### requires adding the additional libs to the link list. -+case $cf_cv_system_name in -+(*mingw32*|*mingw64*) -+ if test "$DFT_LWR_MODEL" != "libtool"; then -+ SHLIB_LIST="$SHLIB_LIST ${LIBS}" -+ fi -+ ;; -+*) ;; -+esac -+ - AC_SUBST(WITH_OVERWRITE) - AC_SUBST(TICS_LIST) - AC_SUBST(TINFO_LIST) -diff --git a/mk-1st.awk b/mk-1st.awk -index 480baad6..b6b7b06d 100644 ---- a/mk-1st.awk -+++ b/mk-1st.awk -@@ -75,7 +75,9 @@ function lib_name_of(a_name) { - function imp_name_of(a_name) { - if (ShlibVerInfix == "cygdll" || ShlibVerInfix == "msysdll" || ShlibVerInfix == "mingw") { - result = sprintf("%s%s%s.a", prefix, a_name, suffix); -- } else { -+ } else if (ShlibVerInfix == "msvcdll") { -+ result = sprintf("%s%s%s.lib", prefix, a_name, suffix); -+ } else{ - result = ""; - } - return result; -@@ -86,7 +88,7 @@ function abi_name_of(a_name) { - result = sprintf("%s%s$(ABI_VERSION)%s", "cyg", a_name, suffix); - } else if (ShlibVerInfix == "msysdll") { - result = sprintf("%s%s$(ABI_VERSION)%s", "msys-", a_name, suffix); -- } else if (ShlibVerInfix == "mingw") { -+ } else if (ShlibVerInfix == "mingw" || ShlibVerInfix == "msvcdll") { - result = sprintf("%s%s$(ABI_VERSION)%s", prefix, a_name, suffix); - } else if (ShlibVerInfix == "yes") { - result = sprintf("%s%s.$(ABI_VERSION)%s", prefix, a_name, suffix); -@@ -101,7 +103,7 @@ function rel_name_of(a_name) { - result = sprintf("%s%s$(REL_VERSION)%s", "cyg", a_name, suffix); - } else if (ShlibVerInfix == "msysdll") { - result = sprintf("%s%s$(ABI_VERSION)%s", "msys-", a_name, suffix); -- } else if (ShlibVerInfix == "mingw") { -+ } else if (ShlibVerInfix == "mingw" || ShlibVerInfix == "msvcdll") { - result = sprintf("%s%s$(REL_VERSION)%s", prefix, a_name, suffix); - } else if (ShlibVerInfix == "yes") { - result = sprintf("%s%s.$(REL_VERSION)%s", prefix, a_name, suffix); -@@ -119,7 +121,7 @@ function end_name_of(a_name) { - } else { - if ( ShlibVer == "rel" ) { - result = rel_name_of(a_name); -- } else if ( ShlibVer == "abi" || ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" ) { -+ } else if ( ShlibVer == "abi" || ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || ShlibVer == "msvcdll" ) { - result = abi_name_of(a_name); - } else { - result = lib_name_of(a_name); -@@ -175,7 +177,7 @@ function make_shlib(objs, shlib_list) { - printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(%s)\n", objs, shlib_list - } - function sharedlinks(directory) { -- if ( ShlibVer != "auto" && ShlibVer != "cygdll" && ShlibVer != "msysdll" && ShlibVer != "mingw" ) { -+ if ( ShlibVer != "auto" && ShlibVer != "cygdll" && ShlibVer != "msysdll" && ShlibVer != "mingw" && ShlibVer != "msvcdll" ) { - printf "\tcd %s && (", directory - if ( DoLinks == "reverse" ) { - if ( ShlibVer == "rel" ) { -@@ -375,7 +377,7 @@ END { - print "install \\" - print "install.libs \\" - -- if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw") { -+ if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || ShlibVer == "msvcdll") { - - dst_dirs = "$(DESTDIR)$(bindir) $(DESTDIR)$(libdir)"; - printf "install.%s :: %s $(LIBRARIES)\n", name, dst_dirs -@@ -396,8 +398,13 @@ END { - - if ( overwrite == "yes" && name == "ncurses" ) - { -- if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw") { -- ovr_name = sprintf("libcurses%s.a", suffix) -+ if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || SlibVer == "msvcdll") { -+ if (ShlibVer == "msvcdll") { -+ curses_prefix = "" -+ } else { -+ curses_prefix = "lib" -+ } -+ ovr_name = sprintf("%scurses%s.a", curses_prefix, suffix) - printf "\t@echo linking %s to %s\n", imp_name, ovr_name - printf "\tcd $(DESTDIR)$(libdir) && (" - symlink(imp_name, ovr_name) -@@ -417,7 +424,7 @@ END { - print "uninstall \\" - print "uninstall.libs \\" - printf "uninstall.%s ::\n", name -- if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw") { -+ if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || ShlibVer == "msvcdll") { - - printf "\t@echo uninstalling $(DESTDIR)$(bindir)/%s\n", end_name - printf "\t-@rm -f $(DESTDIR)$(bindir)/%s\n", end_name --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0013-Fix-lib_gen.c.patch b/recipes/ncurses/all/patches/6.2.0-0013-Fix-lib_gen.c.patch deleted file mode 100644 index 591da3292bdf0..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0013-Fix-lib_gen.c.patch +++ /dev/null @@ -1,45 +0,0 @@ -Upstreamed in 3e37c7d3fa122563a9d88168926f61286ef30cd3 - -ncurses 6.2 - patch 20200523 - -From 2735f43727f8cef9edb406dc361a51014807788c Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Wed, 26 Feb 2020 19:24:16 +0100 -Subject: [PATCH 13/15] Fix lib_gen.c - -Fixes these kind of errors on MSVC -../ncurses/lib_gen.c(23): error C2059: syntax error: '(' - -(required for static build) - -../ncurses/lib_gen.c(30): error C2059: syntax error: '(' -../ncurses/lib_gen.c(37): error C2059: syntax error: '(' -../ncurses/lib_gen.c(44): error C2059: syntax error: '(' -../ncurses/lib_gen.c(51): error C2059: syntax error: '(' -../ncurses/lib_gen.c(58): error C2059: syntax error: '(' -../ncurses/lib_gen.c(65): error C2059: syntax error: '(' -../ncurses/lib_gen.c(72): error C2059: syntax error: '(' -../ncurses/lib_gen.c(79): error C2059: syntax error: '(' -../ncurses/lib_gen.c(86): error C2059: syntax error: '(' -(and more) - ---- - ncurses/base/MKlib_gen.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh -index 5a3770e5..5e646e66 100755 ---- a/ncurses/base/MKlib_gen.sh -+++ b/ncurses/base/MKlib_gen.sh -@@ -178,7 +178,7 @@ EOF3 - - if test "$USE" = generated ; then - cat >$ED4 < -Date: Mon, 16 Mar 2020 11:01:28 +0100 -Subject: [PATCH 14/15] avoid macro expansion in args by defining - NCURSES_NOMACROS in ncurses/lib_gen.c - -Macro expansion from macros in curses.h(.in) will lead to: - -spec(dllexport) int __cdecl -waddchnstr(stdscr,(const chtype * z),-1) -{ - ; - return waddchnstr(stdscr,(z),-1); -} - -__declspec(dllexport) int __cdecl -waddnstr(stdscr,(const char * a1),(int z)) -{ - ; - return waddnstr(stdscr,(a1),(z)); -} - -__declspec(dllexport) int __cdecl -waddnstr(stdscr,(const char * z),-1) -{ - ; - return waddnstr(stdscr,(z),-1); -} - ---- - ncurses/base/MKlib_gen.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh -index 5e646e66..f57cd55f 100755 ---- a/ncurses/base/MKlib_gen.sh -+++ b/ncurses/base/MKlib_gen.sh -@@ -432,7 +432,7 @@ BEGIN { - print "#define NCURSES_ATTR_T int" - print "#include " - print "" -- print "#undef NCURSES_NOMACROS /* _this_ file uses macros */" -+ print "#define NCURSES_NOMACROS 1" - print "" - print "#include " - print "" --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0015-MSVC-access-does-not-support-X_OK.patch b/recipes/ncurses/all/patches/6.2.0-0015-MSVC-access-does-not-support-X_OK.patch deleted file mode 100644 index 76f47d3a9f588..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0015-MSVC-access-does-not-support-X_OK.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- ncurses/tinfo/access.c -+++ ncurses/tinfo/access.c -@@ -41,6 +41,13 @@ - - #define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c)) - -+#ifdef _MSC_VER -+# define ACCESS(FN, MODE) access((FN), (MODE)&(R_OK|W_OK)) -+#else -+# define ACCESS access -+#endif -+ -+ - NCURSES_EXPORT(char *) - _nc_rootname(char *path) - { -@@ -112,7 +119,7 @@ - - if (path == 0) { - result = -1; -- } else if (access(path, mode) < 0) { -+ } else if (ACCESS(path, mode) < 0) { - if ((mode & W_OK) != 0 - && errno == ENOENT - && strlen(path) < PATH_MAX) { -@@ -127,7 +134,7 @@ _nc_access(const char *path, int mode) - if (head == leaf) - _nc_STRCPY(head, ".", sizeof(head)); - -- result = access(head, R_OK | W_OK | X_OK); -+ result = ACCESS(head, R_OK | W_OK | X_OK); - } else { - result = -1; - } diff --git a/recipes/ncurses/all/patches/6.2.0-0016-msvc-has-wchar-support.patch b/recipes/ncurses/all/patches/6.2.0-0016-msvc-has-wchar-support.patch deleted file mode 100644 index 919d4eb50dbff..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0016-msvc-has-wchar-support.patch +++ /dev/null @@ -1,34 +0,0 @@ -d61c3c6a ("ncurses 6.2 - patch 20200711", 2020-07-12) - ---- a/ncurses/curses.priv.h -+++ b/ncurses/curses.priv.h -@@ -2343,7 +2343,7 @@ extern NCURSES_EXPORT(int) _nc_eventlist_timeout(_nc_eventlist *); - */ - #if USE_WIDEC_SUPPORT - --#if defined(_WIN32) -+#if defined(_WIN32) && !defined(_MSC_VER) - /* - * MinGW has wide-character functions, but they do not work correctly. - */ ---- a/ncurses/widechar/lib_cchar.c -+++ b/ncurses/widechar/lib_cchar.c -@@ -35,6 +35,7 @@ - */ - - #include -+#include - - MODULE_ID("$Id: lib_cchar.c,v 1.33 2020/02/02 23:34:34 tom Exp $") - ---- a/ncurses/widechar/widechars.c -+++ b/ncurses/widechar/widechars.c -@@ -33,7 +33,7 @@ - - MODULE_ID("$Id: widechars.c,v 1.7 2020/02/02 23:34:34 tom Exp $") - --#if defined(_WIN32) -+#if defined(_WIN32) && !defined(_MSC_VER) - /* - * MinGW has wide-character functions, but they do not work correctly. - */ diff --git a/recipes/ncurses/all/patches/6.2.0-0017-msvc-fix-tests.patch b/recipes/ncurses/all/patches/6.2.0-0017-msvc-fix-tests.patch deleted file mode 100644 index f5276b3ee5fda..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0017-msvc-fix-tests.patch +++ /dev/null @@ -1,50 +0,0 @@ -d61c3c6a ("ncurses 6.2 - patch 20200711", 2020-07-12) - ---- test/picsmap.c -+++ test/picsmap.c -@@ -955,6 +955,20 @@ parse_rgb(char **data) - return result; - } - -+#define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c)) -+ -+static int -+CaselessCmp(const char *a, const char *b) -+{ /* strcasecmp isn't portable */ -+ while (*a && *b) { -+ int cmp = LOWERCASE(*a) - LOWERCASE(*b); -+ if (cmp != 0) -+ break; -+ a++, b++; -+ } -+ return LOWERCASE(*a) - LOWERCASE(*b); -+} -+ - static RGB_NAME * - lookup_rgb(const char *name) - { -@@ -962,7 +976,7 @@ lookup_rgb(const char *name) - if (rgb_table != 0) { - int n; - for (n = 0; rgb_table[n].name != 0; ++n) { -- if (!strcasecmp(name, rgb_table[n].name)) { -+ if (!CaselessCmp(name, rgb_table[n].name)) { - result = &rgb_table[n]; - break; - } ---- test/test.priv.h -+++ test/test.priv.h -@@ -437,6 +437,13 @@ extern int optind; - #include - #include - -+#if defined(_MSC_VER) -+#undef popen -+#define popen(s,n) _popen(s,n) -+#undef pclose -+#define pclose(s) _pclose(s) -+#endif -+ - #ifndef GCC_NORETURN - #define GCC_NORETURN /* nothing */ - #endif diff --git a/recipes/ncurses/all/patches/6.2.0-0018-missing-functions-c-linkage.patch b/recipes/ncurses/all/patches/6.2.0-0018-missing-functions-c-linkage.patch deleted file mode 100644 index a47d3777212a3..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0018-missing-functions-c-linkage.patch +++ /dev/null @@ -1,25 +0,0 @@ - ---- include/nc_mingw.h -+++ include/nc_mingw.h -@@ -62,6 +62,10 @@ - - #include - -+#ifdef __cplusplus -+extern "C" { -+#endif -+ - NCURSES_EXPORT(int) _nc_gettimeofday(struct timeval *, void *); - - #undef HAVE_GETTIMEOFDAY -@@ -75,6 +79,10 @@ - #define wcwidth(ucs) _nc_wcwidth((wchar_t)(ucs)) - NCURSES_EXPORT(int) _nc_wcwidth(wchar_t); - -+#ifdef __cplusplus -+} -+#endif -+ - #endif /* _WIN32 */ - - #endif /* NC_MINGW_H */ diff --git a/recipes/ncurses/all/patches/6.2.0-0019-Run-autoreconf.patch b/recipes/ncurses/all/patches/6.2.0-0019-Run-autoreconf.patch deleted file mode 100644 index ec7887edfac48..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0019-Run-autoreconf.patch +++ /dev/null @@ -1,565 +0,0 @@ ---- configure -+++ configure -@@ -4750,49 +4750,65 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - -- cf_cv_ar_flags=unknown -- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv -- do -+ case $cf_cv_system_name in -+ (*-msvc*) -+ cf_cv_ar_flags='' -+ cat >mk_static_lib.sh <<-EOF -+ #!$SHELL -+ MSVC_BIN="$AR" -+ out="\$1" -+ shift -+ exec \$MSVC_BIN -out:"\$out" \$@ -+ EOF -+ chmod +x mk_static_lib.sh -+ AR=`pwd`/mk_static_lib.sh -+ ;; -+ (*) -+ cf_cv_ar_flags=unknown -+ for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv -+ do - -- # check if $ARFLAGS already contains this choice -- if test "x$ARFLAGS" != "x" ; then -- cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` -- if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then -- cf_cv_ar_flags= -- break -+ # check if $ARFLAGS already contains this choice -+ if test "x$ARFLAGS" != "x" ; then -+ cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` -+ if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then -+ cf_cv_ar_flags= -+ break -+ fi - fi -- fi - -- rm -f conftest.$ac_cv_objext -- rm -f conftest.a -+ rm -f conftest.$ac_cv_objext -+ rm -f conftest.a - -- cat >conftest.$ac_ext <&5 -+ cat >conftest.$ac_ext <<-EOF -+ #line 4784 "configure" -+ int testdata[3] = { 123, 456, 789 }; -+ EOF -+ if { (eval echo "$as_me:4787: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? -- echo "$as_me:4776: \$? = $ac_status" >&5 -+ echo "$as_me:4790: \$? = $ac_status" >&5 - (exit $ac_status); } ; then -- echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 -- $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null -- if test -f conftest.a ; then -- cf_cv_ar_flags=$cf_ar_flags -- break -- fi -- else -- test -n "$verbose" && echo " cannot compile test-program" 1>&6 -+ echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 -+ $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null -+ if test -f conftest.a ; then -+ cf_cv_ar_flags=$cf_ar_flags -+ break -+ fi -+ else -+ test -n "$verbose" && echo " cannot compile test-program" 1>&6 - --echo "${as_me:-configure}:4787: testing cannot compile test-program ..." 1>&5 -+echo "${as_me:-configure}:4801: testing cannot compile test-program ..." 1>&5 - -- break -- fi -- done -- rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext -+ break -+ fi -+ done -+ rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext -+ ;; -+ esac - - fi --echo "$as_me:4795: result: $cf_cv_ar_flags" >&5 -+echo "$as_me:4811: result: $cf_cv_ar_flags" >&5 - echo "${ECHO_T}$cf_cv_ar_flags" >&6 - - if test -n "$ARFLAGS" ; then -@@ -5474,6 +5490,9 @@ - LIB_PREFIX='' - fi - ;; -+ (*-msvc*) -+ LIB_PREFIX='' -+ ;; - (*) LIB_PREFIX='lib' - ;; - esac -@@ -5961,6 +5980,110 @@ - - MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' - ;; -+ (mingw*msvc*) -+ LDFLAGS="$LDFLAGS user32.lib" -+ export LDFLAGS -+ cf_cv_shlib_version=msvcdll -+ cf_cv_shlib_version_infix=msvcdll -+ shlibdir=$bindir -+ MAKE_DLLS= -+ if test "$DFT_LWR_MODEL" = "shared" ; then -+ LOCAL_LDFLAGS="-link -dll" -+ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" -+ EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS" -+ fi -+ CC_SHARED_OPTS= -+ MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}' -+ RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib" -+ cat >mk_shared_lib.sh <<-CF_EOF -+ #!$SHELL -+ SHARED_LIB=\$1 -+ IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\` -+ shift -+ my_ld=\$1 -+ shift -+ cat <<-EOF -+ Linking shared library -+ ** SHARED LIB \$SHARED_LIB -+ ** IMPORT_LIB \$IMPORT_LIB -+EOF -+ args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g") -+ exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args -+ mv "\${IMPORT_LIB}" "\${IMPORT_LIB}" -+CF_EOF -+ chmod +x mk_shared_lib.sh -+ cat >mk_prog.sh <<-CF_EOF -+ #!$SHELL -+ shift -+ # Ignore first argument (compiler) and use LD (link.exe) unconditionally -+ LD="$LD" -+ clopts=() -+ ldopts=("/subsystem:console") -+ libs=() -+ isdll=0 -+ while test \$# -gt 0; do -+ case "\$1" in -+ -link | -MT | -MD | -MTd | -MDd) -+ # ignore -link argument -+ ;; -+ -dll) -+ isdll=1 -+ ;; -+ -W* | -w*) -+ # ignore warnings -+ ;; -+ -D*) -+ clopts+=("\$1") -+ ;; -+ -I*) -+ clopts+=("\$1") -+ ;; -+ -l*) -+ libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`") -+ ;; -+ -L*) -+ ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`") -+ ;; -+ *.obj | *.o) -+ ldopts+=("\$1") -+ ;; -+ -Wl,*) -+ for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do -+ ldopts+=("\${linkarg}") -+ done -+ ;; -+ *.lib) -+ ldopts+=("\$1") -+ ;; -+ -o) -+ shift -+ ldopts+=("-out:\$1") -+ ;; -+ *) -+ clopts+=("\$1") -+ ldopts+=("\$1") -+ ;; -+ esac -+ shift -+ done -+ if [ "\$isdll" -ne 0 ]; then -+ for lib in \${libs[*]}; do -+ ldopts+=("\$lib.dll.lib") -+ done -+ else -+ for lib in \${libs[*]}; do -+ ldopts+=("\$lib.lib") -+ done -+ fi -+ cat <<-EOF -+ Creating program -+ ** ld options: "\${ldopts[@]}" -+EOF -+ exec \$LD \${ldopts[@]} -+CF_EOF -+ chmod +x mk_prog.sh -+ LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh" -+ ;; - (mingw*) - cf_cv_shlib_version=mingw - cf_cv_shlib_version_infix=mingw -@@ -7516,26 +7639,26 @@ - - # either way, check for the library header files - --for ac_header in pcre2-posix.h pcreposix.h -+for ac_header in pcre2posix.h pcreposix.h - do - as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` --echo "$as_me:7522: checking for $ac_header" >&5 -+echo "$as_me:7643: checking for $ac_header" >&5 - echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 - if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line 7528 "configure" -+#line 7649 "configure" - #include "confdefs.h" - #include <$ac_header> - _ACEOF --if { (eval echo "$as_me:7532: \"$ac_cpp conftest.$ac_ext\"") >&5 -+if { (eval echo "$as_me:7653: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 -- echo "$as_me:7538: \$? = $ac_status" >&5 -+ echo "$as_me:7659: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag -@@ -9897,7 +10018,7 @@ - rm -f conftest.$ac_objext conftest.$ac_ext - fi - --echo "${as_me:-configure}:9900: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 -+echo "${as_me:-configure}:10021: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 - - CFLAGS="$cf_trim_CFLAGS" - CPPFLAGS="$cf_trim_CPPFLAGS" -@@ -25163,11 +25286,25 @@ - DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX - ;; - (Xdebug) -- DFT_LIB_SUFFIX='_g.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ DFT_LIB_SUFFIX='_g.lib' -+ ;; -+ (*) -+ DFT_LIB_SUFFIX='_g.a' -+ ;; -+ esac - DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX - ;; - (Xprofile) -- DFT_LIB_SUFFIX='_p.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ DFT_LIB_SUFFIX='_p.lib' -+ ;; -+ (*) -+ DFT_LIB_SUFFIX='_p.a' -+ ;; -+ esac - DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX - ;; - (Xshared) -@@ -25176,6 +25313,10 @@ - DFT_LIB_SUFFIX='.so' - DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX - ;; -+ (*-msvc*) -+ DFT_LIB_SUFFIX='.dll' -+ DFT_DEP_SUFFIX='.dll.lib' -+ ;; - (cygwin*|msys*|mingw*) - DFT_LIB_SUFFIX='.dll' - DFT_DEP_SUFFIX='.dll.a' -@@ -25203,7 +25344,14 @@ - esac - ;; - (*) -- DFT_LIB_SUFFIX='.a' -+ case $target in -+ (*-msvc*) -+ DFT_LIB_SUFFIX='.lib' -+ ;; -+ (*) -+ DFT_LIB_SUFFIX='.a' -+ ;; -+ esac - DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX - ;; - esac -@@ -25252,11 +25400,25 @@ - CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX - ;; - (Xdebug) -- CXX_LIB_SUFFIX='_g.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ CXX_LIB_SUFFIX='_g.lib' -+ ;; -+ (*) -+ CXX_LIB_SUFFIX='_g.a' -+ ;; -+ esac - CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX - ;; - (Xprofile) -- CXX_LIB_SUFFIX='_p.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ CXX_LIB_SUFFIX='_p.lib' -+ ;; -+ (*) -+ CXX_LIB_SUFFIX='_p.a' -+ ;; -+ esac - CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX - ;; - (Xshared) -@@ -25265,6 +25427,10 @@ - CXX_LIB_SUFFIX='.so' - CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX - ;; -+ (*-msvc*) -+ CXX_LIB_SUFFIX='.dll' -+ CXX_DEP_SUFFIX='.dll.lib' -+ ;; - (cygwin*|msys*|mingw*) - CXX_LIB_SUFFIX='.dll' - CXX_DEP_SUFFIX='.dll.a' -@@ -25292,7 +25458,14 @@ - esac - ;; - (*) -- CXX_LIB_SUFFIX='.a' -+ case $target in -+ (*-msvc*) -+ CXX_LIB_SUFFIX='.lib' -+ ;; -+ (*) -+ CXX_LIB_SUFFIX='.a' -+ ;; -+ esac - CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX - ;; - esac -@@ -25586,12 +25759,23 @@ - if test "$with_overwrite" != no ; then - if test "$NCURSES_LIBUTF8" = 1 ; then - NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)' -- { echo "$as_me:25589: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 -+ { echo "$as_me:25760: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 - echo "$as_me: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&2;} - fi - fi - WITH_OVERWRITE=$with_overwrite - -+### At least on MinGW a shared library build without libtool -+### requires adding the additional libs to the link list. -+case $cf_cv_system_name in -+(*mingw32*|*mingw64*) -+ if test "$DFT_LWR_MODEL" != "libtool"; then -+ SHLIB_LIST="$SHLIB_LIST ${LIBS}" -+ fi -+ ;; -+*) ;; -+esac -+ - # used to separate tack out of the tree - NCURSES_TREE= - -@@ -26124,7 +26308,7 @@ - #define HAVE_CURSES_DATA_BOOLNAMES 1 - EOF - --ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/ncurses_dll.h include/termcap.h include/unctrl.h $SUB_MAKEFILES Makefile" -+ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/ncurses_dll.h include/ncurses_exports.h include/termcap.h include/unctrl.h $SUB_MAKEFILES Makefile" - ac_config_commands="$ac_config_commands default" - cat >confcache <<\_ACEOF - # This file is a shell script that caches the results of configure -@@ -26513,13 +26697,14 @@ - "include/MKterm.h.awk" ) CONFIG_FILES="$CONFIG_FILES include/MKterm.h.awk" ;; - "include/curses.head" ) CONFIG_FILES="$CONFIG_FILES include/curses.head:include/curses.h.in" ;; - "include/ncurses_dll.h" ) CONFIG_FILES="$CONFIG_FILES include/ncurses_dll.h" ;; -+ "include/ncurses_exports.h" ) CONFIG_FILES="$CONFIG_FILES include/ncurses_exports.h" ;; - "include/termcap.h" ) CONFIG_FILES="$CONFIG_FILES include/termcap.h" ;; - "include/unctrl.h" ) CONFIG_FILES="$CONFIG_FILES include/unctrl.h" ;; - "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;; - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; -- *) { { echo "$as_me:26522: error: invalid argument: $ac_config_target" >&5 -+ *) { { echo "$as_me:26705: error: invalid argument: $ac_config_target" >&5 - echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -@@ -27317,7 +27502,7 @@ - cf_prefix=$LIB_PREFIX - - case $cf_cv_shlib_version in --(cygdll|msysdll|mingw) -+(cygdll|msysdll|mingw|msvcdll) - TINFO_NAME=$TINFO_ARG_SUFFIX - TINFO_SUFFIX=.dll - ;; -@@ -27390,11 +27575,25 @@ - cf_depsuf=$cf_suffix - ;; - (Xdebug) -- cf_suffix='_g.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ cf_suffix='_g.lib' -+ ;; -+ (*) -+ cf_suffix='_g.a' -+ ;; -+ esac - cf_depsuf=$cf_suffix - ;; - (Xprofile) -- cf_suffix='_p.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ cf_suffix='_p.lib' -+ ;; -+ (*) -+ cf_suffix='_p.a' -+ ;; -+ esac - cf_depsuf=$cf_suffix - ;; - (Xshared) -@@ -27403,6 +27602,10 @@ - cf_suffix='.so' - cf_depsuf=$cf_suffix - ;; -+ (*-msvc*) -+ cf_suffix='.dll' -+ cf_depsuf='.dll.lib' -+ ;; - (cygwin*|msys*|mingw*) - cf_suffix='.dll' - cf_depsuf='.dll.a' -@@ -27430,7 +27633,14 @@ - esac - ;; - (*) -- cf_suffix='.a' -+ case $target in -+ (*-msvc*) -+ cf_suffix='.lib' -+ ;; -+ (*) -+ cf_suffix='.a' -+ ;; -+ esac - cf_depsuf=$cf_suffix - ;; - esac -@@ -27496,6 +27706,10 @@ - cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` - cf_add_lib="../lib/lib${cf_libname}${cf_cygsuf}" - ;; -+ (msvcdll) -+ cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` -+ cf_add_lib="../lib/${cf_libname}${cf_cygsuf}" -+ ;; - (*) - cf_add_lib= - ;; -@@ -27592,10 +27806,10 @@ - CXX_MODEL=$cf_ITEM - if test "$CXX_MODEL" = SHARED; then - case $cf_cv_shlib_version in -- (cygdll|msysdll|mingw) -+ (cygdll|msysdll|mingw|msvcdll) - test "x$with_shared_cxx" = xno && test -n "$verbose" && echo " overriding CXX_MODEL to SHARED" 1>&6 - --echo "${as_me:-configure}:27598: testing overriding CXX_MODEL to SHARED ..." 1>&5 -+echo "${as_me:-configure}:27810: testing overriding CXX_MODEL to SHARED ..." 1>&5 - - with_shared_cxx=yes - ;; -@@ -27611,11 +27825,25 @@ - cf_depsuf=$cf_suffix - ;; - (Xdebug) -- cf_suffix='_g.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ cf_suffix='_g.lib' -+ ;; -+ (*) -+ cf_suffix='_g.a' -+ ;; -+ esac - cf_depsuf=$cf_suffix - ;; - (Xprofile) -- cf_suffix='_p.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ cf_suffix='_p.lib' -+ ;; -+ (*) -+ cf_suffix='_p.a' -+ ;; -+ esac - cf_depsuf=$cf_suffix - ;; - (Xshared) -@@ -27624,6 +27852,10 @@ - cf_suffix='.so' - cf_depsuf=$cf_suffix - ;; -+ (*-msvc*) -+ cf_suffix='.dll' -+ cf_depsuf='.dll.lib' -+ ;; - (cygwin*|msys*|mingw*) - cf_suffix='.dll' - cf_depsuf='.dll.a' -@@ -27651,7 +27883,14 @@ - esac - ;; - (*) -- cf_suffix='.a' -+ case $target in -+ (*-msvc*) -+ cf_suffix='.lib' -+ ;; -+ (*) -+ cf_suffix='.a' -+ ;; -+ esac - cf_depsuf=$cf_suffix - ;; - esac diff --git a/recipes/ncurses/config.yml b/recipes/ncurses/config.yml index 1c6db8931421d..8ccaa404ee598 100644 --- a/recipes/ncurses/config.yml +++ b/recipes/ncurses/config.yml @@ -1,7 +1,7 @@ versions: + "6.5": + folder: all "6.4": folder: all "6.3": folder: all - "6.2": - folder: all diff --git a/recipes/netcdf/all/conandata.yml b/recipes/netcdf/all/conandata.yml index c96fc1ea18103..e6119be629931 100644 --- a/recipes/netcdf/all/conandata.yml +++ b/recipes/netcdf/all/conandata.yml @@ -10,7 +10,13 @@ patches: - patch_file: "patches/4.7.4-0001-fix-cmake.patch" patch_description: "fixes for cmake target_link_libraries and using deps" patch_type: "conan" + - patch_file: "patches/4.7.4-0002-fix-cross-compile.patch" + patch_description: "fixes 'Unable to find the math library' when cross compiling" + patch_type: "conan" "4.8.1": - patch_file: "patches/4.8.1-0001-fix-cmake.patch" patch_description: "fixes for cmake target_link_libraries and using deps" patch_type: "conan" + - patch_file: "patches/4.8.1-0002-fix-cross-compile.patch" + patch_description: "fixes 'Unable to find the math library' when cross compiling" + patch_type: "conan" diff --git a/recipes/netcdf/all/conanfile.py b/recipes/netcdf/all/conanfile.py index 44608e3405cb8..748b4bb9a8744 100644 --- a/recipes/netcdf/all/conanfile.py +++ b/recipes/netcdf/all/conanfile.py @@ -75,6 +75,7 @@ def requirements(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) @@ -95,7 +96,6 @@ def generate(self): tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/netcdf/all/patches/4.7.4-0002-fix-cross-compile.patch b/recipes/netcdf/all/patches/4.7.4-0002-fix-cross-compile.patch new file mode 100644 index 0000000000000..6c157604fa80f --- /dev/null +++ b/recipes/netcdf/all/patches/4.7.4-0002-fix-cross-compile.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 80a986f..7e398ba 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -864,7 +864,11 @@ ENDIF() + + # Check for the math library so it can be explicitly linked. + IF(NOT WIN32) +- FIND_LIBRARY(HAVE_LIBM NAMES math m libm) ++ INCLUDE(CheckLibraryExists) ++ CHECK_LIBRARY_EXISTS(m log "" CAN_LINK_LIBM) ++ IF(CAN_LINK_LIBM) ++ SET(HAVE_LIBM m) ++ ENDIF() + MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}") + IF(NOT HAVE_LIBM) + MESSAGE(FATAL_ERROR "Unable to find the math library.") diff --git a/recipes/netcdf/all/patches/4.8.1-0002-fix-cross-compile.patch b/recipes/netcdf/all/patches/4.8.1-0002-fix-cross-compile.patch new file mode 100644 index 0000000000000..1b07967b34210 --- /dev/null +++ b/recipes/netcdf/all/patches/4.8.1-0002-fix-cross-compile.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fd6713d..c6312b2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -938,7 +938,11 @@ OPTION(ENABLE_BYTERANGE "Enable byte-range access to remote datasets.." OFF) + + # Check for the math library so it can be explicitly linked. + IF(NOT WIN32) +- FIND_LIBRARY(HAVE_LIBM NAMES math m libm) ++ INCLUDE(CheckLibraryExists) ++ CHECK_LIBRARY_EXISTS(m log "" CAN_LINK_LIBM) ++ IF(CAN_LINK_LIBM) ++ SET(HAVE_LIBM m) ++ ENDIF() + MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}") + IF(NOT HAVE_LIBM) + MESSAGE(FATAL_ERROR "Unable to find the math library.") diff --git a/recipes/nghttp3/all/conandata.yml b/recipes/nghttp3/all/conandata.yml index d0fe8bd38465c..44b63e4bfe7f1 100644 --- a/recipes/nghttp3/all/conandata.yml +++ b/recipes/nghttp3/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.4.0": + url: "https://github.com/ngtcp2/nghttp3/releases/download/v1.4.0/nghttp3-1.4.0.tar.bz2" + sha256: "bf8fbb4242cff0feb10b3e0d02545a8ad9a71d932f877a57a592bfde62a26019" + "1.3.0": + url: "https://github.com/ngtcp2/nghttp3/releases/download/v1.3.0/nghttp3-1.3.0.tar.bz2" + sha256: "1f6bda74a888bfeb110a660a04b2ea25b756e0774d48143e34374af83d25e4a8" "1.2.0": url: "https://github.com/ngtcp2/nghttp3/releases/download/v1.2.0/nghttp3-1.2.0.tar.bz2" sha256: "da1bc26af1fd8756b59883c256153d2f41064294750454ee4c970fe087a70056" diff --git a/recipes/nghttp3/all/conanfile.py b/recipes/nghttp3/all/conanfile.py index 85e3ee603cc88..9fbb63e061dc5 100644 --- a/recipes/nghttp3/all/conanfile.py +++ b/recipes/nghttp3/all/conanfile.py @@ -56,6 +56,7 @@ def generate(self): if is_apple_os(self): # workaround for: install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False + tc.variables["BUILD_TESTING"] = False tc.generate() tc = VirtualBuildEnv(self) tc.generate(scope="build") @@ -72,6 +73,7 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.libs = ["nghttp3"] diff --git a/recipes/nghttp3/config.yml b/recipes/nghttp3/config.yml index 3550769ed467e..f9cd212790c2d 100644 --- a/recipes/nghttp3/config.yml +++ b/recipes/nghttp3/config.yml @@ -1,4 +1,8 @@ versions: + "1.4.0": + folder: all + "1.3.0": + folder: all "1.2.0": folder: all "1.1.0": diff --git a/recipes/nifti_clib/all/conandata.yml b/recipes/nifti_clib/all/conandata.yml new file mode 100644 index 0000000000000..1821fa5866772 --- /dev/null +++ b/recipes/nifti_clib/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.0.0": + url: "https://github.com/NIFTI-Imaging/nifti_clib/archive/refs/tags/v3.0.0.tar.gz" + sha256: "fe6cb1076974df01844f3f4dab1aa844953b3bc1d679126c652975158573d03d" diff --git a/recipes/nifti_clib/all/conanfile.py b/recipes/nifti_clib/all/conanfile.py new file mode 100644 index 0000000000000..14e3e3f3e4960 --- /dev/null +++ b/recipes/nifti_clib/all/conanfile.py @@ -0,0 +1,151 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + + +required_conan_version = ">=1.53.0" + + +class NiftiClibConan(ConanFile): + name = "nifti_clib" + description = "C libraries for NIFTI support" + license = "LicenseRef-LICENSE" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/NIFTI-Imaging/nifti_clib" + topics = ("image") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_nifti2": [True, False], + "use_cifti": [True, False], + "use_fslio": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "use_nifti2": True, + "use_cifti": False, # seems to be beta? + "use_fslio": False # Note in CMakeLists.txt: "If OFF, The copyright of this code is questionable for inclusion with nifti." + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def validate(self): + if is_msvc(self) and self.options.shared: + # not supported due to not having dllexport definitions + raise ConanInvalidConfiguration(f"{self.ref} does not support -o {self.ref}:shared=True with MSVC compiler.") + if not self.options.use_nifti2 and self.options.use_cifti: + raise ConanInvalidConfiguration(f"{self.ref} -o '&:use_cifti=True' requires -o '&:use_nifti2=True'") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/[>=1.2.11 <2]") + if self.options.use_cifti: + self.requires("expat/[>=2.6.2 <3]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["NIFTI_INSTALL_NO_DOCS"] = True + tc.variables["USE_NIFTI2_CODE"] = self.options.use_nifti2 + tc.variables["USE_CIFTI_CODE"] = self.options.use_cifti + tc.variables["USE_FSL_CODE"] = self.options.use_fslio + tc.variables["NIFTI_BUILD_TESTING"] = False # disable building tests + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.preprocessor_definitions["_CRT_SECURE_NO_WARNINGS"] = 1 + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "nifti") + self.cpp_info.set_property("cmake_target_name", "NIFTI::NIFTI") + self.cpp_info.set_property("pkg_config_name", "nifti") + self.cpp_info.includedirs += [ os.path.join("include", "nifti") ] + + sys_libs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + sys_libs += ["m"] + + self.cpp_info.required_components = ["ZLIB::ZLIB"] + if self.options.use_cifti: + self.cpp_info.required_components += ["EXPAT::EXPAT"] + + self.cpp_info.components["znz"].libs = ["znz"] + self.cpp_info.components["znz"].set_property("pkg_config_name", "znz") + self.cpp_info.components["znz"].set_property("cmake_target_name", "NIFTI::znz") + self.cpp_info.components["znz"].includedirs += [os.path.join("include", "nifti")] + self.cpp_info.components["znz"].system_libs += sys_libs + + # inside the niftilib folder + self.cpp_info.components["niftiio"].libs = ["niftiio"] + self.cpp_info.components["niftiio"].set_property("pkg_config_name", "niftiio") + self.cpp_info.components["niftiio"].set_property("cmake_target_name", "NIFTI::niftiio") + self.cpp_info.components["niftiio"].includedirs += [os.path.join("include", "nifti")] + self.cpp_info.components["niftiio"].system_libs += sys_libs + + self.cpp_info.components["nifticdf"].libs = ["nifticdf"] + self.cpp_info.components["nifticdf"].requires = ["niftiio"] + self.cpp_info.components["nifticdf"].set_property("pkg_config_name", "nifticdf") + self.cpp_info.components["nifticdf"].set_property("cmake_target_name", "NIFTI::nifticdf") + self.cpp_info.components["nifticdf"].includedirs += [os.path.join("include", "nifti")] + self.cpp_info.components["nifticdf"].system_libs += sys_libs + + if self.options.use_nifti2: + self.cpp_info.components["nifti2"].libs = ["nifti2"] + self.cpp_info.components["nifti2"].requires = ["znz"] + self.cpp_info.components["nifti2"].set_property("pkg_config_name", "nifti2") + self.cpp_info.components["nifti2"].set_property("cmake_target_name", "NIFTI::nifti2") + self.cpp_info.components["nifti2"].includedirs += [os.path.join("include", "nifti")] + self.cpp_info.components["nifti2"].system_libs += sys_libs + + if self.options.use_cifti: + self.cpp_info.components["cifti"].libs = ["cifti"] + self.cpp_info.components["cifti"].requires = ["nifti2"] + self.cpp_info.components["cifti"].set_property("pkg_config_name", "cifti") + self.cpp_info.components["cifti"].set_property("cmake_target_name", "NIFTI::cifti") + self.cpp_info.components["cifti"].includedirs += [os.path.join("include", "nifti")] + self.cpp_info.components["cifti"].system_libs += sys_libs + + if self.options.use_fslio: + self.cpp_info.components["fslio"].libs = ["fslio"] + self.cpp_info.components["fslio"].requires = ["nifti2"] + self.cpp_info.components["fslio"].set_property("pkg_config_name", "fslio") + self.cpp_info.components["fslio"].set_property("cmake_target_name", "NIFTI::fslio") + self.cpp_info.components["fslio"].includedirs += [os.path.join("include", "nifti")] + self.cpp_info.components["fslio"].system_libs += sys_libs diff --git a/recipes/nifti_clib/all/test_package/CMakeLists.txt b/recipes/nifti_clib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a63a2b6d3fe16 --- /dev/null +++ b/recipes/nifti_clib/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES C) + +find_package(NIFTI 3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) + +target_link_libraries(${PROJECT_NAME} PRIVATE NIFTI::nifticdf) diff --git a/recipes/nifti_clib/all/test_package/conanfile.py b/recipes/nifti_clib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/nifti_clib/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/nifti_clib/all/test_package/test_package.c b/recipes/nifti_clib/all/test_package/test_package.c new file mode 100644 index 0000000000000..c1c849f8faf18 --- /dev/null +++ b/recipes/nifti_clib/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "nifticdf.h" + +// taken from nifti_clib/real_easy/minimal_example_of_downstream_usage +int main(void) { + double input= 7.0; + const double output = alnrel(&input); + + return (output > 0.0) ? EXIT_SUCCESS: EXIT_FAILURE ; +} diff --git a/recipes/nifti_clib/config.yml b/recipes/nifti_clib/config.yml new file mode 100644 index 0000000000000..3a44950f9d81d --- /dev/null +++ b/recipes/nifti_clib/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "3.0.0": + folder: all diff --git a/recipes/ninja/all/conandata.yml b/recipes/ninja/all/conandata.yml index 02891869efb97..36f42c6c69771 100644 --- a/recipes/ninja/all/conandata.yml +++ b/recipes/ninja/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.12.1": + url: "https://github.com/ninja-build/ninja/archive/v1.12.1.tar.gz" + sha256: "821bdff48a3f683bc4bb3b6f0b5fe7b2d647cf65d52aeb63328c91a6c6df285a" + "1.12.0": + url: "https://github.com/ninja-build/ninja/archive/v1.12.0.tar.gz" + sha256: "8b2c86cd483dc7fcb7975c5ec7329135d210099a89bc7db0590a07b0bbfe49a5" "1.11.1": url: "https://github.com/ninja-build/ninja/archive/v1.11.1.tar.gz" sha256: "31747ae633213f1eda3842686f83c2aa1412e0f5691d1c14dbbcc67fe7400cea" diff --git a/recipes/ninja/config.yml b/recipes/ninja/config.yml index 0a0061dfb232d..8d14bc8f88871 100644 --- a/recipes/ninja/config.yml +++ b/recipes/ninja/config.yml @@ -1,4 +1,8 @@ versions: + "1.12.1": + folder: all + "1.12.0": + folder: all "1.11.1": folder: all "1.11.0": diff --git a/recipes/nmos-cpp/all/conanfile.py b/recipes/nmos-cpp/all/conanfile.py index c34c0db4db93c..82bc34f86af52 100644 --- a/recipes/nmos-cpp/all/conanfile.py +++ b/recipes/nmos-cpp/all/conanfile.py @@ -57,7 +57,6 @@ def requirements(self): self.requires("openssl/[>=1.1 <4]") self.requires("json-schema-validator/2.3.0") self.requires("nlohmann_json/3.11.3") - self.requires("zlib/[>=1.2.11 <2]") if Version(self.version) >= "cci.20240222": self.requires("jwt-cpp/0.7.0") @@ -127,7 +126,7 @@ def _create_components_file_from_cmake_target_file(self, target_file_path): target_content = files.load(self, target_file_path) - cmake_functions = re.findall(r"(?Padd_library|set_target_properties)[\n|\s]*\([\n|\s]*(?P[^)]*)\)", target_content) + cmake_functions = re.findall(r"(?Padd_executable|add_library|set_target_properties)[\n|\s]*\([\n|\s]*(?P[^)]*)\)", target_content) for (cmake_function_name, cmake_function_args) in cmake_functions: cmake_function_args = re.split(r"[\s|\n]+", cmake_function_args, maxsplit=2) @@ -140,7 +139,9 @@ def _create_components_file_from_cmake_target_file(self, target_file_path): components.setdefault(component_name, {"cmake_target": cmake_target_nonamespace}) - if cmake_function_name == "add_library": + if cmake_function_name == "add_executable": + components[component_name]["exe"] = True + elif cmake_function_name == "add_library": cmake_imported_target_type = cmake_function_args[1] if cmake_imported_target_type in ["STATIC", "SHARED"]: # library filenames are based on the target name by default @@ -211,6 +212,11 @@ def _create_components_file_from_cmake_target_file(self, target_file_path): else: self.output.warn(f"{self.name} recipe does not handle {property_type} (yet)") + # until https://github.com/sony/nmos-cpp/commit/9489d84098ddc8cc514b7e4d5afe740dee4518ee + # direct dependency on nlohmann_json was missing + if Version(self.version) < "cci.20221203": + components["json_schema_validator"].setdefault("requires", []).append("nlohmann_json::nlohmann_json") + # Save components informations in json file with open(self._components_helper_filepath, "w", encoding="utf-8") as json_file: json.dump(components, json_file, indent=4) @@ -229,7 +235,6 @@ def package_info(self): libdir = os.path.join(libdir, config_install_dir) self.cpp_info.bindirs = [bindir] self.cpp_info.libdirs = [libdir] - self.cpp_info.requires = ["nlohmann_json::nlohmann_json", "zlib::zlib"] def _register_components(): components_json_file = files.load(self, self._components_helper_filepath) @@ -238,6 +243,7 @@ def _register_components(): cmake_target = values["cmake_target"] self.cpp_info.components[component_name].names["cmake_find_package"] = cmake_target self.cpp_info.components[component_name].names["cmake_find_package_multi"] = cmake_target + self.cpp_info.components[component_name].bindirs = [bindir] if values.get("exe") else [] self.cpp_info.components[component_name].libs = values.get("libs", []) self.cpp_info.components[component_name].libdirs = [libdir] self.cpp_info.components[component_name].defines = values.get("defines", []) diff --git a/recipes/nng/all/conandata.yml b/recipes/nng/all/conandata.yml index c572a0578b71b..494ad83360116 100644 --- a/recipes/nng/all/conandata.yml +++ b/recipes/nng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.0": + url: "https://github.com/nanomsg/nng/archive/refs/tags/v1.8.0.tar.gz" + sha256: "cfacfdfa35c1618a28bb940e71f774a513dcb91292999696b4346ad8bfb5baff" "1.7.3": url: "https://github.com/nanomsg/nng/archive/refs/tags/v1.7.3.tar.gz" sha256: "035f2c3cad4e45fc0d978c54a338c197d1937527ae6feb82180d428a96b83474" diff --git a/recipes/nng/all/conanfile.py b/recipes/nng/all/conanfile.py index 91bc43507421d..1a1e6939144f3 100644 --- a/recipes/nng/all/conanfile.py +++ b/recipes/nng/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration 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, CMakeToolchain, cmake_layout +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os @@ -109,6 +109,8 @@ def generate(self): if "with_ipv6" in self.options: tc.variables["NNG_ENABLE_IPV6"] = self.options.with_ipv6 tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): apply_conandata_patches(self) diff --git a/recipes/nng/config.yml b/recipes/nng/config.yml index b2f902db3e414..edac6c5900d05 100644 --- a/recipes/nng/config.yml +++ b/recipes/nng/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.0": + folder: all "1.7.3": folder: all "1.7.2": diff --git a/recipes/norm/all/conanfile.py b/recipes/norm/all/conanfile.py index 06df6975769c2..3d4877a41e642 100644 --- a/recipes/norm/all/conanfile.py +++ b/recipes/norm/all/conanfile.py @@ -39,7 +39,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libxml2/2.12.3") # dependency of protolib actually + self.requires("libxml2/[>=2.12.5 <3]") # dependency of protolib actually def source(self): get(self, **self.conan_data["sources"][self.version]) diff --git a/recipes/nsync/all/conandata.yml b/recipes/nsync/all/conandata.yml index b694103d49b84..2612b48d1ed17 100644 --- a/recipes/nsync/all/conandata.yml +++ b/recipes/nsync/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.29.2": + url: "https://github.com/google/nsync/archive/1.29.2.tar.gz" + sha256: "1d63e967973733d2c97e841e3c05fac4d3fa299f01d14c86f2695594c7a4a2ec" + "1.29.1": + url: "https://github.com/google/nsync/archive/1.29.1.tar.gz" + sha256: "3045a8922171430426b695edf794053182d245f6a382ddcc59ef4a6190848e98" + "1.28.0": + url: "https://github.com/google/nsync/archive/1.28.0.tar.gz" + sha256: "1e6a7193bd85d480faaf992cef204c5cf09f9da72766c9987e25b4f88508eed1" + "1.27.0": + url: "https://github.com/google/nsync/archive/1.27.0.tar.gz" + sha256: "e8e552a358f4a28e844207a7c5cb51767e4aeb0b29e22d23ac2a09924130f761" "1.26.0": url: "https://github.com/google/nsync/archive/1.26.0.tar.gz" sha256: "80fc1e605bb3cf5f272811ece39c4fb6761ffcb9b30563301845cc9ff381eb8b" @@ -12,6 +24,14 @@ sources: sha256: "b7e75b17957c62bd02dd73890bde22da3a564903fcaad651b395453d41d3325b" url: "https://github.com/google/nsync/archive/refs/tags/1.23.0.tar.gz" patches: + "1.29.2": + - patch_file: "patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" + "1.29.1": + - patch_file: "patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" + "1.28.0": + - patch_file: "patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" + "1.27.0": + - patch_file: "patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" "1.26.0": - patch_file: "patches/0001-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" "1.25.0": diff --git a/recipes/nsync/all/conanfile.py b/recipes/nsync/all/conanfile.py index fd5515ae38c38..0161c97b47851 100644 --- a/recipes/nsync/all/conanfile.py +++ b/recipes/nsync/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, replace_in_file +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, replace_in_file, rmdir from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os @@ -84,6 +84,7 @@ 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")) def package_info(self): self.cpp_info.components["nsync_c"].libs = ["nsync"] diff --git a/recipes/nsync/all/patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch b/recipes/nsync/all/patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch new file mode 100644 index 0000000000000..1f3fd75999335 --- /dev/null +++ b/recipes/nsync/all/patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -125,7 +125,6 @@ + ${NSYNC_OS_CPP_SRC} + "platform/c++11/src/nsync_semaphore_mutex.cc" + "platform/posix/src/clock_gettime.c" +- "platform/posix/src/nsync_semaphore_mutex.c" + ) + elseif ("${CMAKE_SYSTEM_NAME}X" STREQUAL "LinuxX") + set (NSYNC_POSIX ON) diff --git a/recipes/nsync/config.yml b/recipes/nsync/config.yml index 960f98574a708..b839a601be83a 100644 --- a/recipes/nsync/config.yml +++ b/recipes/nsync/config.yml @@ -1,4 +1,12 @@ versions: + "1.29.2": + folder: "all" + "1.29.1": + folder: "all" + "1.28.0": + folder: "all" + "1.27.0": + folder: "all" "1.26.0": folder: "all" "1.25.0": diff --git a/recipes/nvcloth/1.1.6/CMakeLists.txt b/recipes/nvcloth/1.1.6/CMakeLists.txt index a236130272a84..4cd8eda7866f8 100644 --- a/recipes/nvcloth/1.1.6/CMakeLists.txt +++ b/recipes/nvcloth/1.1.6/CMakeLists.txt @@ -1,7 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) +# Using a CMake wrapper because the project's CMakeLists.txt does not set project() +cmake_minimum_required(VERSION 3.15) +project(cmake_wrapper CXX) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder/NvCloth/compiler/cmake/${TARGET_BUILD_PLATFORM}") +add_subdirectory("src/NvCloth/compiler/cmake/${TARGET_BUILD_PLATFORM}") diff --git a/recipes/nvcloth/1.1.6/conandata.yml b/recipes/nvcloth/1.1.6/conandata.yml index c37596cc7f7b6..657fa6c95ca38 100644 --- a/recipes/nvcloth/1.1.6/conandata.yml +++ b/recipes/nvcloth/1.1.6/conandata.yml @@ -5,8 +5,5 @@ sources: patches: "1.1.6": - patch_file: "patches/0001-PsAllocator-include-typeinfo.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-CallbackFix.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-PsAllocator.patch" - base_path: "source_subfolder" diff --git a/recipes/nvcloth/1.1.6/conanfile.py b/recipes/nvcloth/1.1.6/conanfile.py index c303576ad28c2..abfae884a66d8 100644 --- a/recipes/nvcloth/1.1.6/conanfile.py +++ b/recipes/nvcloth/1.1.6/conanfile.py @@ -1,175 +1,152 @@ import os import shutil -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -from conan.tools.microsoft import msvc_runtime_flag, is_msvc_static_runtime, is_msvc +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import Environment +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.35.0" class NvclothConan(ConanFile): name = "nvcloth" + description = "NvCloth is a library that provides low level access to a cloth solver designed for realtime interactive applications." license = "Nvidia Source Code License (1-Way Commercial)" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/NVIDIAGameWorks/NvCloth" - description = "NvCloth is a library that provides low level access to a cloth solver designed for realtime interactive applications." topics = ("physics", "physics-engine", "physics-simulation", "game-development", "cuda") - # Binary configuration - settings = "os", "compiler", "build_type", "arch" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "use_cuda": [True, False], - "use_dx11": [True, False] + "use_dx11": [True, False], } default_options = { "shared": False, "fPIC": True, "use_cuda": False, - "use_dx11": False + "use_dx11": False, } - generators = "cmake" + def export_sources(self): + export_conandata_patches(self) + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) - @property - def _source_subfolder(self): - return "source_subfolder" + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC - @property - def _build_subfolder(self): - return "build_subfolder" - - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) - def validate(self): - if self.settings.os not in ["Windows", "Linux", "Macos", "Android", "iOS"]: - raise ConanInvalidConfiguration("Current os is not supported") + if self.settings.os not in ["Windows", "Linux", "FreeBSD", "Macos", "Android", "iOS"]: + raise ConanInvalidConfiguration(f"{self.settings.os} is not supported") - build_type = self.settings.build_type - if build_type not in ["Debug", "RelWithDebInfo", "Release"]: - raise ConanInvalidConfiguration("Current build_type is not supported") + if self.settings.os in ["Windows", "Macos"] and not self.options.shared: + raise ConanInvalidConfiguration(f"Static builds are not supported on {self.settings.os}") + if self.settings.os in ["iOS", "Android"] and self.options.shared: + raise ConanInvalidConfiguration(f"Shared builds are not supported on {self.settings.os}") - if is_msvc(self) and tools.Version(self.settings.compiler.version) < 9: - raise ConanInvalidConfiguration("Visual Studio versions < 9 are not supported") + if self.settings.build_type not in ["Debug", "RelWithDebInfo", "Release"]: + raise ConanInvalidConfiguration(f"{self.settings.build_type} build_type is not supported") - def _configure_cmake(self): - cmake = CMake(self) - if not self.options.shared: - cmake.definitions["PX_STATIC_LIBRARIES"] = 1 - cmake.definitions["STATIC_WINCRT"] = is_msvc_static_runtime(self) + check_min_vs(self, 150) + check_min_cppstd(self, 11) - cmake.definitions["NV_CLOTH_ENABLE_CUDA"] = self.options.use_cuda - cmake.definitions["NV_CLOTH_ENABLE_DX11"] = self.options.use_dx11 + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - cmake.definitions["TARGET_BUILD_PLATFORM"] = self._get_target_build_platform() + @property + def _target_build_platform(self): + return { + "Windows": "windows", + "Linux": "linux", + "Macos": "mac", + "Android": "android", + "iOS": "ios", + }.get(str(self.settings.os)) + + def generate(self): + tc = CMakeToolchain(self) + if not self.options.shared: + tc.variables["PX_STATIC_LIBRARIES"] = 1 + tc.variables["STATIC_WINCRT"] = is_msvc_static_runtime(self) + tc.variables["NV_CLOTH_ENABLE_CUDA"] = self.options.use_cuda + tc.variables["NV_CLOTH_ENABLE_DX11"] = self.options.use_dx11 + tc.variables["TARGET_BUILD_PLATFORM"] = self._target_build_platform + tc.generate() + + env = Environment() + env.define_path("GW_DEPS_ROOT", self.source_folder) + env.vars(self).save_script("conan_build_vars") - cmake.configure( - build_folder=os.path.join(self.build_folder, self._build_subfolder) - ) - return cmake - def _remove_samples(self): - tools.rmdir(os.path.join(self._source_subfolder, "NvCloth", "samples")) + rmdir(self, os.path.join(self.source_folder, "NvCloth", "samples")) def _patch_sources(self): # There is no reason to force consumer of PhysX public headers to use one of # NDEBUG or _DEBUG, since none of them relies on NDEBUG or _DEBUG - tools.replace_in_file(os.path.join(self.build_folder, self._source_subfolder, "PxShared", "include", "foundation", "PxPreprocessor.h"), - "#error Exactly one of NDEBUG and _DEBUG needs to be defined!", - "// #error Exactly one of NDEBUG and _DEBUG needs to be defined!") - shutil.copy( - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h"), - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h.origin") - ) - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - - if self.settings.build_type == "Debug": - shutil.copy( - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h"), - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h.patched") - ) - shutil.copy( - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h.origin"), - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h") - ) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC + replace_in_file(self, os.path.join(self.source_folder, "PxShared", "include", "foundation", "PxPreprocessor.h"), + "#error Exactly one of NDEBUG and _DEBUG needs to be defined!", + "// #error Exactly one of NDEBUG and _DEBUG needs to be defined!") + shutil.copy(os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h"), + os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h.origin")) + apply_conandata_patches(self) - def configure(self): - if self.options.shared: - del self.options.fPIC + if self.settings.build_type == "Debug": + shutil.copy(os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h"), + os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h.patched")) + shutil.copy(os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h.origin"), + os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h")) def build(self): - with tools.environment_append({"GW_DEPS_ROOT": os.path.abspath(self._source_subfolder)}): - self._patch_sources() - self._remove_samples() - cmake = self._configure_cmake() - cmake.build() - - def _get_build_type(self): - if self.settings.build_type == "Debug": - return "debug" - elif self.settings.build_type == "RelWithDebInfo": - return "checked" - elif self.settings.build_type == "Release": - return "release" - - def _get_target_build_platform(self): - return { - "Windows" : "windows", - "Linux" : "linux", - "Macos" : "mac", - "Android" : "android", - "iOS" : "ios" - }.get(str(self.settings.os)) + self._patch_sources() + self._remove_samples() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) + cmake.build() def package(self): if self.settings.build_type == "Debug": - shutil.copy( - os.path.join(self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h.patched"), - os.path.join(self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h") - ) - nvcloth_source_subfolder = os.path.join(self.build_folder, self._source_subfolder) - nvcloth_build_subfolder = os.path.join(self.build_folder, self._build_subfolder) - - self.copy(pattern="NvCloth/license.txt", dst="licenses", src=nvcloth_source_subfolder, keep_path=False) - self.copy("*.h", dst="include", src=os.path.join(nvcloth_source_subfolder, "NvCloth", "include")) - self.copy("*.h", dst="include", src=os.path.join(nvcloth_source_subfolder, "NvCloth", "extensions", "include")) - self.copy("*.h", dst="include", src=os.path.join(nvcloth_source_subfolder, "PxShared", "include")) - self.copy("*.a", dst="lib", src=nvcloth_build_subfolder, keep_path=False) - self.copy("*.lib", dst="lib", src=nvcloth_build_subfolder, keep_path=False) - self.copy("*.dylib*", dst="lib", src=nvcloth_build_subfolder, keep_path=False) - self.copy("*.dll", dst="bin", src=nvcloth_build_subfolder, keep_path=False) - self.copy("*.so", dst="lib", src=nvcloth_build_subfolder, keep_path=False) + shutil.copy(os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h.patched"), + os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h")) + copy(self, "NvCloth/license.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder, keep_path=False) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "NvCloth", "include")) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "NvCloth", "extensions", "include")) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "PxShared", "include")) + copy(self, "*.a", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, "*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, "*.dylib*", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, "*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder, keep_path=False) + copy(self, "*.so", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "nvcloth" - self.cpp_info.names["cmake_find_package_multi"] = "nvcloth" + self.cpp_info.set_property("cmake_file_name", "nvcloth") + self.cpp_info.set_property("cmake_target_name", "nvcloth::nvcloth") if self.settings.build_type == "Debug": debug_suffix = "DEBUG" else: debug_suffix = "" - if self.settings.os == "Windows": - if self.settings.arch == "x86_64": - arch_suffix = "x64" - else: - arch_suffix = "" - self.cpp_info.libs = ["NvCloth{}_{}".format(debug_suffix, arch_suffix)] + if self.settings.os == "Windows" and self.settings.arch == "x86_64": + arch_suffix = "_x64" else: - self.cpp_info.libs = ["NvCloth{}".format(debug_suffix)] + arch_suffix = "" - if not self.options.shared: - if self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.system_libs.append("m") + self.cpp_info.libs = [f"NvCloth{debug_suffix}{arch_suffix}"] + + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs.append("m") diff --git a/recipes/nvcloth/1.1.6/test_package/CMakeLists.txt b/recipes/nvcloth/1.1.6/test_package/CMakeLists.txt index e0165aeedb7a2..d8a9e2773d7d6 100644 --- a/recipes/nvcloth/1.1.6/test_package/CMakeLists.txt +++ b/recipes/nvcloth/1.1.6/test_package/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(nvcloth REQUIRED CONFIG) find_package(nvcloth REQUIRED nvcloth CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} nvcloth::nvcloth) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/nvcloth/1.1.6/test_package/conanfile.py b/recipes/nvcloth/1.1.6/test_package/conanfile.py index e290e81a631fa..ef5d7042163ec 100644 --- a/recipes/nvcloth/1.1.6/test_package/conanfile.py +++ b/recipes/nvcloth/1.1.6/test_package/conanfile.py @@ -1,9 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class NvClothTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/nvcloth/1.1.6/test_v1_package/CMakeLists.txt b/recipes/nvcloth/1.1.6/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/nvcloth/1.1.6/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/nvcloth/1.1.6/test_v1_package/conanfile.py b/recipes/nvcloth/1.1.6/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e290e81a631fa --- /dev/null +++ b/recipes/nvcloth/1.1.6/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class NvClothTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/objectbox/all/conandata.yml b/recipes/objectbox/all/conandata.yml deleted file mode 100644 index ca8ae614b9798..0000000000000 --- a/recipes/objectbox/all/conandata.yml +++ /dev/null @@ -1,46 +0,0 @@ -sources: - # The release tarball is invalid, so we need to get the tarball from the v0.20.0 commit. - # https://github.com/objectbox/objectbox-c/issues/38 - "0.21.0": - url: "https://github.com/objectbox/objectbox-c/archive/720559838e78a9fe6252c93ed1a3d46a1025767f.tar.gz" - sha256: "a2e7aa1d455a9703c49661515e820b4b296b6f53da7ab6b467b78776a29b0b93" - "0.20.0": - url: "https://github.com/objectbox/objectbox-c/archive/7e4a5a3ed94aa486acf0737b354726b493fd204c.tar.gz" - sha256: "cb6ec8b7ceaed7963ad582c4519d06ddc887294f0893b3f9bf89e7d0789ce216" - "0.19.0": - url: "https://github.com/objectbox/objectbox-c/archive/v0.19.0.tar.gz" - sha256: "372520a744e9ae135a309ee834e4e936058abb0630fafd70a400546109089a89" - "0.18.1": - url: "https://github.com/objectbox/objectbox-c/archive/v0.18.1.tar.gz" - sha256: "108ac7fac843f2962374a12b361bb57b4d114013d16f7716cfedbc7df52feb2e" - "0.18.0": - url: "https://github.com/objectbox/objectbox-c/archive/v0.18.0.tar.gz" - sha256: "e86e921d59c6c36a4a0c0ddc5a2b641789bfa012e0824506c285feb4e9285ae7" - "0.17.0": - url: "https://github.com/objectbox/objectbox-c/archive/refs/tags/v0.17.0.tar.gz" - sha256: "3b936b3352ae0c8ea3706cc0a1790d2714a415cdce16007c2caca367ead5af8d" -patches: - "0.21.0": - - patch_file: "patches/0.21.0-0001-fix-cmake.patch" - patch_description: "add sync option, disable tests/examples, support max length of windows path" - patch_type: "conan" - "0.20.0": - - patch_file: "patches/0.17.0-0001-fix-cmake.patch" - patch_description: "add sync option, disable tests/examples, support max length of windows path" - patch_type: "conan" - "0.19.0": - - patch_file: "patches/0.17.0-0001-fix-cmake.patch" - patch_description: "add sync option, disable tests/examples, support max length of windows path" - patch_type: "conan" - "0.18.1": - - patch_file: "patches/0.17.0-0001-fix-cmake.patch" - patch_description: "add sync option, disable tests/examples, support max length of windows path" - patch_type: "conan" - "0.18.0": - - patch_file: "patches/0.17.0-0001-fix-cmake.patch" - patch_description: "add sync option, disable tests/examples, support max length of windows path" - patch_type: "conan" - "0.17.0": - - patch_file: "patches/0.17.0-0001-fix-cmake.patch" - patch_description: "add sync option, disable tests/examples, support max length of windows path" - patch_type: "conan" diff --git a/recipes/objectbox/all/conanfile.py b/recipes/objectbox/all/conanfile.py deleted file mode 100644 index ffcc6e09fb17f..0000000000000 --- a/recipes/objectbox/all/conanfile.py +++ /dev/null @@ -1,64 +0,0 @@ -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, CMakeToolchain, cmake_layout -from conan.tools.scm import Version -import os - -required_conan_version = ">=1.53.0" - -class ObjectboxCConan(ConanFile): - name = "objectbox" - description = "ObjectBox C and C++: super-fast database for objects and structs" - license = "Apache-2.0" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/objectbox/objectbox-c" - topics = ("performance", "database", "flatbuffers") - settings = "os", "arch", "compiler", "build_type" - package_type = "shared-library" - options = { - "with_sync": [True, False], - } - default_options = { - "with_sync": False, - } - upload_policy="skip" - - def export_sources(self): - export_conandata_patches(self) - - def layout(self): - cmake_layout(self, src_folder="src") - - def validate(self): - if Version(self.version) >= "0.19.0" and \ - self.settings.compiler == "gcc" and Version(self.settings.compiler.version) <= "5": - raise ConanInvalidConfiguration(f"{self.ref} requires GCC 6 or higher") - - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) - - def generate(self): - # BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE are automatically parsed when self.options.shared or self.options.fPIC exist - tc = CMakeToolchain(self) - tc.variables["OBJECTBOX_WITH_SYNC"] = self.options.with_sync - tc.generate() - - def build(self): - apply_conandata_patches(self) - cmake = CMake(self) - cmake.configure() - cmake.build() - - def package(self): - 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.libs = ["objectbox"] - - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.extend(["m", "pthread"]) - if Version(self.version) >= "0.18.0": - self.cpp_info.system_libs.append("dl") diff --git a/recipes/objectbox/all/patches/0.17.0-0001-fix-cmake.patch b/recipes/objectbox/all/patches/0.17.0-0001-fix-cmake.patch deleted file mode 100644 index d22926b57e6c9..0000000000000 --- a/recipes/objectbox/all/patches/0.17.0-0001-fix-cmake.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e32c84b..c2c535f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -9,10 +9,17 @@ if (${CMAKE_VERSION} VERSION_LESS "3.11.0") - endif () - link_directories("${CMAKE_CURRENT_SOURCE_DIR}/lib") - else () -+ include(GNUInstallDirs) -+ - function(defineObjectBoxLibForURL VARIANT DL_URL) - include(FetchContent) - project(objectbox${VARIANT}-download) -- FetchContent_Declare(${PROJECT_NAME} URL ${DL_URL}) -+ FetchContent_Declare(${PROJECT_NAME} -+ URL ${DL_URL} -+ # workaround for max path length in Windows (260byte) -+ SUBBUILD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sub -+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tmp -+ ) - - FetchContent_Populate(${PROJECT_NAME}) - set(DL_DIR "${${PROJECT_NAME}_SOURCE_DIR}") -@@ -27,6 +34,25 @@ else () - IMPORTED_IMPLIB ${DL_DIR}/lib/${CMAKE_IMPORT_LIBRARY_PREFIX}objectbox${CMAKE_IMPORT_LIBRARY_SUFFIX} - INTERFACE_INCLUDE_DIRECTORIES "${objectbox_include_dirs}" - ) -+ -+ if(EXISTS "${DL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_SHARED_LIBRARY_SUFFIX}") -+ install( -+ FILES ${DL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_SHARED_LIBRARY_SUFFIX} -+ DESTINATION $,${CMAKE_INSTALL_BINDIR},${CMAKE_INSTALL_LIBDIR}> -+ ) -+ endif() -+ if(EXISTS "${DL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_IMPORT_LIBRARY_SUFFIX}") -+ install( -+ FILES ${DL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_IMPORT_LIBRARY_SUFFIX} -+ DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ) -+ endif() -+ -+ install( -+ DIRECTORY ${DL_DIR}/include/ -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -+ ) -+ - endfunction() - - function(defineObjectBoxLib VARIANT) -@@ -72,10 +98,15 @@ else () - defineObjectBoxLibForURL("" "${DL_URL}") - else () - defineObjectBoxLib("") -- defineObjectBoxLib("-sync") -+ if(OBJECTBOX_WITH_SYNC) -+ defineObjectBoxLib("-sync") -+ endif() - endif () - endif () - -+if(0) - add_subdirectory(src-test) - add_subdirectory(src-test-gen) - add_subdirectory(examples) -+endif() -+ diff --git a/recipes/objectbox/all/patches/0.21.0-0001-fix-cmake.patch b/recipes/objectbox/all/patches/0.21.0-0001-fix-cmake.patch deleted file mode 100644 index c5c0e8e9c4a85..0000000000000 --- a/recipes/objectbox/all/patches/0.21.0-0001-fix-cmake.patch +++ /dev/null @@ -1,54 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8e826e0..d6a2e18 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -20,8 +20,13 @@ else () - function(defineObjectBoxLibForURL VARIANT DL_URL) - include(FetchContent) - project(objectbox${VARIANT}-download) -- FetchContent_Declare(${PROJECT_NAME} URL ${DL_URL}) -- -+ FetchContent_Declare(${PROJECT_NAME} -+ URL ${DL_URL} -+ # workaround for max path length in Windows (260byte) -+ SUBBUILD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sub -+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tmp -+ ) -+ - FetchContent_Populate(${PROJECT_NAME}) - set(DL_DIR "${${PROJECT_NAME}_SOURCE_DIR}") - message(STATUS "Pre-compiled ObjectBox library is saved in ${DL_DIR}") -@@ -35,6 +40,22 @@ else () - IMPORTED_IMPLIB ${DL_DIR}/lib/${CMAKE_IMPORT_LIBRARY_PREFIX}objectbox${CMAKE_IMPORT_LIBRARY_SUFFIX} - INTERFACE_INCLUDE_DIRECTORIES "${objectbox_include_dirs}" - ) -+ if(EXISTS "${DL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_SHARED_LIBRARY_SUFFIX}") -+ install( -+ FILES ${DL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_SHARED_LIBRARY_SUFFIX} -+ DESTINATION $,${CMAKE_INSTALL_BINDIR},${CMAKE_INSTALL_LIBDIR}> -+ ) -+ endif() -+ if(EXISTS "${DL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_IMPORT_LIBRARY_SUFFIX}") -+ install( -+ FILES ${DL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_IMPORT_LIBRARY_SUFFIX} -+ DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ) -+ endif() -+ install( -+ DIRECTORY ${DL_DIR}/include/ -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -+ ) - endfunction() - - function(defineObjectBoxLib VARIANT) -@@ -80,7 +101,9 @@ else () - defineObjectBoxLibForURL("" "${DL_URL}") - else () - defineObjectBoxLib("") -- defineObjectBoxLib("-sync") -+ if(OBJECTBOX_WITH_SYNC) -+ defineObjectBoxLib("-sync") -+ endif() - endif () - endif () - diff --git a/recipes/objectbox/all/test_package/CMakeLists.txt b/recipes/objectbox/all/test_package/CMakeLists.txt deleted file mode 100644 index daba6910bb48a..0000000000000 --- a/recipes/objectbox/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -find_package(objectbox REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE objectbox::objectbox) diff --git a/recipes/objectbox/all/test_package/conanfile.py b/recipes/objectbox/all/test_package/conanfile.py deleted file mode 100644 index a9fbb7f543162..0000000000000 --- a/recipes/objectbox/all/test_package/conanfile.py +++ /dev/null @@ -1,25 +0,0 @@ -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/objectbox/all/test_package/test_package.c b/recipes/objectbox/all/test_package/test_package.c deleted file mode 100644 index f03f0d6b965c7..0000000000000 --- a/recipes/objectbox/all/test_package/test_package.c +++ /dev/null @@ -1,10 +0,0 @@ -#include - -#include "objectbox.h" - -int main() { - printf("ObjectBox version %s\n", obx_version_string()); - - return 0; -} - diff --git a/recipes/objectbox/all/test_v1_package/CMakeLists.txt b/recipes/objectbox/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/objectbox/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/objectbox/all/test_v1_package/conanfile.py b/recipes/objectbox/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/objectbox/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/objectbox/config.yml b/recipes/objectbox/config.yml deleted file mode 100644 index 455f77377fdff..0000000000000 --- a/recipes/objectbox/config.yml +++ /dev/null @@ -1,13 +0,0 @@ -versions: - "0.21.0": - folder: all - "0.20.0": - folder: all - "0.19.0": - folder: all - "0.18.1": - folder: all - "0.18.0": - folder: all - "0.17.0": - folder: all diff --git a/recipes/octo-keygen-cpp/all/conanfile.py b/recipes/octo-keygen-cpp/all/conanfile.py index b9e37112cb2f5..50c1d18d84986 100644 --- a/recipes/octo-keygen-cpp/all/conanfile.py +++ b/recipes/octo-keygen-cpp/all/conanfile.py @@ -40,7 +40,7 @@ def layout(self): def requirements(self): self.requires("octo-logger-cpp/1.1.0", transitive_headers=True) self.requires("octo-encryption-cpp/1.1.0", transitive_headers=True) - self.requires("fmt/10.1.1") + self.requires("fmt/10.2.1") self.requires("openssl/[>=1.1 <4]") def validate(self): diff --git a/recipes/octo-logger-cpp/all/conandata.yml b/recipes/octo-logger-cpp/all/conandata.yml index 92395bec9bd21..ad6e1f0b56004 100644 --- a/recipes/octo-logger-cpp/all/conandata.yml +++ b/recipes/octo-logger-cpp/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.12.0": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.12.0.tar.gz" + sha256: "b4140d31910af128e1d97ae44a564bbad7f7ca889410bbc885691c5e215c0d61" + "1.11.0": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.11.0.tar.gz" + sha256: "73c35ca2a2e0c4be2cd85c5ba1f4061bbc22637fe79570107f1123eff30936db" + "1.9.0": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.9.0.tar.gz" + sha256: "95187b6e9ae5d405b53ecb12ff7cbde847a9824a340ca88922eecd712ce9a138" + "1.6.1": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.6.1.tar.gz" + sha256: "02c1d5303d8c129cb2527a92d49677229230a5feaec002791f96d47de3bccb5a" "1.5.0": url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.5.0.tar.gz" sha256: "e62e4a54700f7c235111fd2b75c51d96f0b4deaf2c24ce7bc9ef1751ce31ea20" diff --git a/recipes/octo-logger-cpp/all/conanfile.py b/recipes/octo-logger-cpp/all/conanfile.py index d8b77698e6f0d..247a0179f4fb8 100644 --- a/recipes/octo-logger-cpp/all/conanfile.py +++ b/recipes/octo-logger-cpp/all/conanfile.py @@ -52,9 +52,9 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fmt/10.1.1", transitive_headers=True) + self.requires("fmt/10.2.1", transitive_headers=True) if self.options.get_safe("with_aws"): - self.requires("nlohmann_json/3.11.2") + self.requires("nlohmann_json/3.11.3") self.requires("aws-sdk-cpp/1.9.234") def validate(self): diff --git a/recipes/octo-logger-cpp/config.yml b/recipes/octo-logger-cpp/config.yml index 76947dd2891c2..d7616b7f25016 100644 --- a/recipes/octo-logger-cpp/config.yml +++ b/recipes/octo-logger-cpp/config.yml @@ -1,4 +1,12 @@ versions: + "1.12.0": + folder: "all" + "1.11.0": + folder: "all" + "1.9.0": + folder: "all" + "1.6.1": + folder: "all" "1.5.0": folder: "all" "1.4.0": diff --git a/recipes/octomap/all/conandata.yml b/recipes/octomap/all/conandata.yml index 4699a071746f8..24483c3d1fc42 100644 --- a/recipes/octomap/all/conandata.yml +++ b/recipes/octomap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.10.0": + url: "https://github.com/OctoMap/octomap/archive/v1.10.0.tar.gz" + sha256: "8da2576ec6a0993e8900db7f91083be8682d8397a7be0752c85d1b7dd1b8e992" "1.9.8": url: "https://github.com/OctoMap/octomap/archive/v1.9.8.tar.gz" sha256: "417af6da4e855e9a83b93458aa98b01a2c88f880088baad2b59d323ce162586e" @@ -15,6 +18,10 @@ sources: url: "https://github.com/OctoMap/octomap/archive/v1.9.3.tar.gz" sha256: "8488de97ed2c8f4757bfbaf3225e82a9e36783dce1f573b3bde1cf968aa89696" patches: + "1.10.0": + - patch_file: "patches/1.10.0-0001-separate-static-shared-build.patch" + patch_description: "CMake: build either shared or static" + patch_type: "conan" "1.9.8": - patch_file: "patches/1.9.5-0001-targets-outputname-collision.patch" patch_description: "CMake: build either shared or static, and avoid name collision" diff --git a/recipes/octomap/all/conanfile.py b/recipes/octomap/all/conanfile.py index 52d010aca9b55..ced4e906103b0 100644 --- a/recipes/octomap/all/conanfile.py +++ b/recipes/octomap/all/conanfile.py @@ -4,12 +4,12 @@ from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd import os import textwrap required_conan_version = ">=1.53.0" - class OctomapConan(ConanFile): name = "octomap" description = "An Efficient Probabilistic 3D Mapping Framework Based on Octrees." @@ -31,6 +31,10 @@ class OctomapConan(ConanFile): "openmp": False, } + @property + def _min_cppstd(self): + return 11 + def export_sources(self): export_conandata_patches(self) @@ -49,6 +53,9 @@ def validate(self): if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("shared octomap doesn't support MT runtime") + if Version(self.version) >= "1.10.0" and self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -58,6 +65,8 @@ def generate(self): tc.variables["BUILD_TESTING"] = False if is_msvc(self) and self.options.shared: tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + if Version(self.version) >= "1.10.0": + tc.variables["CMAKE_CXX_STANDARD"] = self.settings.compiler.get_safe("cppstd", "11").replace("gnu", "") tc.generate() def _patch_sources(self): diff --git a/recipes/octomap/all/patches/1.10.0-0001-separate-static-shared-build.patch b/recipes/octomap/all/patches/1.10.0-0001-separate-static-shared-build.patch new file mode 100644 index 0000000000000..bf38e33037d86 --- /dev/null +++ b/recipes/octomap/all/patches/1.10.0-0001-separate-static-shared-build.patch @@ -0,0 +1,120 @@ +diff --git a/octomap/src/CMakeLists.txt b/octomap/src/CMakeLists.txt +index 45b384f..e870608 100644 +--- a/octomap/src/CMakeLists.txt ++++ b/octomap/src/CMakeLists.txt +@@ -11,24 +11,32 @@ SET (octomap_SRCS + ) + + # dynamic and static libs, see CMake FAQ: ++if(BUILD_SHARED_LIBS) + ADD_LIBRARY( octomap SHARED ${octomap_SRCS}) + set_target_properties( octomap PROPERTIES + VERSION ${OCTOMAP_VERSION} + SOVERSION ${OCTOMAP_SOVERSION} + ) ++TARGET_LINK_LIBRARIES(octomap octomath) ++else() + ADD_LIBRARY( octomap-static STATIC ${octomap_SRCS}) + SET_TARGET_PROPERTIES(octomap-static PROPERTIES OUTPUT_NAME "octomap") + add_dependencies(octomap-static octomath-static) +- +-TARGET_LINK_LIBRARIES(octomap octomath) ++TARGET_LINK_LIBRARIES(octomap-static octomath-static) ++endif() + + if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + endif() + +-export(TARGETS octomap octomap-static ++if(BUILD_SHARED_LIBS) ++export(TARGETS octomap + APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") +- ++else() ++export(TARGETS octomap-static ++ APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") ++endif() ++if(0) + ADD_SUBDIRECTORY( testing ) + + ADD_EXECUTABLE(graph2tree graph2tree.cpp) +@@ -66,14 +74,22 @@ TARGET_LINK_LIBRARIES(intersection_example octomap) + + ADD_EXECUTABLE(octree2pointcloud octree2pointcloud.cpp) + TARGET_LINK_LIBRARIES(octree2pointcloud octomap) +- +-install(TARGETS octomap octomap-static ++endif() ++if(BUILD_SHARED_LIBS) ++install(TARGETS octomap + EXPORT octomap-targets + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ${INSTALL_TARGETS_DEFAULT_ARGS} + ) ++else() ++install(TARGETS octomap-static ++ EXPORT octomap-targets ++ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ++ ${INSTALL_TARGETS_DEFAULT_ARGS} ++) ++endif() + install(EXPORT octomap-targets DESTINATION "${CMAKE_INSTALL_DATADIR}/octomap") +- ++if(0) + install(TARGETS + graph2tree + log2graph +@@ -85,4 +101,4 @@ install(TARGETS + compare_octrees + ${INSTALL_TARGETS_DEFAULT_ARGS} + ) +- ++endif() +diff --git a/octomap/src/math/CMakeLists.txt b/octomap/src/math/CMakeLists.txt +index 3b47ec4..596f7d8 100644 +--- a/octomap/src/math/CMakeLists.txt ++++ b/octomap/src/math/CMakeLists.txt +@@ -4,26 +4,37 @@ SET (octomath_SRCS + Pose6D.cpp + ) + +- ++if(BUILD_SHARED_LIBS) + ADD_LIBRARY( octomath SHARED ${octomath_SRCS}) + + SET_TARGET_PROPERTIES( octomath PROPERTIES + VERSION ${OCTOMAP_VERSION} + SOVERSION ${OCTOMAP_SOVERSION} + ) +- ++else() + ADD_LIBRARY( octomath-static STATIC ${octomath_SRCS}) + SET_TARGET_PROPERTIES(octomath-static PROPERTIES OUTPUT_NAME "octomath") +- ++endif() + if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + endif() + +-export(TARGETS octomath octomath-static ++if(BUILD_SHARED_LIBS) ++export(TARGETS octomath + APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") + +-install(TARGETS octomath octomath-static ++install(TARGETS octomath + EXPORT octomap-targets + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ${INSTALL_TARGETS_DEFAULT_ARGS} + ) ++else() ++export(TARGETS octomath-static ++ APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") ++ ++install(TARGETS octomath-static ++ EXPORT octomap-targets ++ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ++ ${INSTALL_TARGETS_DEFAULT_ARGS} ++) ++endif() diff --git a/recipes/octomap/all/test_package/CMakeLists.txt b/recipes/octomap/all/test_package/CMakeLists.txt index bb595de7484c4..4ec2de09236c3 100644 --- a/recipes/octomap/all/test_package/CMakeLists.txt +++ b/recipes/octomap/all/test_package/CMakeLists.txt @@ -9,3 +9,7 @@ if(TARGET octomap-static) else() target_link_libraries(${PROJECT_NAME} PRIVATE octomap octomath) endif() + +if(octomap_VERSION VERSION_GREATER_EQUAL "1.10.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/octomap/config.yml b/recipes/octomap/config.yml index 7b6ae3353a6fd..83dd314d86186 100644 --- a/recipes/octomap/config.yml +++ b/recipes/octomap/config.yml @@ -1,4 +1,6 @@ versions: + "1.10.0": + folder: all "1.9.8": folder: all "1.9.7": diff --git a/recipes/ohnet/all/conandata.yml b/recipes/ohnet/all/conandata.yml index 7e45066c8f010..5ad399f8fa0f9 100644 --- a/recipes/ohnet/all/conandata.yml +++ b/recipes/ohnet/all/conandata.yml @@ -1,8 +1,15 @@ sources: + "1.36.5344": + url: "https://github.com/openhome/ohNet/archive/refs/tags/ohNet_1.36.5344.tar.gz" + sha256: "4873504f8f98c5fdbd72537392d6e5d97ed0747d3ef0b9c2b7fe77f1a02aaeb6" "1.36.5182": url: "https://github.com/openhome/ohNet/archive/refs/tags/ohNet_1.36.5182.tar.gz" sha256: "1489407b9bae13affa8f933a81fb5a43f16b29f5bf8048b68ea645afc0e53ced" patches: + "1.36.5344": + - patch_file: "patches/0001-makefile-1.36.5344.patch" + patch_description: "Reduce gcc-centricity in Makefile" + patch_type: "conan" "1.36.5182": - patch_file: "patches/0001-makefile-universal.patch" patch_description: "Reduce gcc-centricity in Makefile" diff --git a/recipes/ohnet/all/patches/0001-makefile-1.36.5344.patch b/recipes/ohnet/all/patches/0001-makefile-1.36.5344.patch new file mode 100644 index 0000000000000..4422447f1344d --- /dev/null +++ b/recipes/ohnet/all/patches/0001-makefile-1.36.5344.patch @@ -0,0 +1,363 @@ +diff --git a/Common.mak b/Common.mak +index baae7b17..2f058f51 100644 +--- a/Common.mak ++++ b/Common.mak +@@ -381,21 +381,21 @@ $(objdir)nsec.$(objext) : $(mDNSdir)/nsec.c $(headers) + $(compiler)nsec.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/nsec.c + $(objdir)nsec3.$(objext) : $(mDNSdir)/nsec3.c $(headers) + $(compiler)nsec3.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/nsec3.c + $(objdir)uDNS.$(objext) : $(mDNSdir)/uDNS.c $(headers) + $(compiler)uDNS.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/uDNS.c + $(objdir)dnssd_clientshim.$(objext) : $(mDNSdir)/dnssd_clientshim.c $(headers) + $(compiler)dnssd_clientshim.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/dnssd_clientshim.c + $(objdir)dnssd_clientlib.$(objext) : $(mDNSdir)/dnssd_clientlib.c $(headers) + $(compiler)dnssd_clientlib.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/dnssd_clientlib.c + $(objdir)MdnsPlatform.$(objext) : OpenHome/Net/Device/Bonjour/MdnsPlatform.cpp $(headers) +- $(compiler)MdnsPlatform.$(objext) -c $(cflags_third_party) $(includes) OpenHome/Net/Device/Bonjour/MdnsPlatform.cpp ++ $(compiler)MdnsPlatform.$(objext) -c $(cppflags) $(cflags_third_party) $(includes) OpenHome/Net/Device/Bonjour/MdnsPlatform.cpp + $(objdir)MdnsProvider.$(objext) : OpenHome/Net/Device/Bonjour/MdnsProvider.cpp $(headers) + $(compiler)MdnsProvider.$(objext) -c $(cppflags) $(includes) OpenHome/Net/Device/Bonjour/MdnsProvider.cpp + $(objdir)Md5.$(objext) : OpenHome/md5.c $(headers) + $(compiler)Md5.$(objext) -c $(cflags_third_party) $(includes) OpenHome/md5.c + $(objdir)NetworkAdapterList.$(objext) : OpenHome/NetworkAdapterList.cpp $(headers) + $(compiler)NetworkAdapterList.$(objext) -c $(cppflags) $(includes) OpenHome/NetworkAdapterList.cpp + $(objdir)DnsChangeNotifier.$(objext) : OpenHome/DnsChangeNotifier.cpp $(headers) + $(compiler)DnsChangeNotifier.$(objext) -c $(cppflags) $(includes) OpenHome/DnsChangeNotifier.cpp + $(objdir)Network.$(objext) : OpenHome/Network.cpp $(headers) + $(compiler)Network.$(objext) -c $(cppflags) $(includes) OpenHome/Network.cpp +diff --git a/Makefile b/Makefile +index 2f0cb07c..372a6765 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,44 +1,44 @@ + #Makefile for linux + # Could be extended to support Mac in future + + rsync ?= yes + + ifeq ($(rsync),yes) + cp = rsync -u + else +-cp = cp -u ++cp = cp + endif + + ifeq ($(debug),1) + debug_specific_cflags = -g -O0 + debug_csharp = /define:DEBUG /debug+ + build_dir = Debug + openhome_configuration = Debug + android_ndk_debug = 1 + else + debug_specific_cflags = -g -O2 + debug_csharp = /optimize+ /debug:pdbonly + build_dir = Release + openhome_configuration = Release + android_ndk_debug=0 + endif + + + + # Figure out platform, openhome_system and openhome_architecture + +-gcc_machine = $(shell ${CROSS_COMPILE}gcc -dumpmachine) ++cc_machine = $(shell ${CROSS_COMPILE}$(CC) -dumpmachine) + MACHINE = $(shell uname -s) + + $(info CROSS_COMPILE: ${CROSS_COMPILE}) +-$(info Machine reported by compiler is: ${gcc_machine}) ++$(info Machine reported by compiler is: ${cc_machine}) + $(info Machine reported by uname is: ${MACHINE}) + $(info PLATFORM: ${PLATFORM}) + + ifeq ($(MACHINE),Darwin) + ifeq ($(iOs-arm64),1) + platform = iOS + detected_openhome_system = iOs + detected_openhome_architecture = arm64 + else ifeq ($(iOs-x64),1) + platform = iOS +@@ -50,88 +50,88 @@ ifeq ($(MACHINE),Darwin) + detected_openhome_architecture = rpi + else + platform = Mac + detected_openhome_system = Mac + ifeq ($(Mac-arm64),1) + detected_openhome_architecture = arm64 + else + detected_openhome_architecture = x64 + endif + endif +-else ifneq (, $(findstring powerpc, $(gcc_machine))) ++else ifneq (, $(findstring powerpc, $(cc_machine))) + platform = Core-ppc32 + detected_openhome_system = Core + detected_openhome_architecture = ppc32 + else ifeq ($(Android-anycpu), 1) + platform = Android + detected_openhome_system = Android + detected_openhome_architecture = anycpu + else ifeq ($(freebsd), 1) + platform = FreeBSD + detected_openhome_system = FreeBSD + detected_openhome_architecture = x86 +- compiler = gcc -o $(objdir) +- link = ${CROSS_COMPILE}g++ $(platform_linkflags) ++ compiler = $(CC) -o $(objdir) ++ link = ${CROSS_COMPILE}$(CXX) $(platform_linkflags) + ar = ${CROSS_COMPILE}ar rc $(objdir) + else ifneq (,$(findstring Linux-x86,${PLATFORM})) +- ifneq (,$(findstring x86_64,$(gcc_machine))) ++ ifneq (,$(findstring x86_64,$(cc_machine))) + platform = Vanilla + detected_openhome_system = Linux + detected_openhome_architecture = x86 + CFLAGS = -m32 + LDFLAGS = -m32 + endif + else + # At present, platform == Vanilla is used for Kirkwood, x86 and x64 Posix builds. + platform ?= Vanilla + ifneq (,$(findstring Qnap,$(platform))) + detected_openhome_system = Qnap +- else ifneq (,$(findstring linux,$(gcc_machine))) ++ else ifneq (,$(findstring linux,$(cc_machine))) + detected_openhome_system = Linux + endif +- ifneq (,$(findstring arm,$(gcc_machine))) +- ifneq (,$(findstring linux-gnueabihf,$(gcc_machine))) ++ ifneq (,$(findstring arm,$(cc_machine))) ++ ifneq (,$(findstring linux-gnueabihf,$(cc_machine))) + detected_openhome_architecture = armhf + else ifeq (${detected_openhome_system},Qnap) + detected_openhome_architecture = x19 + else + detected_openhome_architecture = armel + endif + endif +- ifneq (,$(findstring i686,$(gcc_machine))) ++ ifneq (,$(findstring i686,$(cc_machine))) + detected_openhome_architecture = x86 + endif +- ifneq (,$(findstring i586,$(gcc_machine))) ++ ifneq (,$(findstring i586,$(cc_machine))) + detected_openhome_architecture = x86 + endif +- ifneq (,$(findstring i486,$(gcc_machine))) ++ ifneq (,$(findstring i486,$(cc_machine))) + detected_openhome_architecture = x86 + endif +- ifneq (,$(findstring i386,$(gcc_machine))) ++ ifneq (,$(findstring i386,$(cc_machine))) + detected_openhome_architecture = x86 + endif +- ifneq (,$(findstring amd64,$(gcc_machine))) ++ ifneq (,$(findstring amd64,$(cc_machine))) + detected_openhome_architecture = x64 + endif +- ifneq (,$(findstring x86_64,$(gcc_machine))) ++ ifneq (,$(findstring x86_64,$(cc_machine))) + detected_openhome_architecture = x64 + endif +- ifneq (,$(findstring mipsel,$(gcc_machine))) ++ ifneq (,$(findstring mipsel,$(cc_machine))) + detected_openhome_architecture = mipsel + endif +- ifneq (,$(findstring mips,$(gcc_machine))) ++ ifneq (,$(findstring mips,$(cc_machine))) + detected_openhome_architecture = mipsel + endif +- ifneq (,$(findstring aarch64,$(gcc_machine))) ++ ifneq (,$(findstring aarch64,$(cc_machine))) + detected_openhome_architecture = arm64 + endif +- ifneq (,$(findstring riscv64,$(gcc_machine))) ++ ifneq (,$(findstring riscv64,$(cc_machine))) + detected_openhome_architecture = riscv64 + endif + endif + + detected_openhome_system ?= Unknown + detected_openhome_architecture ?= Unknown + + ifneq (${openhome_system},) + ifneq (${openhome_system},${detected_openhome_system}) + $(warning Detected compiler is for system ${detected_openhome_system} but expected ${openhome_system}. Build will probably fail.) +@@ -208,83 +208,89 @@ ifeq ($(platform),Mac) + openhome_architecture = x64 + else + # building for arm64 + platform_cflags = -DPLATFORM_MACOSX_GNU -arch arm64 -mmacosx-version-min=11 + platform_linkflags = -arch arm64 -framework CoreFoundation -framework SystemConfiguration -framework IOKit + osbuilddir = Mac-arm64 + openhome_architecture = arm64 + endif + + objdir = Build/Obj/$(osbuilddir)/$(build_dir)/ +- compiler = clang -fPIC -stdlib=libc++ -o $(objdir) ++ compiler = clang -fPIC -Qunused-arguments -stdlib=libc++ -o $(objdir) + link = clang++ -pthread -stdlib=libc++ $(platform_linkflags) + ar = ar rc $(objdir) + openhome_system = Mac + + dotnetRuntime = osx-x64 + endif + + ifeq ($(platform), Core-ppc32) + # platform == Core1 + openhome_system = Core + openhome_architecture = ppc32 + endian = BIG + platform_cflags = -mcpu=405 + platform_linkflags = -mcpu=405 ${CROSS_LINKFLAGS} + linkopts_ohNet = + osdir = Core + osbuilddir = Core-ppc32 + objdir = Build/Obj/$(osbuilddir)/$(build_dir)/ + native_only = yes +- compiler = ${CROSS_COMPILE}gcc -o $(objdir) +- link = ${CROSS_COMPILE}g++ $(platform_linkflags) ++ compiler = ${CROSS_COMPILE}$(CC) -o $(objdir) ++ link = ${CROSS_COMPILE}$(CXX) $(platform_linkflags) + ar = ${CROSS_COMPILE}ar rc $(objdir) + endif + + ifeq ($(platform), Core-armv6) + # platform == Core2 + openhome_system = Core + openhome_architecture = armv6 + endian = LITTLE + platform_cflags = -mcpu=arm926ej-s -Wno-psabi + platform_linkflags = -mcpu=arm926ej-s ${CROSS_LINKFLAGS} + linkopts_ohNet = + osdir = Core + osbuilddir = Core-armv6 + objdir = Build/Obj/$(osbuilddir)/$(build_dir)/ + native_only = yes +- compiler = ${CROSS_COMPILE}gcc -o $(objdir) +- link = ${CROSS_COMPILE}g++ $(platform_linkflags) ++ compiler = ${CROSS_COMPILE}$(CC) -o $(objdir) ++ link = ${CROSS_COMPILE}$(CXX) $(platform_linkflags) + ar = ${CROSS_COMPILE}ar rc $(objdir) + endif + + ifneq (,$(findstring $(platform),Vanilla Qnap-x86 Qnap-x19 Linux-ppc32)) + ifeq ($(gcc4_1), yes) + version_specific_cflags = ${CROSS_COMPILE_CFLAGS} + version_specific_cflags_third_party = -Wno-non-virtual-dtor + version_specific_java_cflags = -Wstrict-aliasing=0 + else +- gcc_min_ver = $(shell ${CROSS_COMPILE}gcc -dumpversion | cut -f2 -d'.') +- version_specific_cflags = $(shell if [ $(gcc_min_ver) -ge 6 ]; then echo '-Wno-psabi'; fi) ++ version_specific_cflags = ++ ifeq ($(CC), gcc) ++ gcc_min_ver = $(shell ${CROSS_COMPILE}gcc -dumpversion | cut -f2 -d'.') ++ gcc_ge_6 = $(shell if [ $(gcc_min_ver) -ge 6 ]; then echo 'yes'; fi) ++ ifeq ($(gcc_ge_6), yes) ++ version_specific_cflags = '-Wno-psabi' ++ endif ++ endif + version_specific_cflags += ${CROSS_COMPILE_CFLAGS} + version_specific_cflags_third_party = + version_specific_java_cflags = + endif + + version_specific_linkflags = ${CROSS_COMPILE_LINKFLAGS} + version_specific_library_path = ${CROSS_COMPILE_LIBRARY_PATH} + version_specific_includes = ${CROSS_COMPILE_INCLUDES} + + # Continuing with the non-Darwin settings... + objdir = Build/Obj/$(osdir)/$(build_dir)/ +- compiler = ${CROSS_COMPILE}gcc -o $(objdir) +- link = $(version_specific_library_path) ${CROSS_COMPILE}g++ $(platform_linkflags) ++ compiler = ${CROSS_COMPILE}$(CC) -o $(objdir) ++ link = $(version_specific_library_path) ${CROSS_COMPILE}$(CXX) $(platform_linkflags) + ar = $(version_specific_library_path) ${CROSS_COMPILE}ar rc $(objdir) + endif + + ifeq ($(platform), FreeBSD) + platform_cflags = $(version_specific_cflags) -fPIC -DPLATFORM_FREEBSD + platform_linkflags = $(version_specific_linkflags) -pthread + linkopts_ohNet = -Wl,-soname,libohNet.so + osbuilddir = Posix + objdir = Build/Obj/$(osbuilddir)/$(build_dir)/ + osdir = Posix +@@ -351,25 +357,25 @@ $(info Building for system ${openhome_system} and architecture ${openhome_archit + + + # Macros used by Common.mak + native_only ?= no + managed_only ?= no + no_shared_objects ?= no + endian ?= LITTLE + cflags_base = $(CFLAGS) -fexceptions -Wall $(version_specific_cflags_third_party) -pipe -D_GNU_SOURCE -D_REENTRANT -DDEFINE_$(endian)_ENDIAN -DDEFINE_TRACE $(debug_specific_cflags) -fvisibility=hidden $(platform_cflags) + cflags_third_party = $(cflags_base) -Wno-int-to-pointer-cast + ifeq ($(nocpp11), yes) +- cppflags = $(cflags_base) -Werror ++ cppflags = $(CPPFLAGS) $(cflags_base) -Werror + else ifeq ($(platform),Mac) +- cppflags = $(cflags_base) -std=c++11 -Werror ++ cppflags = $(CPPFLAGS) $(cflags_base) -std=c++11 -Werror + else +- cppflags = $(cflags_base) -std=c++0x -Werror ++ cppflags = $(CPPFLAGS) $(cflags_base) -std=c++0x -Werror + endif + cflags = $(cflags_base) -Werror + inc_build = Build/Include + includes = -IBuild/Include/ $(version_specific_includes) + bundle_build = Build/Bundles + mDNSdir = Build/mDNS + osdir ?= Posix + objext = o + libprefix = lib + libext = a +@@ -383,21 +389,21 @@ else + endif + exeext = elf + linkoutput = -o + dllprefix = lib + ifeq ($(platform), iOS) + link_dll = $(toolroot)/clang++ -pthread -shared -stdlib=libc++ $(platform_linkflags) + else ifeq ($(MACHINE), Darwin) + link_dll = $(version_specific_library_path) clang++ -pthread $(platform_linkflags) -shared -stdlib=libc++ + else + CROSS_COMPILE_LIBGCC ?= -shared-libgcc +- link_dll = $(version_specific_library_path) ${CROSS_COMPILE}g++ -pthread $(platform_linkflags) -shared ${CROSS_COMPILE_LIBGCC} ++ link_dll = $(version_specific_library_path) ${CROSS_COMPILE}$(CXX) -pthread $(platform_linkflags) -shared ${CROSS_COMPILE_LIBGCC} + endif + + csharp = mcs /nologo $(debug_csharp) + + csharpdefines ?= + publicjavadir = OpenHome/Net/Bindings/Java/ + + ifeq ($(platform), Mac) + platform_java_cflags = -Wno-self-assign + # arm64 builds need JAVA_HOME to be set because the Mac SDK for arm64 doesn't contain Java includes or dylibs +@@ -409,24 +415,24 @@ ifeq ($(platform), Mac) + link_jvm = ${MACOSX_SDK}/System/Library/Frameworks/JavaVM.framework/JavaVM + endif + javac = /usr/bin/javac + jar = /usr/bin/jar + else + platform_java_cflags = + includes_jni = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux + ifeq ($(platform), Linux-ppc32) + libjvm_dir ?= $(JAVA_HOME)/jre/lib/ppc/server + else +- ifneq (,$(findstring arm,$(gcc_machine))) ++ ifneq (,$(findstring arm,$(cc_machine))) + libjvm_dir ?= $(JAVA_HOME)/jre/lib/arm/server + else +- ifneq (,$(findstring x64,$(gcc_machine))) ++ ifneq (,$(findstring x64,$(cc_machine))) + libjvm_dir ?= $(JAVA_HOME)/jre/lib/amd64/server + else + libjvm_dir ?= $(JAVA_HOME)/jre/lib/i386/server + endif + endif + endif + link_jvm = $(libjvm_dir)/libjvm.so + javac = $(JAVA_HOME)/bin/javac + jar = $(JAVA_HOME)/bin/jar + endif diff --git a/recipes/ohnet/config.yml b/recipes/ohnet/config.yml index f52e484dea6d6..e45e8eaf9a346 100644 --- a/recipes/ohnet/config.yml +++ b/recipes/ohnet/config.yml @@ -1,3 +1,5 @@ versions: + "1.36.5344": + folder: all "1.36.5182": folder: all diff --git a/recipes/ohpipeline/all/conandata.yml b/recipes/ohpipeline/all/conandata.yml new file mode 100644 index 0000000000000..22671b2e2dbe7 --- /dev/null +++ b/recipes/ohpipeline/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.139.1000": + source: + url: "https://github.com/openhome/ohPipeline/archive/refs/tags/ohMediaPlayer_1.139.1000.tar.gz" + sha256: "070eac6d974bbe520d0b292df1ca4a72160a2b607a60dabdaa0971c3ef96e5e4" + cmake: + url: "https://raw.githubusercontent.com/merakiacoustic/ohPipeline/ohMediaPlayer_1.139.1000_meraki3/CMakeLists.txt" + sha256: "4ebe83cf0419802f42d9d9c7ff36c666bd1094415eb29c77927273753019a202" +patches: + "1.139.1000": + - patch_file: "patches/001-missing-include.patch" + patch_type: "portability" + patch_description: "Add a missing stdlib include" diff --git a/recipes/ohpipeline/all/conanfile.py b/recipes/ohpipeline/all/conanfile.py new file mode 100755 index 0000000000000..556004392d827 --- /dev/null +++ b/recipes/ohpipeline/all/conanfile.py @@ -0,0 +1,129 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeDeps, CMakeToolchain, CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, download, export_conandata_patches, apply_conandata_patches +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + + +class OhPipelineConan(ConanFile): + name = "ohpipeline" + description = "OpenHome audio pipeline" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/openhome/ohPipeline" + topics = ("openhome", "ohnet", "ohpipeline", "upnp") + + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def export_sources(self): + export_conandata_patches(self) + + def build_requirements(self): + self.tool_requires("cmake/[>3.23 <4]") + + def requirements(self): + self.requires("ohnet/1.36.5182", transitive_headers=True, transitive_libs=True) + self.requires("openssl/[>=1.1 <4]") + self.requires("libmad/0.15.1b") + self.requires("alac/cci.20121212") + self.requires("libfdk_aac/2.0.3") + self.requires("faac/1.30") + self.requires("flac/1.4.3") + self.requires("ogg/1.3.5") + self.requires("vorbis/1.3.7") + + def layout(self): + cmake_layout(self, src_folder="src") + + 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 generate(self): + venv = VirtualBuildEnv(self) + venv.generate() + tc = CMakeToolchain(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def source(self): + get(self, **self.conan_data["sources"][self.version]["source"], strip_root=True) + download(self, **self.conan_data["sources"][self.version]["cmake"], filename="CMakeLists.txt") + + def build(self): + apply_conandata_patches(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() + + def package_info(self): + self.cpp_info.libs = [ + "ohPipeline", + "ohMediaPlayer", + "Odp", + "SourcePlaylist", + "SourceRadio", + "SourceSongcast", + "SourceScd", + "SourceRaop", + "SourceUpnpAv", + "Podcast", + "ScdSender", + "CodecWav", + "CodecPcm", + "CodecDsdDsf", + "CodecDsdDff", + "CodecDsdRaw", + "CodecAiffBase", + "CodecAifc", + "CodecAiff", + "CodecFlac", + "CodecAlacAppleBase", + "CodecAlacApple", + "CodecAacFdkBase", + "CodecAacFdkMp4", + "CodecAacFdkAdts", + "CodecMp3", + "CodecVorbis", + "WebAppFramework", + "WebAppFrameworkTestUtils", + "ConfigUi", + "ConfigUiTestUtils", + ] diff --git a/recipes/ohpipeline/all/patches/001-missing-include.patch b/recipes/ohpipeline/all/patches/001-missing-include.patch new file mode 100644 index 0000000000000..a6ff36f81a9fe --- /dev/null +++ b/recipes/ohpipeline/all/patches/001-missing-include.patch @@ -0,0 +1,10 @@ +--- a/OpenHome/Media/Protocol/ProtocolHls.cpp ++++ b/OpenHome/Media/Protocol/ProtocolHls.cpp +@@ -18,6 +18,7 @@ + #include + + #include ++#include + + namespace OpenHome { + namespace Media { diff --git a/recipes/ohpipeline/all/test_package/CMakeLists.txt b/recipes/ohpipeline/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bd868ecdf5a63 --- /dev/null +++ b/recipes/ohpipeline/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(ohpipeline REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PUBLIC ohpipeline::ohpipeline) diff --git a/recipes/ohpipeline/all/test_package/conanfile.py b/recipes/ohpipeline/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/ohpipeline/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/ohpipeline/all/test_package/test_package.cpp b/recipes/ohpipeline/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dce35f7c92826 --- /dev/null +++ b/recipes/ohpipeline/all/test_package/test_package.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +using namespace OpenHome; +using namespace OpenHome::Av; + +class RamStore : public IStaticDataSource +{ +public: + RamStore(const Brx& aImageFileName); + virtual ~RamStore(); +private: // from IStaticDataSource + void LoadStaticData(IStoreLoaderStatic& aLoader) override; +private: + Brhz iImageFileName; +}; + +RamStore::RamStore(const Brx& aImageFileName) + : iImageFileName(aImageFileName) +{ +} + +RamStore::~RamStore() {} + +void RamStore::LoadStaticData(IStoreLoaderStatic& aLoader) +{ + aLoader.AddStaticItem(StaticDataKey::kBufManufacturerName, "OpenHome"); + aLoader.AddStaticItem(StaticDataKey::kBufManufacturerInfo, "insert oh info here..."); + aLoader.AddStaticItem(StaticDataKey::kBufManufacturerUrl, "http://www.openhome.org"); + aLoader.AddStaticItem(StaticDataKey::kBufManufacturerImageUrl, "http://wiki.openhome.org/mediawiki/skins/openhome/images/logo.png"); + aLoader.AddStaticItem(StaticDataKey::kBufModelName, "OpenHome Media Player (test)"); + aLoader.AddStaticItem(StaticDataKey::kBufModelInfo, "Test implementation of ohMediaPlayer"); + aLoader.AddStaticItem(StaticDataKey::kBufModelUrl, "http://wiki.openhome.org/wiki/OhMedia"); + aLoader.AddStaticItem(StaticDataKey::kBufModelImageUrl, iImageFileName.CString()); +} + +int main() +{ + RamStore* ramStore = new RamStore(Brx::Empty()); + + delete ramStore; +} diff --git a/recipes/ohpipeline/config.yml b/recipes/ohpipeline/config.yml new file mode 100644 index 0000000000000..4948dbd895802 --- /dev/null +++ b/recipes/ohpipeline/config.yml @@ -0,0 +1,3 @@ +versions: + "1.139.1000": + folder: all diff --git a/recipes/onetbb/all/conandata.yml b/recipes/onetbb/all/conandata.yml index 4839476518f75..d6288f698e49a 100644 --- a/recipes/onetbb/all/conandata.yml +++ b/recipes/onetbb/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2021.12.0": + url: "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.12.0.tar.gz" + sha256: "c7bb7aa69c254d91b8f0041a71c5bcc3936acb64408a1719aec0b2b7639dd84f" "2021.10.0": url: "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.10.0.tar.gz" sha256: "487023a955e5a3cc6d3a0d5f89179f9b6c0ae7222613a7185b0227ba0c83700b" diff --git a/recipes/onetbb/all/conanfile.py b/recipes/onetbb/all/conanfile.py index b0c66b51e5856..7031f90417a73 100644 --- a/recipes/onetbb/all/conanfile.py +++ b/recipes/onetbb/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.build import cross_building from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, load, rmdir +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, load, rmdir, rm from conan.tools.gnu import PkgConfigDeps from conan.tools.scm import Version import os @@ -52,7 +52,7 @@ def _tbbbind_hwloc_version(self): @property def _tbbbind_supported(self): - return self.settings.os != "Macos" + return self.settings.os != "Macos" or Version(self.version) >= "2021.11.0" @property def _tbbbind_build(self): @@ -120,7 +120,9 @@ def generate(self): toolchain.variables["TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH"] = not self._tbbbind_build if self._tbbbind_explicit_hwloc: hwloc_package_folder = self.dependencies["hwloc"].package_folder - hwloc_lib_name = "hwloc.lib" if self.settings.os == "Windows" else "libhwloc.so" + hwloc_lib_name = ("hwloc.lib" if self.settings.os == "Windows" else + "libhwloc.dylib" if self.settings.os == "Macos" else + "libhwloc.so") toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_LIBRARY_PATH"] = \ os.path.join(hwloc_package_folder, "lib", hwloc_lib_name).replace("\\", "/") toolchain.variables[f"CMAKE_HWLOC_{self._tbbbind_hwloc_version}_INCLUDE_PATH"] = \ @@ -147,6 +149,7 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "TBB") diff --git a/recipes/onetbb/config.yml b/recipes/onetbb/config.yml index 39b3726474302..4ef9dafa04d03 100644 --- a/recipes/onetbb/config.yml +++ b/recipes/onetbb/config.yml @@ -1,4 +1,6 @@ versions: + "2021.12.0": + folder: all "2021.10.0": folder: all "2021.9.0": diff --git a/recipes/onnx/all/conandata.yml b/recipes/onnx/all/conandata.yml index ccb0c203d7239..0ac824c98a00d 100644 --- a/recipes/onnx/all/conandata.yml +++ b/recipes/onnx/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.16.1": + url: "https://github.com/onnx/onnx/archive/v1.16.1.tar.gz" + sha256: "0e6aa2c0a59bb2d90858ad0040ea1807117cc2f05b97702170f18e6cd6b66fb3" + "1.16.0": + url: "https://github.com/onnx/onnx/archive/v1.16.0.tar.gz" + sha256: "0ce153e26ce2c00afca01c331a447d86fbf21b166b640551fe04258b4acfc6a4" "1.15.0": url: "https://github.com/onnx/onnx/archive/v1.15.0.tar.gz" sha256: "c757132e018dd0dd171499ef74fca88b74c5430a20781ec53da19eb7f937ef68" @@ -11,9 +17,3 @@ sources: "1.13.1": url: "https://github.com/onnx/onnx/archive/refs/tags/v1.13.1.tar.gz" sha256: "090d3e10ec662a98a2a72f1bf053f793efc645824f0d4b779e0ce47468a0890e" - "1.12.0": - url: "https://github.com/onnx/onnx/archive/refs/tags/v1.12.0.tar.gz" - sha256: "052ad3d5dad358a33606e0fc89483f8150bb0655c99b12a43aa58b5b7f0cc507" -patches: - "1.12.0": - - patch_file: "patches/0001-fix-concurrent-proto3-remove-1.12.0.patch" diff --git a/recipes/onnx/all/conanfile.py b/recipes/onnx/all/conanfile.py index 4c5cfb0ecfc0d..02c220e3798ce 100644 --- a/recipes/onnx/all/conanfile.py +++ b/recipes/onnx/all/conanfile.py @@ -49,10 +49,19 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): + if Version(self.version) < "1.16.0": + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "clang": "5", + "apple-clang": "10", + } + # 1.16.0+ requires header available with gcc8+ return { "Visual Studio": "15", "msvc": "191", - "gcc": "7", + "gcc": "8", "clang": "5", "apple-clang": "10", } @@ -113,9 +122,6 @@ def generate(self): tc.variables["ONNX_BUILD_TESTS"] = False tc.variables["ONNX_USE_LITE_PROTO"] = self.dependencies.host["protobuf"].options.lite tc.variables["ONNX_ML"] = True - if Version(self.version) < "1.13.0": - tc.variables["ONNXIFI_ENABLE_EXT"] = False - tc.variables["ONNXIFI_DUMMY_BACKEND"] = False tc.variables["ONNX_VERIFY_PROTO3"] = Version(self.dependencies.host["protobuf"].ref.version).major == "3" if is_msvc(self): tc.variables["ONNX_USE_MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self) @@ -174,28 +180,6 @@ def _onnx_components(self): "requires": ["protobuf::libprotobuf"] } } - if Version(self.version) < "1.13.0": - components.update( - { - "onnxifi": { - "target": "onnxifi", - "system_libs": [(self.settings.os in ["Linux", "FreeBSD"], ["dl"])], - }, - "onnxifi_dummy": { - "target": "onnxifi_dummy", - "libs": ["onnxifi_dummy"], - "requires": ["onnxifi"] - }, - "onnxifi_loader": { - "target": "onnxifi_loader", - "libs": ["onnxifi_loader"], - "requires": ["onnxifi"] - }, - "onnxifi_wrapper": { - "target": "onnxifi_wrapper" - } - } - ) components["libonnx"]["defines"].append("__STDC_FORMAT_MACROS") return components diff --git a/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.12.0.patch b/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.12.0.patch deleted file mode 100644 index 1ce9c915aa488..0000000000000 --- a/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.12.0.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/onnx/gen_proto.py -+++ b/onnx/gen_proto.py -@@ -159,7 +159,7 @@ def convert(stem: str, package_name: str, output: str, do_onnx_ml: bool = False, - porto3_dir = os.path.dirname(proto3) - base_dir = os.path.dirname(porto3_dir) - gen_proto3_code(protoc_path, proto3, base_dir, base_dir, base_dir) -- pb3_files = glob.glob(os.path.join(porto3_dir, '*.proto3.*')) -+ pb3_files = glob.glob(os.path.join(porto3_dir, '{}.proto3.*'.format(proto_base))) - for pb3_file in pb3_files: - print(f"Removing {pb3_file}") - os.remove(pb3_file) diff --git a/recipes/onnx/config.yml b/recipes/onnx/config.yml index 669807aa7c0eb..9f508d50a4d4b 100644 --- a/recipes/onnx/config.yml +++ b/recipes/onnx/config.yml @@ -1,4 +1,8 @@ versions: + "1.16.1": + folder: all + "1.16.0": + folder: all "1.15.0": folder: all "1.14.1": @@ -7,5 +11,3 @@ versions: folder: all "1.13.1": folder: all - "1.12.0": - folder: all diff --git a/recipes/openal-soft/all/conandata.yml b/recipes/openal-soft/all/conandata.yml index 104b16635107e..23bf0e0ad9976 100644 --- a/recipes/openal-soft/all/conandata.yml +++ b/recipes/openal-soft/all/conandata.yml @@ -1,38 +1,16 @@ sources: + "1.23.1": + url: + - "https://github.com/kcat/openal-soft/releases/download/1.23.1/openal-soft-1.23.1.tar.bz2" + - "https://openal-soft.org/openal-releases/openal-soft-1.23.1.tar.bz2" + sha256: "796f4b89134c4e57270b7f0d755f0fa3435b90da437b745160a49bd41c845b21" "1.22.2": - url: "https://openal-soft.org/openal-releases/openal-soft-1.22.2.tar.bz2" + url: + - "https://github.com/kcat/openal-soft/releases/download/1.22.2/openal-soft-1.22.2.tar.bz2" + - "https://openal-soft.org/openal-releases/openal-soft-1.22.2.tar.bz2" sha256: "ae94cc95cda76b7cc6e92e38c2531af82148e76d3d88ce996e2928a1ea7c3d20" - "1.21.1": - url: "https://openal-soft.org/openal-releases/openal-soft-1.21.1.tar.bz2" - sha256: "c8ad767e9a3230df66756a21cc8ebf218a9d47288f2514014832204e666af5d8" - "1.21.0": - url: "https://openal-soft.org/openal-releases/openal-soft-1.21.0.tar.bz2" - sha256: "2916b4fc24e23b0271ce0b3468832ad8b6d8441b1830215b28cc4fee6cc89297" - "1.20.1": - url: "https://openal-soft.org/openal-releases/openal-soft-1.20.1.tar.bz2" - sha256: "b6ceb051325732c23f5c8b6d37dbd89534517e6439a87e970882b447c3025d6d" - "1.19.1": - url: "https://openal-soft.org/openal-releases/openal-soft-1.19.1.tar.bz2" - sha256: "5c2f87ff5188b95e0dc4769719a9d89ce435b8322b4478b95dd4b427fe84b2e9" patches: "1.22.2": - patch_file: "patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch" + patch_source: "https://github.com/kcat/openal-soft/commit/650a6d49e9a511d005171940761f6dd6b440ee66" - patch_file: "patches/1.22.2-0002-fix-pulseaudio-find-package-vars.patch" - "1.21.0": - - patch_file: "patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch" - - patch_file: "patches/1.21.0-0002-fix-windows-sdk.patch" - patch_description: "Avoid explicitly searching for the WindowsSDK" - patch_type: "portability" - patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614" - "1.20.1": - - patch_file: "patches/1.20.1-0001-fix-windows-sdk.patch" - patch_description: "Avoid explicitly searching for the WindowsSDK" - patch_type: "portability" - patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614" - "1.19.1": - - patch_file: "patches/1.19.1-0001-aligned-alloc.patch" - - patch_file: "patches/1.19.1-0002-gcc-10-fnocommon.patch" - - patch_file: "patches/1.19.1-0003-fix-windows-sdk.patch" - patch_description: "Avoid explicitly searching for the WindowsSDK" - patch_type: "portability" - patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614" diff --git a/recipes/openal-soft/all/conanfile.py b/recipes/openal-soft/all/conanfile.py index 83f92f752bca9..885d85434ec21 100644 --- a/recipes/openal-soft/all/conanfile.py +++ b/recipes/openal-soft/all/conanfile.py @@ -29,20 +29,16 @@ class OpenALSoftConan(ConanFile): "fPIC": True, } - @property - def _openal_cxx_backend(self): - return Version(self.version) >= "1.20" - @property def _min_cppstd(self): - return "11" if Version(self.version) < "1.21" else "14" + return 14 @property def _minimum_compilers_version(self): return { - "Visual Studio": "13" if Version(self.version) < "1.21" else "15", - "msvc": "180" if Version(self.version) < "1.21" else "191", - "gcc": "5", + "Visual Studio": "15", + "msvc": "191", + "gcc": "6", "clang": "5", } @@ -59,8 +55,6 @@ def configure(self): # OpenAL's API is pure C, thus the c++ standard does not matter # Because the backend is C++, the C++ STL matters self.settings.rm_safe("compiler.cppstd") - if not self._openal_cxx_backend: - self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") @@ -70,23 +64,22 @@ def requirements(self): self.requires("libalsa/1.2.10") def validate(self): - if self._openal_cxx_backend: - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._min_cppstd) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - compiler = self.settings.compiler + compiler = self.settings.compiler - minimum_version = self._minimum_compilers_version.get(str(compiler), False) - if minimum_version and Version(compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", - ) + minimum_version = self._minimum_compilers_version.get(str(compiler), False) + if minimum_version and Version(compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) - if compiler == "clang" and Version(compiler.version) < "9" and \ - compiler.get_safe("libcxx") in ("libstdc++", "libstdc++11"): - raise ConanInvalidConfiguration( - f"{self.ref} cannot be built with {compiler} {compiler.version} and stdlibc++(11) c++ runtime", - ) + if compiler == "clang" and Version(compiler.version) < "9" and \ + compiler.get_safe("libcxx") in ("libstdc++", "libstdc++11"): + raise ConanInvalidConfiguration( + f"{self.ref} cannot be built with {compiler} {compiler.version} and stdlibc++(11) c++ runtime", + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -155,9 +148,11 @@ def package_info(self): self.cpp_info.frameworks.append("ApplicationServices") elif self.settings.os == "Windows": self.cpp_info.system_libs.extend(["winmm", "ole32", "shell32", "user32"]) - if self._openal_cxx_backend and not self.options.shared: + if not self.options.shared: libcxx = stdcpp_library(self) if libcxx: self.cpp_info.system_libs.append(libcxx) if not self.options.shared: self.cpp_info.defines.append("AL_LIBTYPE_STATIC") + if self.settings.get_safe("compiler.libcxx") in ["libstdc++", "libstdc++11"]: + self.cpp_info.system_libs.append("atomic") diff --git a/recipes/openal-soft/all/patches/1.19.1-0001-aligned-alloc.patch b/recipes/openal-soft/all/patches/1.19.1-0001-aligned-alloc.patch deleted file mode 100644 index f734aeb89945e..0000000000000 --- a/recipes/openal-soft/all/patches/1.19.1-0001-aligned-alloc.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -546,7 +546,7 @@ IF(HAVE_INTRIN_H) - ENDIF() - - CHECK_SYMBOL_EXISTS(sysconf unistd.h HAVE_SYSCONF) --CHECK_SYMBOL_EXISTS(aligned_alloc stdlib.h HAVE_ALIGNED_ALLOC) -+#CHECK_SYMBOL_EXISTS(aligned_alloc stdlib.h HAVE_ALIGNED_ALLOC) - CHECK_SYMBOL_EXISTS(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN) - CHECK_SYMBOL_EXISTS(_aligned_malloc malloc.h HAVE__ALIGNED_MALLOC) - CHECK_SYMBOL_EXISTS(proc_pidpath libproc.h HAVE_PROC_PIDPATH) diff --git a/recipes/openal-soft/all/patches/1.19.1-0002-gcc-10-fnocommon.patch b/recipes/openal-soft/all/patches/1.19.1-0002-gcc-10-fnocommon.patch deleted file mode 100644 index 1283ee70f8fe7..0000000000000 --- a/recipes/openal-soft/all/patches/1.19.1-0002-gcc-10-fnocommon.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/Alc/bformatdec.h 2018-10-11 18:05:31.000000000 -0400 -+++ b/Alc/bformatdec.h 2020-10-10 21:01:08.842986977 -0400 -@@ -24,9 +24,9 @@ - /* NOTE: These are scale factors as applied to Ambisonics content. Decoder - * coefficients should be divided by these values to get proper N3D scalings. - */ --const ALfloat N3D2N3DScale[MAX_AMBI_COEFFS]; --const ALfloat SN3D2N3DScale[MAX_AMBI_COEFFS]; --const ALfloat FuMa2N3DScale[MAX_AMBI_COEFFS]; -+extern const ALfloat N3D2N3DScale[MAX_AMBI_COEFFS]; -+extern const ALfloat SN3D2N3DScale[MAX_AMBI_COEFFS]; -+extern const ALfloat FuMa2N3DScale[MAX_AMBI_COEFFS]; - - - struct AmbDecConf; diff --git a/recipes/openal-soft/all/patches/1.19.1-0003-fix-windows-sdk.patch b/recipes/openal-soft/all/patches/1.19.1-0003-fix-windows-sdk.patch deleted file mode 100644 index 922c2a2f1c321..0000000000000 --- a/recipes/openal-soft/all/patches/1.19.1-0003-fix-windows-sdk.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1092,17 +1092,24 @@ IF(HAVE_WINDOWS_H) - ENDIF() - - # Check DSound backend -- FIND_PACKAGE(DSound) -- IF(DSOUND_FOUND) -- OPTION(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) -- IF(ALSOFT_BACKEND_DSOUND) -- SET(HAVE_DSOUND 1) -- SET(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},") -- SET(ALC_OBJS ${ALC_OBJS} Alc/backends/dsound.c) -- ADD_BACKEND_LIBS(${DSOUND_LIBRARIES}) -- SET(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIRS}) -- ENDIF() -- ENDIF() -+ check_include_file(dsound.h HAVE_DSOUND_H) -+ if(DXSDK_DIR) -+ find_path(DSOUND_INCLUDE_DIR NAMES "dsound.h" -+ PATHS "${DXSDK_DIR}" PATH_SUFFIXES include -+ DOC "The DirectSound include directory") -+ endif() -+ if(HAVE_DSOUND_H OR DSOUND_INCLUDE_DIR) -+ option(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) -+ if(ALSOFT_BACKEND_DSOUND) -+ set(HAVE_DSOUND 1) -+ set(BACKENDS "${BACKENDS} DirectSound,") -+ set(ALC_OBJS ${ALC_OBJS} Alc/backends/dsound.c) -+ -+ if(NOT HAVE_DSOUND_H) -+ set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIR}) -+ endif() -+ endif() -+ endif() - - # Check for WASAPI backend - CHECK_INCLUDE_FILE(mmdeviceapi.h HAVE_MMDEVICEAPI_H) diff --git a/recipes/openal-soft/all/patches/1.20.1-0001-fix-windows-sdk.patch b/recipes/openal-soft/all/patches/1.20.1-0001-fix-windows-sdk.patch deleted file mode 100644 index 61ba2e012e0da..0000000000000 --- a/recipes/openal-soft/all/patches/1.20.1-0001-fix-windows-sdk.patch +++ /dev/null @@ -1,76 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -854,44 +854,38 @@ OPTION(ALSOFT_REQUIRE_WINMM "Require Windows Multimedia backend" OFF) - OPTION(ALSOFT_REQUIRE_DSOUND "Require DirectSound backend" OFF) - OPTION(ALSOFT_REQUIRE_WASAPI "Require WASAPI backend" OFF) - IF(WIN32) -- SET(WINSDK_LIB_DIRS ) -- SET(WINSDK_INCLUDE_DIRS ) -- FIND_PACKAGE(WindowsSDK) -- IF(WINDOWSSDK_FOUND) -- get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS) -- get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS) -- ENDIF() -- -- SET(OLD_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}) -- SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_WIN32_WINNT=0x0502) -- - # Check MMSystem backend -- CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H) -- FIND_LIBRARY(WINMM_LIBRARY NAMES winmm -- PATHS ${WINSDK_LIB_DIRS} -- PATH_SUFFIXES lib lib/x86 lib/x64) -- IF(HAVE_MMSYSTEM_H AND WINMM_LIBRARY) -- OPTION(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) -- IF(ALSOFT_BACKEND_WINMM) -- SET(HAVE_WINMM 1) -- SET(BACKENDS "${BACKENDS} WinMM,") -- SET(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) -- SET(EXTRA_LIBS ${WINMM_LIBRARY} ${EXTRA_LIBS}) -- ENDIF() -- ENDIF() -+ option(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) -+ if(ALSOFT_BACKEND_WINMM) -+ set(HAVE_WINMM 1) -+ set(BACKENDS "${BACKENDS} WinMM,") -+ set(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) -+ # There doesn't seem to be good way to search for winmm.lib for MSVC. -+ # find_library doesn't find it without being told to look in a specific -+ # place in the WindowsSDK, but it links anyway. If there ends up being -+ # Windows targets without this, another means to detect it is needed. -+ set(EXTRA_LIBS winmm ${EXTRA_LIBS}) -+ endif() - - # Check DSound backend -- FIND_PACKAGE(DSound) -- IF(DSOUND_FOUND) -- OPTION(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) -- IF(ALSOFT_BACKEND_DSOUND) -- SET(HAVE_DSOUND 1) -- SET(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},") -- SET(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) -- ADD_BACKEND_LIBS(${DSOUND_LIBRARIES}) -- SET(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIRS}) -- ENDIF() -- ENDIF() -+ check_include_file(dsound.h HAVE_DSOUND_H) -+ if(DXSDK_DIR) -+ find_path(DSOUND_INCLUDE_DIR NAMES "dsound.h" -+ PATHS "${DXSDK_DIR}" PATH_SUFFIXES include -+ DOC "The DirectSound include directory") -+ endif() -+ if(HAVE_DSOUND_H OR DSOUND_INCLUDE_DIR) -+ option(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) -+ if(ALSOFT_BACKEND_DSOUND) -+ set(HAVE_DSOUND 1) -+ set(BACKENDS "${BACKENDS} DirectSound,") -+ set(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) -+ -+ if(NOT HAVE_DSOUND_H) -+ set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIR}) -+ endif() -+ endif() -+ endif() - - # Check for WASAPI backend - CHECK_INCLUDE_FILE(mmdeviceapi.h HAVE_MMDEVICEAPI_H) diff --git a/recipes/openal-soft/all/patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch b/recipes/openal-soft/all/patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch deleted file mode 100644 index 11b0c43304b4a..0000000000000 --- a/recipes/openal-soft/all/patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch +++ /dev/null @@ -1,16 +0,0 @@ -gcc-11 triggers an error. std::aligned_alloc needs c++17. -This patch ports openal 1.21.1 behavior back to 1.21.0. ---- common/almalloc.cpp -+++ common/almalloc.cpp -@@ -21,4 +21,4 @@ --#if defined(HAVE_STD_ALIGNED_ALLOC) -- size = (size+(alignment-1))&~(alignment-1); -- return std::aligned_alloc(alignment, size); -+//#if defined(HAVE_STD_ALIGNED_ALLOC) -+// size = (size+(alignment-1))&~(alignment-1); -+// return std::aligned_alloc(alignment, size); --#elif defined(HAVE_POSIX_MEMALIGN) -+#if defined(HAVE_POSIX_MEMALIGN) -@@ -56,1 +56,1 @@ --#if defined(HAVE_STD_ALIGNED_ALLOC) || defined(HAVE_POSIX_MEMALIGN) -+#if defined(HAVE_POSIX_MEMALIGN) diff --git a/recipes/openal-soft/all/patches/1.21.0-0002-fix-windows-sdk.patch b/recipes/openal-soft/all/patches/1.21.0-0002-fix-windows-sdk.patch deleted file mode 100644 index 3a6c7afb5a414..0000000000000 --- a/recipes/openal-soft/all/patches/1.21.0-0002-fix-windows-sdk.patch +++ /dev/null @@ -1,74 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -880,49 +880,36 @@ option(ALSOFT_REQUIRE_WINMM "Require Windows Multimedia backend" OFF) - option(ALSOFT_REQUIRE_DSOUND "Require DirectSound backend" OFF) - option(ALSOFT_REQUIRE_WASAPI "Require WASAPI backend" OFF) - if(WIN32) -- set(WINSDK_LIB_DIRS ) -- set(WINSDK_INCLUDE_DIRS ) -- find_package(WindowsSDK) -- if(WINDOWSSDK_FOUND) -- get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS) -- get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS) -- endif() -- - # Check MMSystem backend -- check_include_files("windows.h;mmsystem.h" HAVE_MMSYSTEM_H) -- find_library(WINMM_LIBRARY NAMES winmm -- PATHS ${WINSDK_LIB_DIRS}) -- if(HAVE_MMSYSTEM_H AND WINMM_LIBRARY) -- option(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) -- if(ALSOFT_BACKEND_WINMM) -- set(HAVE_WINMM 1) -- set(BACKENDS "${BACKENDS} WinMM,") -- set(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) -- set(EXTRA_LIBS ${WINMM_LIBRARY} ${EXTRA_LIBS}) -- endif() -+ option(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) -+ if(ALSOFT_BACKEND_WINMM) -+ set(HAVE_WINMM 1) -+ set(BACKENDS "${BACKENDS} WinMM,") -+ set(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) -+ # There doesn't seem to be good way to search for winmm.lib for MSVC. -+ # find_library doesn't find it without being told to look in a specific -+ # place in the WindowsSDK, but it links anyway. If there ends up being -+ # Windows targets without this, another means to detect it is needed. -+ set(EXTRA_LIBS winmm ${EXTRA_LIBS}) - endif() - - # Check DSound backend -- find_package(DSound) -- if(DSOUND_FOUND) -+ check_include_file(dsound.h HAVE_DSOUND_H) -+ if(DXSDK_DIR) -+ find_path(DSOUND_INCLUDE_DIR NAMES "dsound.h" -+ PATHS "${DXSDK_DIR}" PATH_SUFFIXES include -+ DOC "The DirectSound include directory") -+ endif() -+ if(HAVE_DSOUND_H OR DSOUND_INCLUDE_DIR) - option(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) - if(ALSOFT_BACKEND_DSOUND) - set(HAVE_DSOUND 1) -- set(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},") -- set(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) -- add_backend_libs(${DSOUND_LIBRARIES}) -- set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIRS}) -- endif() -- endif() -+ set(BACKENDS "${BACKENDS} DirectSound,") -+ set(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) - -- # Check for WASAPI backend -- check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H) -- if(HAVE_MMDEVICEAPI_H) -- option(ALSOFT_BACKEND_WASAPI "Enable WASAPI backend" ON) -- if(ALSOFT_BACKEND_WASAPI) -- set(HAVE_WASAPI 1) -- set(BACKENDS "${BACKENDS} WASAPI,") -- set(ALC_OBJS ${ALC_OBJS} alc/backends/wasapi.cpp alc/backends/wasapi.h) -+ if(NOT HAVE_DSOUND_H) -+ set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIR}) -+ endif() - endif() - endif() - endif() diff --git a/recipes/openal-soft/config.yml b/recipes/openal-soft/config.yml index e4eea213adbce..a3a476fc04f3a 100644 --- a/recipes/openal-soft/config.yml +++ b/recipes/openal-soft/config.yml @@ -1,11 +1,5 @@ versions: - "1.22.2": - folder: all - "1.21.1": - folder: all - "1.21.0": + "1.23.1": folder: all - "1.20.1": - folder: all - "1.19.1": + "1.22.2": folder: all diff --git a/recipes/openapi-generator/all/conandata.yml b/recipes/openapi-generator/all/conandata.yml index e13b56c9de28d..d977cc57e49bd 100644 --- a/recipes/openapi-generator/all/conandata.yml +++ b/recipes/openapi-generator/all/conandata.yml @@ -1,13 +1,13 @@ sources: + "7.5.0": + url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.5.0/openapi-generator-cli-7.5.0.jar" + sha256: "47ebbd1beddaf7dfbee523e7b87623c6ec1b1d42960fbe15f6cad2f6426c69bf" "7.4.0": url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar" sha256: "e42769a98fef5634bee0f921e4b90786a6b3292aa11fe8d2f84c045ac435ab29" "7.3.0": url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.3.0/openapi-generator-cli-7.3.0.jar" sha256: "879c15340a75a19a7e720efc242c3223e0e4207b0694d6d1cea5c7dd87cf1cce" - "7.2.0": - url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.2.0/openapi-generator-cli-7.2.0.jar" - sha256: "1cf0c80de12c0fdc8594289c19e414b402108ef10b8dd0bfda1953151341ab5d" "6.6.0": url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar" sha256: "9718ff7844e89462c75dcd9b20a35136f6db257bfe1b874db1e3002e99de4609" diff --git a/recipes/openapi-generator/all/conanfile.py b/recipes/openapi-generator/all/conanfile.py index 369f8d2a3dd64..907abc8f087d1 100644 --- a/recipes/openapi-generator/all/conanfile.py +++ b/recipes/openapi-generator/all/conanfile.py @@ -20,7 +20,7 @@ def layout(self): pass def requirements(self): - self.requires("openjdk/19.0.2") + self.requires("openjdk/21.0.1") def package_id(self): del self.info.settings.arch diff --git a/recipes/openapi-generator/config.yml b/recipes/openapi-generator/config.yml index 949f6537e4806..fd40653d9c013 100644 --- a/recipes/openapi-generator/config.yml +++ b/recipes/openapi-generator/config.yml @@ -1,9 +1,9 @@ versions: + "7.5.0": + folder: all "7.4.0": folder: all "7.3.0": folder: all - "7.2.0": - folder: all "6.6.0": folder: all diff --git a/recipes/openblas/all/conandata.yml b/recipes/openblas/all/conandata.yml index d0f076aeb8032..85e4fee5631f1 100644 --- a/recipes/openblas/all/conandata.yml +++ b/recipes/openblas/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.3.27": + url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.27.tar.gz" + sha256: "aa2d68b1564fe2b13bc292672608e9cdeeeb6dc34995512e65c3b10f4599e897" "0.3.26": url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.26.tar.gz" sha256: "4e6e4f5cb14c209262e33e6816d70221a2fe49eb69eaf0a06f065598ac602c68" diff --git a/recipes/openblas/all/conanfile.py b/recipes/openblas/all/conanfile.py index cb78919db63db..6fcc5d83048b9 100644 --- a/recipes/openblas/all/conanfile.py +++ b/recipes/openblas/all/conanfile.py @@ -1,15 +1,63 @@ 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.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc from conan.tools.scm import Version -from conan.tools.apple import fix_apple_shared_install_name -from conan.errors import ConanInvalidConfiguration import os -import functools +import textwrap required_conan_version = ">=1.53.0" +# Maps Conan's settings.arch to the corresponding OpenBLAS TARGET: +conan_arch_to_openblas_target = { + "x86": "SANDYBRIDGE", # Sandy bridge was discontinued in September of 2013, + "x86_64": "SANDYBRIDGE", # supporting older CPUs is a performance trade-off + "ppc32be": None, # TODO: OpenBLAS has POWER4, POWER5, POWER6, POWER7, + "ppc32": None, # POWER8, POWER9, POWER10, PPCG4, PPC970, PPC970MP, + "ppc64le": None, # PPC440, PPC440FP2, CELL + "ppc64": None, + "armv4": None, # Not supported by OpenBLAS + "armv4i": None, # Not supported by OpenBLAS + "armv5el": "ARMV5", + "armv5hf": "ARMV5", + "armv6": "ARMV6", + "armv7": "ARMV7", + "armv7hf": "ARMV7", + "armv7s": "ARMV7", + "armv7k": "ARMV7", + "armv8": "ARMV8", + "armv8_32": "ARMV7", # No 32-bit ARMv8 TARGET in OpenBLAS + "armv8.3": "ARMV8", + "arm64ec": "ARMV8", + "sparc": None, # TODO: OpenBLAS has SPARC, SPARCV7 + "sparcv9": None, + "mips": None, # TODO: OpenBLAS has P5600, MIPS1004K and MIPS24K + "mips64": "MIPS64_GENERIC", + "avr": None, # Not supported by OpenBLAS + "s390": None, # Not supported by OpenBLAS + "s390x": None, # Not supported by OpenBLAS + "asm.js": "GENERIC", # TODO: ? + "wasm": "GENERIC", # TODO: ? + "sh4le": None, # Not supported by OpenBLAS + "e2k-v2": "E2K", + "e2k-v3": "E2K", + "e2k-v4": "E2K", + "e2k-v5": "E2K", + "e2k-v6": "E2K", + "e2k-v7": "E2K", + "riscv64": "RISCV64_GENERIC", + "riscv32": None, # Not supported by OpenBLAS + "xtensalx6": None, # Not supported by OpenBLAS + "xtensalx106": None, # Not supported by OpenBLAS + "xtensalx7": None, # Not supported by OpenBLAS +} + +# Taken from OpenBLAS TargetList.txt +available_openblas_targets = ["P2", "KATMAI", "COPPERMINE", "NORTHWOOD", "PRESCOTT", "BANIAS", "YONAH", "CORE2", "PENRYN", "DUNNINGTON", "NEHALEM", "SANDYBRIDGE", "HASWELL", "SKYLAKEX", "ATOM", "COOPERLAKE", "SAPPHIRERAPIDS", "ATHLON", "OPTERON", "OPTERON_SSE3", "BARCELONA", "SHANGHAI", "ISTANBUL", "BOBCAT", "BULLDOZER", "PILEDRIVER", "STEAMROLLER", "EXCAVATOR", "ZEN", "SSE_GENERIC", "VIAC3", "NANO", "POWER4", "POWER5", "POWER6", "POWER7", "POWER8", "POWER9", "POWER10", "PPCG4", "PPC970", "PPC970MP", "PPC440", "PPC440FP2", "CELL", "P5600", "MIPS1004K", "MIPS24K", "MIPS64_GENERIC", "SICORTEX", "LOONGSON3A", "LOONGSON3B", "I6400", "P6600", "I6500", "ITANIUM2", "SPARC", "SPARCV7", "CORTEXA15", "CORTEXA9", "ARMV7", "ARMV6", "ARMV5", "ARMV8", "CORTEXA53", "CORTEXA57", "CORTEXA72", "CORTEXA73", "CORTEXA76", "CORTEXA510", "CORTEXA710", "CORTEXX1", "CORTEXX2", "NEOVERSEN1", "NEOVERSEV1", "NEOVERSEN2", "CORTEXA55", "EMAG8180", "FALKOR", "THUNDERX", "THUNDERX2T99", "TSV110", "THUNDERX3T110", "VORTEX", "A64FX", "ARMV8SVE", "FT2000", "ZARCH_GENERIC", "Z13", "Z14", "RISCV64_GENERIC", "RISCV64_ZVL128B", "C910V", "x280", "RISCV64_ZVL256B", "LOONGSONGENERIC", "LOONGSON3R5", "LOONGSON2K1000", "E2K", "EV4", "EV5", "EV6", "CSKY", "CK860FV"] + class OpenblasConan(ConanFile): name = "openblas" @@ -18,42 +66,66 @@ class OpenblasConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.openblas.net" topics = ("blas", "lapack") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "build_lapack": [True, False], + "build_relapack": [True, False], "use_thread": [True, False], + "use_locking": [True, False], "dynamic_arch": [True, False], + "target": [None] + available_openblas_targets } default_options = { "shared": False, "fPIC": True, - "build_lapack": False, + "build_lapack": True, + "build_relapack": False, "use_thread": True, + "use_locking": True, "dynamic_arch": False, + "target": None, + } + options_description = { + "build_lapack": "Build LAPACK and LAPACKE", + "build_relapack": "Build with ReLAPACK (recursive implementation of several LAPACK functions on top of standard LAPACK)", + "use_thread": "Enable threads support", + "use_locking": "Use locks even in single-threaded builds to make them callable from multiple threads", + "dynamic_arch": "Include support for multiple CPU targets, with automatic selection at runtime (x86/x86_64, aarch64 or ppc only)", + "target": "OpenBLAS TARGET variable (see TargetList.txt)", } short_paths = True - package_type = "library" @property def _fortran_compiler(self): comp_exe = self.conf.get("tools.build:compiler_executables") - if comp_exe and 'fortran' in comp_exe: + if comp_exe and "fortran" in comp_exe: return comp_exe["fortran"] return None def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if Version(self.version) >= "0.3.21": - # INFO: When no Fortran compiler is available, OpenBLAS builds LAPACK from an f2c-converted copy of LAPACK unless the NO_LAPACK option is specified - self.options.build_lapack = True + # When no Fortran compiler is available, OpenBLAS builds LAPACK from an f2c-converted copy of LAPACK unless the NO_LAPACK option is specified. + # This is not available before v0.3.21. + if Version(self.version) < "0.3.21": + self.options.build_lapack = False + self.options.build_relapack = False def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + # When cross-compiling, OpenBLAS requires explicitly setting TARGET + if cross_building(self, skip_x64_x86=True) and not self.options.target: + # Try inferring the target from settings.arch + target = conan_arch_to_openblas_target.get(str(self.settings.arch)) + if target: + self.output.warning(f'Setting OpenBLAS TARGET={target} based on settings.arch. This may result in suboptimal performance. Set the "{self.name}/*:target=XXX" option to silence this warning.') + self.options.target = target + def validate(self): if Version(self.version) < "0.3.24" and self.settings.arch == "armv8": # OpenBLAS fails to detect the appropriate target architecture for armv8 for versions < 0.3.24, as it matches the 32 bit variant instead of 64. @@ -61,103 +133,122 @@ def validate(self): # This would be a reasonably trivial hotfix to backport. raise ConanInvalidConfiguration("armv8 builds are not currently supported for versions lower than 0.3.24. Contributions to support this are welcome.") - if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): - raise ConanInvalidConfiguration("Cross-building not implemented") + if self.options.build_relapack: + if not self.options.build_lapack: + raise ConanInvalidConfiguration(f'"{self.name}/*:build_relapack=True" option requires "{self.name}/*:build_lapack=True"') + if self.settings.compiler not in ["gcc", "clang"]: + # ld: unknown option: --allow-multiple-definition on apple-clang + raise ConanInvalidConfiguration(f'"{self.name}/*:build_relapack=True" option is only supported for GCC and Clang') - def source(self): - get(self, - **self.conan_data["sources"][self.version], - strip_root=True, - destination=self.source_folder - ) + def validate_build(self): + if Version(self.version) < "0.3.22" and cross_building(self, skip_x64_x86=True): + # OpenBLAS CMake builds did not support some of the cross-compilation targets in 0.3.20/21 and earlier. + # This was fixed in https://github.com/OpenMathLib/OpenBLAS/pull/3714 and https://github.com/OpenMathLib/OpenBLAS/pull/3958 + raise ConanInvalidConfiguration(f"Cross-building is not supported for {self.name}/0.3.21 and earlier.") - if 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 + # If we're cross-compiling, and the user didn't provide the target, and + # we couldn't infer the target from settings.arch, fail + if cross_building(self, skip_x64_x86=True) and not self.options.target: + raise ConanInvalidConfiguration(f'Could not determine OpenBLAS TARGET. Please set the "{self.name}/*:target=XXX" option.') + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def layout(self): cmake_layout(self, src_folder="src") def generate(self): tc = CMakeToolchain(self) + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_TESTING"] = False - tc.cache_variables["NOFORTRAN"] = not self.options.build_lapack + tc.variables["NOFORTRAN"] = not self.options.build_lapack # This checks explicit user-specified fortran compiler - if self.options.build_lapack: - if not self._fortran_compiler: - if Version(self.version) < "0.3.21": - self.output.warning( - "Building with LAPACK support requires a Fortran compiler.") - else: - tc.cache_variables["C_LAPACK"] = True - tc.cache_variables["NOFORTRAN"] = True - self.output.info( - "Building LAPACK without Fortran compiler") - - 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 - tc.cache_variables["USE_LOCKING"] = not self.options.use_thread - - # don't, may lie to consumer, /MD or /MT is managed by conan - tc.cache_variables["MSVC_STATIC_CRT"] = False + if self.options.build_lapack and not self._fortran_compiler: + if Version(self.version) < "0.3.21": + self.output.warning("Building with LAPACK support requires a Fortran compiler.") + else: + tc.variables["C_LAPACK"] = True + tc.variables["NOFORTRAN"] = True + self.output.info("Building LAPACK without a Fortran compiler") + + tc.variables["BUILD_WITHOUT_LAPACK"] = not self.options.build_lapack + tc.variables["BUILD_RELAPACK"] = self.options.build_relapack + + tc.variables["DYNAMIC_ARCH"] = self.options.dynamic_arch + tc.variables["USE_THREAD"] = self.options.use_thread + tc.variables["USE_LOCKING"] = self.options.use_locking + + tc.variables["MSVC_STATIC_CRT"] = is_msvc_static_runtime(self) # This is a workaround to add the libm dependency on linux, # which is required to successfully compile on older gcc versions. - tc.cache_variables["ANDROID"] = self.settings.os in ["Linux", "Android"] + tc.variables["ANDROID"] = self.settings.os in ["Linux", "Android"] + if self.options.target: + tc.cache_variables["TARGET"] = self.options.target + + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() - def build(self): + def _patch_sources(self): + if Version(self.version) <= "0.3.15": + replace_in_file(self, os.path.join(self.source_folder, "cmake", "utils.cmake"), + "set(obj_defines ${defines_in})", textwrap.dedent("""\ + set(obj_defines ${defines_in}) + + list(FIND obj_defines "RC" def_idx) + if (${def_idx} GREATER -1) + list(REMOVE_ITEM obj_defines "RC") + list(APPEND obj_defines "RC=RC") + endif () + list(FIND obj_defines "CR" def_idx) + if (${def_idx} GREATER -1) + list(REMOVE_ITEM obj_defines "CR") + list(APPEND obj_defines "CR=CR") + endif ()""")) if Version(self.version) < "0.3.21": + f_check_cmake = os.path.join(self.source_folder, "cmake", "f_check.cmake") if Version(self.version) >= "0.3.12": - 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.")""" - ) + replace_in_file(self, f_check_cmake, + 'message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK")', + 'message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.")') else: - search = "enable_language(Fortran)" - replace = """include(CheckLanguage) -check_language(Fortran) -if(CMAKE_Fortran_COMPILER) - enable_language(Fortran) -else() - message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.") - set (NOFORTRAN 1) - set (NO_LAPACK 1) -endif()""" - - replace_in_file( - self, - os.path.join(self.source_folder, self.source_folder, "cmake", "f_check.cmake"), - search, - replace, - ) - cmake = self._configure_cmake() + replace_in_file(self, f_check_cmake, + "enable_language(Fortran)", + textwrap.dedent("""\ + include(CheckLanguage) + check_language(Fortran) + if(CMAKE_Fortran_COMPILER) + enable_language(Fortran) + else() + message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.") + set (NOFORTRAN 1) + set (NO_LAPACK 1) + endif()""")) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) fix_apple_shared_install_name(self) + @property + def _lib_name(self): + if self.options.shared and self.settings.build_type == "Debug" and not is_msvc(self): + return "openblas_d" + return "openblas" + def package_info(self): # CMake config file: # - OpenBLAS always has one and only one of these components: openmp, pthread or serial. @@ -166,14 +257,12 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "OpenBLAS") self.cpp_info.set_property("cmake_target_name", "OpenBLAS::OpenBLAS") self.cpp_info.set_property("pkg_config_name", "openblas") + # 'pthread' causes issues without namespace cmake_component_name = "pthread" if self.options.use_thread else "serial" # TODO: how to model this in CMakeDeps? - self.cpp_info.components["openblas_component"].set_property( - "cmake_target_name", "OpenBLAS::" + cmake_component_name) # 'pthread' causes issues without namespace + self.cpp_info.components["openblas_component"].set_property("cmake_target_name", f"OpenBLAS::{cmake_component_name}") self.cpp_info.components["openblas_component"].set_property("pkg_config_name", "openblas") - self.cpp_info.components["openblas_component"].includedirs.append( - os.path.join("include", "openblas") - ) - self.cpp_info.components["openblas_component"].libs = collect_libs(self) + self.cpp_info.components["openblas_component"].includedirs.append(os.path.join("include", "openblas")) + self.cpp_info.components["openblas_component"].libs = [self._lib_name] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["openblas_component"].system_libs.append("m") if self.options.use_thread: @@ -181,13 +270,12 @@ def package_info(self): if self.options.build_lapack and self._fortran_compiler: self.cpp_info.components["openblas_component"].system_libs.append("gfortran") - self.output.info( - "Setting OpenBLAS_HOME environment variable: {}".format(self.package_folder) - ) - self.env_info.OpenBLAS_HOME = self.package_folder + self.buildenv_info.define_path("OpenBLAS_HOME", self.package_folder) + self.runenv_info.define_path("OpenBLAS_HOME", self.package_folder) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "OpenBLAS" self.cpp_info.names["cmake_find_package_multi"] = "OpenBLAS" self.cpp_info.components["openblas_component"].names["cmake_find_package"] = cmake_component_name self.cpp_info.components["openblas_component"].names["cmake_find_package_multi"] = cmake_component_name + self.env_info.OpenBLAS_HOME = self.package_folder diff --git a/recipes/openblas/config.yml b/recipes/openblas/config.yml index e0275b7ea815a..e0f3014a9fdda 100644 --- a/recipes/openblas/config.yml +++ b/recipes/openblas/config.yml @@ -1,4 +1,6 @@ versions: + "0.3.27": + folder: all "0.3.26": folder: all "0.3.25": diff --git a/recipes/opencolorio/all/conanfile.py b/recipes/opencolorio/all/conanfile.py index 49d9c8b544de8..df0fa402cd1f2 100644 --- a/recipes/opencolorio/all/conanfile.py +++ b/recipes/opencolorio/all/conanfile.py @@ -46,11 +46,11 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if Version(self.version) < "2.2.0": self.requires("openexr/2.5.7") else: - self.requires("openexr/3.2.1") + self.requires("openexr/3.2.3") self.requires("imath/3.1.9") if Version(self.version) < "2.0.0": diff --git a/recipes/opencolorio/all/patches/1.1.1.patch b/recipes/opencolorio/all/patches/1.1.1.patch deleted file mode 100644 index 579e529242a44..0000000000000 --- a/recipes/opencolorio/all/patches/1.1.1.patch +++ /dev/null @@ -1,283 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e4f31196..b73396b4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -4,11 +4,13 @@ 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::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 b9fb2393..b1a206e7 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 d31b4e34..4aa1efb2 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 4955f4db..14b5017f 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 8b05debc..a7d6031f 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 1eb691b6..a2f099ab 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 68fcef60..a1c1c1d8 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/fix-cmake-source-dir-and-targets.patch b/recipes/opencolorio/all/patches/fix-cmake-source-dir-and-targets.patch deleted file mode 100644 index c9f1055c82e2c..0000000000000 --- a/recipes/opencolorio/all/patches/fix-cmake-source-dir-and-targets.patch +++ /dev/null @@ -1,86 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b0840ac2..e4875ab6 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 86a02258..a8fed622 100644 ---- a/share/cmake/modules/FindExtPackages.cmake -+++ b/share/cmake/modules/FindExtPackages.cmake -@@ -26,7 +26,7 @@ set(CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY ON CACHE BOOL - - # expat - # https://github.com/libexpat/libexpat --find_package(expat 2.2.8 REQUIRED) -+find_package(EXPAT 2.2.8 REQUIRED) - - # yaml-cpp - # https://github.com/jbeder/yaml-cpp -@@ -50,9 +50,9 @@ 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_HALF_LIB OpenEXR::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) - endif() - -@@ -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/OpenColorIO/CMakeLists.txt b/src/OpenColorIO/CMakeLists.txt -index be50b7b6..8423a099 100755 ---- a/src/OpenColorIO/CMakeLists.txt -+++ b/src/OpenColorIO/CMakeLists.txt -@@ -211,7 +211,7 @@ target_link_libraries(OpenColorIO - PUBLIC - OpenColorIOHeaders - PRIVATE -- expat::expat -+ EXPAT::EXPAT - ${OCIO_HALF_LIB} - pystring::pystring - sampleicc::sampleicc -diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt -index 7eb1cd8a..de136073 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/pstring.patch b/recipes/opencolorio/all/patches/pstring.patch deleted file mode 100644 index 38f15d7e20889..0000000000000 --- a/recipes/opencolorio/all/patches/pstring.patch +++ /dev/null @@ -1,117 +0,0 @@ -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/strlen.patch b/recipes/opencolorio/all/patches/strlen.patch deleted file mode 100644 index b90bcdfcf5d57..0000000000000 --- a/recipes/opencolorio/all/patches/strlen.patch +++ /dev/null @@ -1,12 +0,0 @@ -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/opencv/4.x/conandata.yml b/recipes/opencv/4.x/conandata.yml index 523e50b3b56b9..8c1ffb58a9492 100644 --- a/recipes/opencv/4.x/conandata.yml +++ b/recipes/opencv/4.x/conandata.yml @@ -1,4 +1,14 @@ sources: + "4.10.0": + - url: "https://github.com/opencv/opencv/archive/refs/tags/4.10.0.tar.gz" + sha256: "b2171af5be6b26f7a06b1229948bbb2bdaa74fcf5cd097e0af6378fce50a6eb9" + - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/4.10.0.tar.gz" + sha256: "65597f8fb8dc2b876c1b45b928bbcc5f772ddbaf97539bf1b737623d0604cba1" + "4.9.0": + - url: "https://github.com/opencv/opencv/archive/refs/tags/4.9.0.tar.gz" + sha256: "ddf76f9dffd322c7c3cb1f721d0887f62d747b82059342213138dc190f28bc6c" + - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/4.9.0.tar.gz" + sha256: "8952c45a73b75676c522dd574229f563e43c271ae1d5bbbd26f8e2b6bc1a4dae" "4.8.1": - url: "https://github.com/opencv/opencv/archive/refs/tags/4.8.1.tar.gz" sha256: "62f650467a60a38794d681ae7e66e3e8cfba38f445e0bf87867e2f2cdc8be9d5" @@ -20,6 +30,50 @@ sources: - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/4.1.2.tar.gz" sha256: "0f6c3d30baa39e3e7611afb481ee86dea45dafb182cac87d570c95dccd83eb8b" patches: + "4.10.0": + - patch_file: "patches/4.5.5-0001-find-openexr.patch" + patch_description: "Robust discovery & injection of OpenEXR" + patch_type: "conan" + - patch_file: "patches/4.5.5-0003-find-quirc.patch" + patch_description: "Robust discovery & injection of quirc" + patch_type: "conan" + - patch_file: "patches/4.8.1-0001-find-ade.patch" + patch_description: "Robust discovery & injection of ade" + patch_type: "conan" + - patch_file: "patches/4.5.1-0001-tracking-no-plot-deps.patch" + patch_description: "Fix requirements of tracking module" + patch_type: "conan" + - patch_file: "patches/4.1.2-0006-hdf.patch" + patch_description: "Robust discovery of hdf" + patch_type: "conan" + - patch_file: "patches/4.10.0-0001-fix-zlib-static-android.patch" + patch_description: "Fix discovery of zlib static if Android" + patch_type: "conan" + - patch_file: "patches/4.1.2-0007-android-install-layout.patch" + patch_description: "Honor install layout from conan if Android" + patch_type: "conan" + "4.9.0": + - patch_file: "patches/4.5.5-0001-find-openexr.patch" + patch_description: "Robust discovery & injection of OpenEXR" + patch_type: "conan" + - patch_file: "patches/4.5.5-0003-find-quirc.patch" + patch_description: "Robust discovery & injection of quirc" + patch_type: "conan" + - patch_file: "patches/4.8.1-0001-find-ade.patch" + patch_description: "Robust discovery & injection of ade" + patch_type: "conan" + - patch_file: "patches/4.5.1-0001-tracking-no-plot-deps.patch" + patch_description: "Fix requirements of tracking module" + patch_type: "conan" + - patch_file: "patches/4.1.2-0006-hdf.patch" + patch_description: "Robust discovery of hdf" + patch_type: "conan" + - patch_file: "patches/4.5.2-0001-fix-zlib-static-android.patch" + patch_description: "Fix discovery of zlib static if Android" + patch_type: "conan" + - patch_file: "patches/4.1.2-0007-android-install-layout.patch" + patch_description: "Honor install layout from conan if Android" + patch_type: "conan" "4.8.1": - patch_file: "patches/4.5.5-0001-find-openexr.patch" patch_description: "Robust discovery & injection of OpenEXR" diff --git a/recipes/opencv/4.x/conanfile.py b/recipes/opencv/4.x/conanfile.py index 0d5396ed1027e..04d8d1d48cfcc 100644 --- a/recipes/opencv/4.x/conanfile.py +++ b/recipes/opencv/4.x/conanfile.py @@ -6,7 +6,7 @@ from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rename, replace_in_file, rmdir, save from conan.tools.gnu import PkgConfigDeps -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.microsoft import msvc_runtime_flag from conan.tools.scm import Version import os import re @@ -220,6 +220,14 @@ class OpenCVConan(ConanFile): short_paths = True + @property + def _is_cl_like(self): + return self.settings.compiler.get_safe("runtime") is not None + + @property + def _is_cl_like_static_runtime(self): + return self._is_cl_like and "MT" in msvc_runtime_flag(self) + @property def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" @@ -1119,7 +1127,7 @@ def requirements(self): elif self.options.get_safe("with_jpeg2000") == "openjpeg": self.requires("openjpeg/2.5.2") if self.options.get_safe("with_png"): - self.requires("libpng/1.6.43") + self.requires("libpng/[>=1.6 <2]") if self.options.get_safe("with_openexr"): self.requires("openexr/3.2.3") if self.options.get_safe("with_tiff"): @@ -1190,8 +1198,8 @@ def validate(self): self._check_mandatory_options(self._opencv_modules) if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) - if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): - raise ConanInvalidConfiguration("Visual Studio with static runtime is not supported for shared library.") + if self.options.shared and self._is_cl_like and self._is_cl_like_static_runtime: + raise ConanInvalidConfiguration("MSVC or clang-cl with static runtime are not supported for shared library.") if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "4": raise ConanInvalidConfiguration("Clang 3.x can't build OpenCV 4.x due to an internal bug.") if self.options.get_safe("dnn_cuda") and \ @@ -1238,6 +1246,10 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "ANDROID OR NOT UNIX", "FALSE") replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "elseif(EMSCRIPTEN)", "elseif(QNXNTO)\nelseif(EMSCRIPTEN)") + ## Upstream CMakeLists vendors quirc in CMakeLists of 3rdparty/quirc. + ## Instead we rely on find-quirc.patch in order to link external quirc. + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(3rdparty/quirc)", "") + ## Fix link to several dependencies replace_in_file(self, os.path.join(self.source_folder, "modules", "imgcodecs", "CMakeLists.txt"), "JASPER_", "Jasper_") replace_in_file(self, os.path.join(self.source_folder, "modules", "imgcodecs", "CMakeLists.txt"), "${GDAL_LIBRARY}", "GDAL::GDAL") @@ -1411,10 +1423,11 @@ def generate(self): tc.variables["WITH_OPENNI"] = False tc.variables["WITH_OPENNI2"] = False tc.variables["WITH_OPENVX"] = False + tc.variables["WITH_CAROTENE"] = False tc.variables["WITH_PLAIDML"] = False tc.variables["WITH_PVAPI"] = False tc.variables["WITH_QT"] = self.options.get_safe("with_qt", False) - tc.variables["WITH_QUIRC"] = False + tc.variables["WITH_QUIRC"] = self.options.get_safe("with_quirc", False) tc.variables["WITH_V4L"] = self.options.get_safe("with_v4l", False) tc.variables["WITH_VA"] = False tc.variables["WITH_VA_INTEL"] = False @@ -1440,7 +1453,7 @@ def generate(self): tc.variables["WITH_GDAL"] = self.options.get_safe("with_gdal", False) tc.variables["WITH_GDCM"] = self.options.get_safe("with_gdcm", False) tc.variables["WITH_EIGEN"] = self.options.with_eigen - tc.variables["WITH_DSHOW"] = is_msvc(self) + tc.variables["WITH_DSHOW"] = self._is_cl_like tc.variables["WITH_MSMF"] = self.options.get_safe("with_msmf", False) tc.variables["WITH_MSMF_DXVA"] = self.options.get_safe("with_msmf_dxva", False) tc.variables["OPENCV_MODULES_PUBLIC"] = "opencv" @@ -1473,6 +1486,15 @@ def generate(self): tc.variables["WITH_AVIF"] = self.options.get_safe("with_avif", False) tc.variables["WITH_FLATBUFFERS"] = self.options.get_safe("with_flatbuffers", False) + if Version(self.version) >= "4.10.0": + tc.variables["WITH_KLEIDICV"] = False + tc.variables["WITH_NDSRVP"] = False + tc.variables["OBSENSOR_USE_ORBBEC_SDK"] = False + if is_apple_os(self): + # default behavior for 4.9.0 + tc.variables["WITH_OBSENSOR"] = False + tc.variables["WITH_ZLIB_NG"] = False + # Special world option merging all enabled modules into one big library file tc.variables["BUILD_opencv_world"] = self.options.world @@ -1484,8 +1506,6 @@ def generate(self): if self.options.get_safe("with_protobuf"): tc.variables["PROTOBUF_UPDATE_FILES"] = True tc.variables["WITH_ADE"] = self.options.gapi - if self.options.objdetect: - tc.variables["HAVE_QUIRC"] = self.options.with_quirc # force usage of quirc requirement # Extra modules if any([self.options.get_safe(module) for module in OPENCV_EXTRA_MODULES_OPTIONS]) or self.options.with_cuda: @@ -1519,8 +1539,8 @@ def generate(self): tc.variables["ENABLE_PIC"] = self.options.get_safe("fPIC", True) tc.variables["ENABLE_CCACHE"] = False - if is_msvc(self): - tc.variables["BUILD_WITH_STATIC_CRT"] = is_msvc_static_runtime(self) + if self._is_cl_like: + tc.variables["BUILD_WITH_STATIC_CRT"] = self._is_cl_like_static_runtime if self.settings.os == "Android": tc.variables["BUILD_ANDROID_EXAMPLES"] = False diff --git a/recipes/opencv/4.x/patches/4.10.0-0001-fix-zlib-static-android.patch b/recipes/opencv/4.x/patches/4.10.0-0001-fix-zlib-static-android.patch new file mode 100644 index 0000000000000..aae16f037e565 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.10.0-0001-fix-zlib-static-android.patch @@ -0,0 +1,17 @@ +--- a/cmake/OpenCVFindLibsGrfmt.cmake ++++ b/cmake/OpenCVFindLibsGrfmt.cmake +@@ -20,12 +20,12 @@ if(BUILD_ZLIB) + ocv_clear_vars(ZLIB_FOUND) + else() + ocv_clear_internal_cache_vars(ZLIB_LIBRARY ZLIB_INCLUDE_DIR) +- if(ANDROID) ++ if(0) + set(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + set(CMAKE_FIND_LIBRARY_SUFFIXES .so) + endif() + find_package(ZLIB "${MIN_VER_ZLIB}") +- if(ANDROID) ++ if(0) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) + unset(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES) + endif() diff --git a/recipes/opencv/config.yml b/recipes/opencv/config.yml index 443d5e91a8125..826190b23d258 100644 --- a/recipes/opencv/config.yml +++ b/recipes/opencv/config.yml @@ -1,4 +1,8 @@ versions: + "4.10.0": + folder: "4.x" + "4.9.0": + folder: "4.x" "4.8.1": folder: "4.x" "4.5.5": diff --git a/recipes/openexr/2.x/conanfile.py b/recipes/openexr/2.x/conanfile.py index 564b19b00cd64..8cf1e63318981 100644 --- a/recipes/openexr/2.x/conanfile.py +++ b/recipes/openexr/2.x/conanfile.py @@ -141,6 +141,9 @@ def package_info(self): # waiting an implementation of https://github.com/conan-io/conan/issues/9000 self.cpp_info.set_property("cmake_file_name", "OpenEXR") + # Avoid conflict in PkgConfigDeps with OpenEXR.pc file coming from openexr_ilmimf component + self.cpp_info.set_property("pkg_config_name", "openexr_conan_full_package") + lib_suffix = "" if not self.options.shared or self.settings.os == "Windows": openexr_version = Version(self.version) diff --git a/recipes/openexr/2.x/test_package/comp_short_decode_piz.exr b/recipes/openexr/2.x/test_package/comp_short_decode_piz.exr deleted file mode 100644 index 3a16d594b3028..0000000000000 Binary files a/recipes/openexr/2.x/test_package/comp_short_decode_piz.exr and /dev/null differ diff --git a/recipes/openexr/2.x/test_package/conanfile.py b/recipes/openexr/2.x/test_package/conanfile.py index f3a059b562841..3a8c6c5442b33 100644 --- a/recipes/openexr/2.x/test_package/conanfile.py +++ b/recipes/openexr/2.x/test_package/conanfile.py @@ -22,5 +22,4 @@ def build(self): def test(self): if not cross_building(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - imgfile = os.path.join(self.source_folder, "comp_short_decode_piz.exr") - self.run(f"{bin_path} {imgfile}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/openexr/2.x/test_package/test_package.cpp b/recipes/openexr/2.x/test_package/test_package.cpp index f5c9cab11b69e..d0aa6adf400d6 100644 --- a/recipes/openexr/2.x/test_package/test_package.cpp +++ b/recipes/openexr/2.x/test_package/test_package.cpp @@ -1,18 +1,11 @@ #include #include -#include -#include -#include +#include int main (int argc, char *argv[]) { - if (argc < 2) - return EXIT_FAILURE; - Imf::RgbaInputFile input_file(argv[1]); - const Imf::Header& header = input_file.header(); - size_t width = header.dataWindow().max.x - header.dataWindow().min.x + 1; - size_t height = header.dataWindow().max.y - header.dataWindow().min.y + 1; - std::cout << "OpenEXR images size is " << width << "x" << height << std::endl; + Imf::Header header; + std::cout << "Test: " << header.screenWindowWidth() << std::endl; return EXIT_SUCCESS; } diff --git a/recipes/openexr/3.x/conandata.yml b/recipes/openexr/3.x/conandata.yml index 82b1ad8ce0c76..1d8f995d131a6 100644 --- a/recipes/openexr/3.x/conandata.yml +++ b/recipes/openexr/3.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.4": + url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.2.4.tar.gz" + sha256: "81e6518f2c4656fdeaf18a018f135e96a96e7f66dbe1c1f05860dd94772176cc" "3.2.3": url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.2.3.tar.gz" sha256: "f3f6c4165694d5c09e478a791eae69847cadb1333a2948ca222aa09f145eba63" @@ -15,6 +18,11 @@ sources: url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.1.7.tar.gz" sha256: "78dbca39115a1c526e6728588753955ee75fa7f5bb1a6e238bed5b6d66f91fd7" patches: + "3.2.4": + - patch_file: "patches/3.2.1-gcc5-bug-workaround.patch" + patch_description: "Workaround for GCC 5 bug" + patch_type: "portability" + patch_source: "https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82336" "3.2.3": - patch_file: "patches/3.2.1-gcc5-bug-workaround.patch" patch_description: "Workaround for GCC 5 bug" diff --git a/recipes/openexr/3.x/test_package/comp_short_decode_piz.exr b/recipes/openexr/3.x/test_package/comp_short_decode_piz.exr deleted file mode 100644 index 3a16d594b3028..0000000000000 Binary files a/recipes/openexr/3.x/test_package/comp_short_decode_piz.exr and /dev/null differ diff --git a/recipes/openexr/3.x/test_package/conanfile.py b/recipes/openexr/3.x/test_package/conanfile.py index 96999743e2fb9..8a5bb47f50c4c 100644 --- a/recipes/openexr/3.x/test_package/conanfile.py +++ b/recipes/openexr/3.x/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - imgfile = os.path.join(self.source_folder, "comp_short_decode_piz.exr") - self.run(f"{bin_path} {imgfile}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/openexr/3.x/test_package/test_package.cpp b/recipes/openexr/3.x/test_package/test_package.cpp index f5c9cab11b69e..d0aa6adf400d6 100644 --- a/recipes/openexr/3.x/test_package/test_package.cpp +++ b/recipes/openexr/3.x/test_package/test_package.cpp @@ -1,18 +1,11 @@ #include #include -#include -#include -#include +#include int main (int argc, char *argv[]) { - if (argc < 2) - return EXIT_FAILURE; - Imf::RgbaInputFile input_file(argv[1]); - const Imf::Header& header = input_file.header(); - size_t width = header.dataWindow().max.x - header.dataWindow().min.x + 1; - size_t height = header.dataWindow().max.y - header.dataWindow().min.y + 1; - std::cout << "OpenEXR images size is " << width << "x" << height << std::endl; + Imf::Header header; + std::cout << "Test: " << header.screenWindowWidth() << std::endl; return EXIT_SUCCESS; } diff --git a/recipes/openexr/config.yml b/recipes/openexr/config.yml index 36bd699167db0..7a8a2874719ef 100644 --- a/recipes/openexr/config.yml +++ b/recipes/openexr/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.4": + folder: "3.x" "3.2.3": folder: "3.x" "3.2.2": diff --git a/recipes/openfbx/all/test_package/conanfile.py b/recipes/openfbx/all/test_package/conanfile.py index 7635e9e283758..0a6bc68712d90 100644 --- a/recipes/openfbx/all/test_package/conanfile.py +++ b/recipes/openfbx/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - fbx_path = os.path.join(self.source_folder, "d.fbx") - self.run(f"{bin_path} {fbx_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/openfbx/all/test_package/d.fbx b/recipes/openfbx/all/test_package/d.fbx deleted file mode 100644 index 147ec354d2be2..0000000000000 Binary files a/recipes/openfbx/all/test_package/d.fbx and /dev/null differ diff --git a/recipes/openfbx/all/test_package/test_package.cpp b/recipes/openfbx/all/test_package/test_package.cpp index be802370b1f87..a45770bbd5562 100644 --- a/recipes/openfbx/all/test_package/test_package.cpp +++ b/recipes/openfbx/all/test_package/test_package.cpp @@ -5,17 +5,11 @@ #include int main(int argc, char **argv) { - if (argc < 2) { - std::cerr << "Need at least one argument" << std::endl; - return -1; - } - std::ifstream in_file(argv[1], std::ios::binary); - in_file.seekg(0, std::ios::end); - int file_size = static_cast(in_file.tellg()); - std::vector content(file_size); + std::vector content(13); + ofbx::IScene *g_scene = ofbx::load(&content[0], 13, static_cast(ofbx::LoadFlags::TRIANGULATE)); - ofbx::IScene *g_scene = ofbx::load(&content[0], file_size, static_cast(ofbx::LoadFlags::TRIANGULATE)); + std::cout << "Test: " << g_scene << std::endl; return 0; } diff --git a/recipes/openfbx/all/test_v1_package/conanfile.py b/recipes/openfbx/all/test_v1_package/conanfile.py index fad029416492d..38f4483872d47 100644 --- a/recipes/openfbx/all/test_v1_package/conanfile.py +++ b/recipes/openfbx/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - fbx_path = os.path.join(self.source_folder, os.pardir, "test_package", "d.fbx") - self.run(f"{bin_path} {fbx_path}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/openfx/all/conanfile.py b/recipes/openfx/all/conanfile.py index 935c3113a9393..2fa66bbb90d2a 100644 --- a/recipes/openfx/all/conanfile.py +++ b/recipes/openfx/all/conanfile.py @@ -50,7 +50,7 @@ def layout(self): def requirements(self): self.requires("opengl/system") - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/openh264/all/conandata.yml b/recipes/openh264/all/conandata.yml index 679b1b0e3b70d..bae40a3d0b27c 100644 --- a/recipes/openh264/all/conandata.yml +++ b/recipes/openh264/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.1": + url: "https://github.com/cisco/openh264/archive/refs/tags/v2.4.1.tar.gz" + sha256: "8ffbe944e74043d0d3fb53d4a2a14c94de71f58dbea6a06d0dc92369542958ea" "2.3.1": url: "https://github.com/cisco/openh264/archive/refs/tags/v2.3.1.tar.gz" sha256: "453afa66dacb560bc5fd0468aabee90c483741571bca820a39a1c07f0362dc32" @@ -9,30 +12,34 @@ sources: url: "https://github.com/cisco/openh264/archive/v1.7.0.tar.gz" sha256: "9c07c38d7de00046c9c52b12c76a2af7648b70d05bd5460c8b67f6895738653f" patches: + "2.4.1": + - patch_file: "patches/2.4.1-0001-platform-android.mk.patch" + patch_description: "Android Fix" + patch_type: "portability" "2.3.1": - patch_file: "patches/2.3.1-0001-platform-android.mk.patch" - patch_type: "portability" patch_description: "Android Fix" - - patch_file: "patches/2.3.1-0002-macos-relocatable-shared.patch" patch_type: "portability" + - patch_file: "patches/2.3.1-0002-macos-relocatable-shared.patch" patch_description: "Macos relocatable shared fix" + patch_type: "portability" "2.1.1": - patch_file: "patches/2.1.1-0001-platform-android.mk.patch" - patch_type: "portability" patch_description: "Android Fix" - - patch_file: "patches/2.1.1-0002-macos-relocatable-shared.patch" patch_type: "portability" + - patch_file: "patches/2.1.1-0002-macos-relocatable-shared.patch" patch_description: "Macos relocatable shared fix" - - patch_file: "patches/1.7.0-0004-mingw-override-CC-CXX-AR-from-env.patch" patch_type: "portability" + - patch_file: "patches/1.7.0-0004-mingw-override-CC-CXX-AR-from-env.patch" patch_description: "Mingw Override CC CXX AR from env Fix" + patch_type: "portability" "1.7.0": - patch_file: "patches/1.7.0-0001-platform-android.mk.patch" - patch_type: "portability" patch_description: "Android Fix" - - patch_file: "patches/1.7.0-0002-macos-relocatable-shared.patch" patch_type: "portability" + - patch_file: "patches/1.7.0-0002-macos-relocatable-shared.patch" patch_description: "Macos relocatable shared fix" - - patch_file: "patches/1.7.0-0004-mingw-override-CC-CXX-AR-from-env.patch" patch_type: "portability" + - patch_file: "patches/1.7.0-0004-mingw-override-CC-CXX-AR-from-env.patch" patch_description: "Mingw Override CC CXX AR from env Fix" + patch_type: "portability" diff --git a/recipes/openh264/all/patches/2.4.1-0001-platform-android.mk.patch b/recipes/openh264/all/patches/2.4.1-0001-platform-android.mk.patch new file mode 100644 index 0000000000000..36191dbc4b074 --- /dev/null +++ b/recipes/openh264/all/patches/2.4.1-0001-platform-android.mk.patch @@ -0,0 +1,13 @@ +diff --git a/build/platform-darwin.mk b/build/platform-darwin.mk +index 4c7dac6..f15fdb9 100644 +--- a/build/platform-darwin.mk ++++ b/build/platform-darwin.mk +@@ -7,7 +7,7 @@ CURRENT_VERSION := 2.4.1 + COMPATIBILITY_VERSION := 2.4.0 + SHLDFLAGS = -dynamiclib -twolevel_namespace -undefined dynamic_lookup \ + -fno-common -headerpad_max_install_names -install_name \ +- $(SHAREDLIB_DIR)/$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXMAJORVER) ++ @rpath/$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXMAJORVER) + SHARED = -dynamiclib + SHARED += -current_version $(CURRENT_VERSION) -compatibility_version $(COMPATIBILITY_VERSION) + CFLAGS += -Wall -fPIC -MMD -MP diff --git a/recipes/openh264/config.yml b/recipes/openh264/config.yml index 783b155e8bb7a..6c0919f84307e 100644 --- a/recipes/openh264/config.yml +++ b/recipes/openh264/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.1": + folder: all "2.3.1": folder: all "2.1.1": diff --git a/recipes/openimageio/all/conandata.yml b/recipes/openimageio/all/conandata.yml index 67601ed04452c..fff916ce447bb 100644 --- a/recipes/openimageio/all/conandata.yml +++ b/recipes/openimageio/all/conandata.yml @@ -11,6 +11,18 @@ sources: "2.5.9.0": url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.9.0.tar.gz" sha256: "b6a68e369bc475525eb843bdc0cb8adc910cc71000825f8db9b5e136166cdc78" + "2.5.10.1": + url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.10.1.tar.gz" + sha256: "8f6a547f6a5d510737ba436f867043db537def65f0fdb14ec30e5a185b619f93" + "2.5.11.0": + url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.11.0.tar.gz" + sha256: "ebf1945e36679be55519d9f42a8f029c4a53d4efb4aaee3b10af6cdc93fb614b" + "2.5.12.0": + url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.12.0.tar.gz" + sha256: "51ea3c309bad7381fd0d7ef793e93a72d8e0edaeff4ff329f4f21fb5de3d90bd" + "2.5.13.0": + url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.13.0.tar.gz" + sha256: "663d712e4623e5e083b4ad5c5046c7b8ba65dc73a5380e7cfc12f9950c90d217" patches: "2.4.7.1": - patch_file: "patches/2.4.7.1-cmake-targets.patch" @@ -31,3 +43,20 @@ patches: - patch_file: "patches/2.5.9.0-cmake-targets.patch" patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" patch_type: "conan" + "2.5.10.1": + - patch_file: "patches/2.5.10.1-cmake-targets.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + "2.5.11.0": + - patch_file: "patches/2.5.10.1-cmake-targets.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + "2.5.12.0": + - patch_file: "patches/2.5.12.0-cmake-targets.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + "2.5.13.0": + - patch_file: "patches/2.5.12.0-cmake-targets.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + diff --git a/recipes/openimageio/all/conanfile.py b/recipes/openimageio/all/conanfile.py index 16fa1a05a98b9..6794e7f732e57 100644 --- a/recipes/openimageio/all/conanfile.py +++ b/recipes/openimageio/all/conanfile.py @@ -82,7 +82,7 @@ def requirements(self): self.requires("boost/1.84.0") self.requires("libtiff/4.6.0") self.requires("imath/3.1.9", transitive_headers=True) - self.requires("openexr/3.2.1") + self.requires("openexr/3.2.3") if self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_libjpeg == "libjpeg-turbo": diff --git a/recipes/openimageio/all/patches/2.5.10.1-cmake-targets.patch b/recipes/openimageio/all/patches/2.5.10.1-cmake-targets.patch new file mode 100644 index 0000000000000..9aa7dc768cd9b --- /dev/null +++ b/recipes/openimageio/all/patches/2.5.10.1-cmake-targets.patch @@ -0,0 +1,518 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 8125716a3..dd83c588f 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -154,7 +154,7 @@ endif () + add_definitions (-DOIIO_INTERNAL=1) + + list (APPEND CMAKE_MODULE_PATH +- "${PROJECT_SOURCE_DIR}/src/cmake/modules" ++ #"${PROJECT_SOURCE_DIR}/src/cmake/modules" + "${PROJECT_SOURCE_DIR}/src/cmake") + + include (GNUInstallDirs) +@@ -233,7 +233,7 @@ if (OIIO_BUILD_TOOLS AND NOT BUILD_OIIOUTIL_ONLY) + add_subdirectory (src/iinfo) + add_subdirectory (src/maketx) + add_subdirectory (src/oiiotool) +- add_subdirectory (src/testtex) ++ #add_subdirectory (src/testtex) + add_subdirectory (src/iv) + endif () + +diff --git src/cmake/externalpackages.cmake src/cmake/externalpackages.cmake +index 3f73cd266..d03c906d1 100644 +--- src/cmake/externalpackages.cmake ++++ src/cmake/externalpackages.cmake +@@ -45,14 +45,14 @@ if (NOT DEFINED Boost_USE_STATIC_LIBS) + set (Boost_USE_STATIC_LIBS "${LINKSTATIC}") + endif () + +-if (MSVC) +- # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: +- if (NOT Boost_USE_STATIC_LIBS) +- add_definitions (-DBOOST_ALL_DYN_LINK=1) +- endif () +-endif () +- +-set (Boost_COMPONENTS thread) ++#if (MSVC) ++# # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: ++# if (NOT Boost_USE_STATIC_LIBS) ++# add_definitions (-DBOOST_ALL_DYN_LINK=1) ++# endif () ++#endif () ++ ++set (Boost_COMPONENTS filesystem system thread container) + if (NOT USE_STD_FILESYSTEM) + list (APPEND Boost_COMPONENTS filesystem) + endif () +@@ -108,9 +108,9 @@ checked_find_package (OpenEXR REQUIRED + # building against Imath/OpenEXR 3.x when there is still a system-level + # install version of 2.x. + include_directories(BEFORE ${IMATH_INCLUDES} ${OPENEXR_INCLUDES}) +-if (MSVC AND NOT LINKSTATIC) +- add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? +-endif () ++#if (MSVC AND NOT LINKSTATIC) ++# add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? ++#endif () + if (OpenEXR_VERSION VERSION_GREATER_EQUAL 3.0) + set (OIIO_USING_IMATH 3) + else () +@@ -137,11 +137,15 @@ set (OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH OFF CACHE BOOL + "Exclude find_dependency(Imath) from the exported OpenImageIOConfig.cmake") + + # JPEG -- prefer JPEG-Turbo to regular libjpeg +-checked_find_package (libjpeg-turbo +- VERSION_MIN 2.1 +- DEFINITIONS -DUSE_JPEG_TURBO=1) +-if (NOT TARGET libjpeg-turbo::jpeg) # Try to find the non-turbo version ++if (USE_JPEGTURBO) ++ checked_find_package (libjpeg-turbo REQUIRED ++ DEFINITIONS -DUSE_JPEG_TURBO=1 ++ PRINT libjpeg-turbo_INCLUDES libjpeg-turbo_LIBRARIES) ++ add_library(JPEG::JPEG ALIAS libjpeg-turbo::libjpeg-turbo) ++elseif (USE_JPEG) # Try to find the non-turbo version + checked_find_package (JPEG REQUIRED) ++else () ++ message(FATAL_ERROR "JPEG library was not found!") + endif () + + # Pugixml setup. Normally we just use the version bundled with oiio, but +@@ -157,7 +161,7 @@ else () + endif() + + # From pythonutils.cmake +-find_python() ++#find_python() + if (USE_PYTHON) + checked_find_package (pybind11 REQUIRED VERSION_MIN 2.4.2) + endif () +@@ -167,110 +171,105 @@ endif () + # Dependencies for optional formats and features. If these are not found, + # we will continue building, but the related functionality will be disabled. + +-checked_find_package (PNG) ++if (USE_LIBPNG) ++ checked_find_package (PNG REQUIRED) ++endif() + +-checked_find_package (BZip2) # Used by ffmpeg and freetype +-if (NOT BZIP2_FOUND) +- set (BZIP2_LIBRARIES "") # TODO: why does it break without this? +-endif () ++if (USE_FREETYPE) ++ checked_find_package (Freetype REQUIRED ++ DEFINITIONS -DUSE_FREETYPE=1 ) ++endif() + +-checked_find_package (Freetype +- DEFINITIONS -DUSE_FREETYPE=1 ) +- +-checked_find_package (OpenColorIO +- DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 +- # PREFER_CONFIG +- ) +-if (OpenColorIO_FOUND) +- option (OIIO_DISABLE_BUILTIN_OCIO_CONFIGS +- "For deveoper debugging/testing ONLY! Disable OCIO 2.2 builtin configs." OFF) +- if (OIIO_DISABLE_BUILTIN_OCIO_CONFIGS OR "$ENV{OIIO_DISABLE_BUILTIN_OCIO_CONFIGS}") +- add_compile_definitions(OIIO_DISABLE_BUILTIN_OCIO_CONFIGS) +- endif () +-else () +- set (OpenColorIO_FOUND 0) ++if (USE_OPENCOLORIO) ++ checked_find_package (OpenColorIO REQUIRED ++ DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 ++ # PREFER_CONFIG ++ ) + endif () + +-checked_find_package (OpenCV 3.0 +- DEFINITIONS -DUSE_OPENCV=1) ++if (USE_OPENCV) ++ checked_find_package (OpenCV REQUIRED 3.0 ++ DEFINITIONS -DUSE_OPENCV=1) ++endif() + + # Intel TBB +-set (TBB_USE_DEBUG_BUILD OFF) +-checked_find_package (TBB 2017 +- SETVARIABLES OIIO_TBB +- PREFER_CONFIG) ++if (USE_TBB)# Intel TBB ++ set (TBB_USE_DEBUG_BUILD OFF) ++ checked_find_package (TBB 2017 REQUIRED ++ SETVARIABLES OIIO_TBB ++ PREFER_CONFIG) ++endif() + + # DCMTK is used to read DICOM images +-checked_find_package (DCMTK VERSION_MIN 3.6.1 +- PREFER_CONFIG) ++if (USE_DCMTK) ++ checked_find_package (DCMTK REQUIRED VERSION_MIN 3.6.1) # For DICOM images ++endif() + +-checked_find_package (FFmpeg VERSION_MIN 3.0) +-checked_find_package (GIF +- VERSION_MIN 4 +- RECOMMEND_MIN 5.0 +- RECOMMEND_MIN_REASON "for stability and thread safety") ++if (USE_FFMPEG) ++ checked_find_package (ffmpeg REQUIRED VERSION_MIN 3.0) ++endif() ++if (USE_GIF) ++ checked_find_package (GIF REQUIRED ++ VERSION_MIN 4 ++ RECOMMEND_MIN 5.0 ++ RECOMMEND_MIN_REASON "for stability and thread safety") ++endif() + + # For HEIF/HEIC/AVIF formats +-checked_find_package (Libheif VERSION_MIN 1.3 +- RECOMMEND_MIN 1.16 +- RECOMMEND_MIN_REASON "for orientation support") +-if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11) +- message (WARNING "Libheif 1.10 on Apple is known to be broken, disabling libheif support") +- set (Libheif_FOUND 0) +-endif () ++if (USE_LIBHEIF) ++ checked_find_package (libheif REQUIRED VERSION_MIN 1.3 ++ RECOMMEND_MIN 1.7 ++ RECOMMEND_MIN_REASON "for AVIF support") ++endif() + +-checked_find_package (LibRaw +- VERSION_MIN 0.18 +- PRINT LibRaw_r_LIBRARIES) +-if (LibRaw_FOUND AND LibRaw_VERSION VERSION_LESS 0.20 AND CMAKE_CXX_STANDARD VERSION_GREATER_EQUAL 17) +- message (STATUS "${ColorYellow}WARNING When building for C++17, LibRaw should be 0.20 or higher (found ${LibRaw_VERSION}). You may get errors, depending on the compiler.${ColorReset}") +- # Currently, we issue the above warning and let them take their chances. +- # If we wish to disable the LibRaw<0.20/C++17 combination that may fail, +- # just uncomment the following two lines. +- # set (LibRaw_FOUND 0) +- # set (LIBRAW_FOUND 0) +-endif () ++if (USE_LIBRAW) ++ checked_find_package (LibRaw REQUIRED ++ RECOMMEND_MIN 0.18 ++ RECOMMEND_MIN_REASON "for ACES support and better camera metadata" ++ PRINT LibRaw_r_LIBRARIES) ++endif() + +-checked_find_package (OpenJPEG VERSION_MIN 2.0 +- RECOMMEND_MIN 2.2 +- RECOMMEND_MIN_REASON "for multithreading support") +-# Note: Recent OpenJPEG versions have exported cmake configs, but we don't +-# find them reliable at all, so we stick to our FindOpenJPEG.cmake module. +- +-checked_find_package (OpenVDB +- VERSION_MIN 5.0 +- DEPS TBB +- DEFINITIONS -DUSE_OPENVDB=1) +-if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 10.1 AND CMAKE_CXX_STANDARD VERSION_LESS 17) +- message (WARNING "${ColorYellow}OpenVDB >= 10.1 (we found ${OpenVDB_VERSION}) can only be used when we build with C++17 or higher. Disabling OpenVDB support.${ColorReset}") +- set (OpeVDB_FOUND 0) +-endif () ++if (USE_OPENJPEG) ++ checked_find_package (OpenJPEG REQUIRED ++ VERSION_MIN 2.0 ++ RECOMMEND_MIN 2.2 ++ RECOMMEND_MIN_REASON "for multithreading support") ++ # Note: Recent OpenJPEG versions have exported cmake configs, but we don't ++ # find them reliable at all, so we stick to our FindOpenJPEG.cmake module. ++endif() + +-checked_find_package (Ptex PREFER_CONFIG) +-if (NOT Ptex_FOUND OR NOT Ptex_VERSION) +- # Fallback for inadequate Ptex exported configs. This will eventually +- # disappear when we can 100% trust Ptex's exports. +- unset (Ptex_FOUND) +- checked_find_package (Ptex) +-endif () ++if (USE_OPENVDB) ++ checked_find_package (OpenVDB REQUIRED ++ VERSION_MIN 5.0 ++ DEPS TBB ++ DEFINITIONS -DUSE_OPENVDB=1) ++endif() + +-checked_find_package (WebP) +-# Note: When WebP 1.1 (released late 2019) is our minimum, we can use their +-# exported configs and remove our FindWebP.cmake module. ++if (USE_PTEX) ++ checked_find_package (ptex REQUIRED PREFER_CONFIG) ++endif() ++ ++if (USE_LIBWEBP) ++ checked_find_package (WebP REQUIRED) ++endif() + + option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF) +-checked_find_package (R3DSDK NO_RECORD_NOTFOUND) # RED camera ++if (USE_R3DSDK) ++ checked_find_package (R3DSDK REQUIRED) # RED camera ++endif () + + set (NUKE_VERSION "7.0" CACHE STRING "Nuke version to target") +-checked_find_package (Nuke NO_RECORD_NOTFOUND) ++if (USE_NUKE) ++ checked_find_package (Nuke REQUIRED) ++endif () + + + # Qt -- used for iv + option (USE_QT "Use Qt if found" ON) +-if (USE_QT) +- checked_find_package (OpenGL) # used for iv ++if (USE_OPENGL) ++ checked_find_package (OpenGL REQUIRED) # used for iv + endif () +-if (USE_QT AND OPENGL_FOUND) ++if (USE_QT AND USE_OPENGL) + checked_find_package (Qt6 COMPONENTS Core Gui Widgets OpenGLWidgets) + if (NOT Qt6_FOUND) + checked_find_package (Qt5 COMPONENTS Core Gui Widgets OpenGL) +@@ -294,13 +293,13 @@ macro (find_or_download_robin_map) + # for an installed version. Still prefer a copy that seems to be + # locally installed in this tree. + if (NOT BUILD_ROBINMAP_FORCE) +- find_package (Robinmap QUIET) ++ find_package (tsl-robin-map REQUIRED) + endif () + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then + # download and build it. + # Download the headers from github +- if ((BUILD_MISSING_ROBINMAP AND NOT ROBINMAP_FOUND) OR BUILD_ROBINMAP_FORCE) ++ if ((BUILD_MISSING_ROBINMAP AND NOT tsl-robin-map_FOUND) OR BUILD_ROBINMAP_FORCE) + message (STATUS "Downloading local Tessil/robin-map") + set (ROBINMAP_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/robin-map") + set (ROBINMAP_GIT_REPOSITORY "https://github.com/Tessil/robin-map") +@@ -318,7 +317,7 @@ macro (find_or_download_robin_map) + endif () + set (ROBINMAP_INCLUDE_DIR "${ROBINMAP_INSTALL_DIR}/include") + endif () +- checked_find_package (Robinmap REQUIRED) ++ checked_find_package (tsl-robin-map REQUIRED) + endmacro() + + find_or_download_robin_map () +@@ -337,7 +336,7 @@ macro (find_or_download_fmt) + # for an installed version. Still prefer a copy that seems to be + # locally installed in this tree. + if (NOT BUILD_FMT_FORCE) +- find_package (fmt QUIET) ++ find_package (fmt REQUIRED) + endif () + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then +@@ -372,7 +371,7 @@ macro (find_or_download_fmt) + set (fmt_VERSION "${FMT_VERSION_MAJOR}.${FMT_VERSION_MINOR}.${FMT_VERSION_PATCH}") + list (APPEND CFP_ALL_BUILD_DEPS_FOUND "${pkgname} ${${pkgname}_VERSION}") + else () +- get_target_property(FMT_INCLUDE_DIR fmt::fmt-header-only INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(FMT_INCLUDE_DIR fmt::fmt INTERFACE_INCLUDE_DIRECTORIES) + set (OIIO_USING_FMT_LOCAL FALSE) + checked_find_package (fmt REQUIRED + VERSION_MIN 7.0) +diff --git src/ffmpeg.imageio/CMakeLists.txt src/ffmpeg.imageio/CMakeLists.txt +index 8e47a8443..900d23101 100644 +--- src/ffmpeg.imageio/CMakeLists.txt ++++ src/ffmpeg.imageio/CMakeLists.txt +@@ -2,7 +2,7 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (FFmpeg_FOUND) ++if (USE_FFMPEG) + if (LINKSTATIC) + set (_static_suffixes .lib .a) + set (_static_libraries_found 0) +@@ -26,11 +26,9 @@ if (FFmpeg_FOUND) + endif() + + add_oiio_plugin (ffmpeginput.cpp +- INCLUDE_DIRS ${FFMPEG_INCLUDES} +- LINK_LIBRARIES ${FFMPEG_LIBRARIES} +- ${BZIP2_LIBRARIES} ++ LINK_LIBRARIES ffmpeg::avcodec ffmpeg::avformat ffmpeg::swscale + DEFINITIONS "-DUSE_FFMPEG" +- "-DOIIO_FFMPEG_VERSION=\"${FFMPEG_VERSION}\"") ++ "-DOIIO_FFMPEG_VERSION=\"${ffmpeg_VERSION}\"") + else() + message (STATUS "FFmpeg not found: ffmpeg plugin will not be built") + endif() +diff --git src/heif.imageio/CMakeLists.txt src/heif.imageio/CMakeLists.txt +index 5b6c30a85..e5bc55ef1 100644 +--- src/heif.imageio/CMakeLists.txt ++++ src/heif.imageio/CMakeLists.txt +@@ -2,32 +2,31 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Libheif_FOUND) +- if (LINKSTATIC) +- set (_static_suffixes .lib .a) +- set (_static_libraries_found 0) ++if (USE_LIBHEIF) ++ # if (LINKSTATIC) ++ # set (_static_suffixes .lib .a) ++ # set (_static_libraries_found 0) + +- foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) +- get_filename_component (_ext ${_libeheif_library} LAST_EXT) +- list (FIND _static_suffixes ${_ext} _index) +- if (${_index} GREATER -1) +- MATH (EXPR _static_libraries_found "${static_libraries_found}+1") +- endif() +- endforeach() ++ # foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) ++ # get_filename_component (_ext ${_libeheif_library} LAST_EXT) ++ # list (FIND _static_suffixes ${_ext} _index) ++ # if (${_index} GREATER -1) ++ # MATH (EXPR _static_libraries_found "${static_libraries_found}+1") ++ # endif() ++ # endforeach() + +- if (${_static_libraries_found} GREATER 0) +- message (STATUS "${ColorYellow}") +- message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") +- message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") +- message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") +- message (STATUS "dynamically-linked libheif.") +- message ("${ColorReset}") +- endif() +- endif() ++ # if (${_static_libraries_found} GREATER 0) ++ # message (STATUS "${ColorYellow}") ++ # message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") ++ # message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") ++ # message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") ++ # message (STATUS "dynamically-linked libheif.") ++ # message ("${ColorReset}") ++ # endif() ++ # endif() + + add_oiio_plugin (heifinput.cpp heifoutput.cpp +- INCLUDE_DIRS ${LIBHEIF_INCLUDES} +- LINK_LIBRARIES ${LIBHEIF_LIBRARIES} ++ LINK_LIBRARIES libheif::heif + DEFINITIONS "-DUSE_HEIF=1") + else () + message (WARNING "heif plugin will not be built") +diff --git src/include/CMakeLists.txt src/include/CMakeLists.txt +index 7bec09739..3db17086f 100644 +--- src/include/CMakeLists.txt ++++ src/include/CMakeLists.txt +@@ -64,7 +64,8 @@ install (FILES ${detail_headers} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail + COMPONENT developer) + +-if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) ++if (0) # Don't try to copy fmt libraries to target install folder ++ set(FMT_INCLUDES "${fmt_INCLUDE_DIR}") + set (fmt_headers_base_names) + foreach (header_name core.h format-inl.h format.h ostream.h printf.h + std.h base.h chrono.h) +diff --git src/jpeg2000.imageio/CMakeLists.txt src/jpeg2000.imageio/CMakeLists.txt +index 560e8d486..24348fe66 100644 +--- src/jpeg2000.imageio/CMakeLists.txt ++++ src/jpeg2000.imageio/CMakeLists.txt +@@ -2,10 +2,9 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (OPENJPEG_FOUND) ++if (USE_OPENJPEG) + add_oiio_plugin (jpeg2000input.cpp jpeg2000output.cpp +- INCLUDE_DIRS ${OPENJPEG_INCLUDES} +- LINK_LIBRARIES ${OPENJPEG_LIBRARIES} ++ LINK_LIBRARIES openjp2 + DEFINITIONS "-DUSE_OPENJPEG") + else() + message (WARNING "Jpeg-2000 plugin will not be built") +diff --git src/libOpenImageIO/CMakeLists.txt src/libOpenImageIO/CMakeLists.txt +index aeb7b7f93..9a32e4cf2 100644 +--- src/libOpenImageIO/CMakeLists.txt ++++ src/libOpenImageIO/CMakeLists.txt +@@ -154,19 +154,27 @@ target_link_libraries (OpenImageIO + ${OPENIMAGEIO_IMATH_TARGETS} + PRIVATE + ${OPENIMAGEIO_OPENEXR_TARGETS} +- ${OpenCV_LIBRARIES} + ${format_plugin_libs} # Add all the target link libraries from the plugins + $ + $ + $ + $ +- $ + ${BZIP2_LIBRARIES} + ZLIB::ZLIB +- $ ++ tsl::robin_map ++ Boost::filesystem Boost::thread Boost::system Boost::container + ${CMAKE_DL_LIBS} + ) + ++if (USE_OPENCV) ++ target_link_libraries (OpenImageIO PRIVATE opencv::opencv_core ++ opencv::opencv_imgproc ++ opencv::opencv_videoio) ++endif () ++if (USE_FREETYPE) ++ target_link_libraries (OpenImageIO PRIVATE Freetype::Freetype) ++endif() ++ + if (WIN32) + target_link_libraries (OpenImageIO PRIVATE psapi) + endif() +diff --git src/libutil/CMakeLists.txt src/libutil/CMakeLists.txt +index f873b3eed..cf5d4e74c 100644 +--- src/libutil/CMakeLists.txt ++++ src/libutil/CMakeLists.txt +@@ -20,20 +20,13 @@ target_link_libraries (OpenImageIO_Util + ${GCC_ATOMIC_LIBRARIES} + ${OPENIMAGEIO_IMATH_DEPENDENCY_VISIBILITY} + ${OPENIMAGEIO_IMATH_TARGETS} ++ fmt::fmt + PRIVATE +- $ +- $ ++ Boost::filesystem Boost::thread Boost::system + $ + ${CMAKE_DL_LIBS} + ) + +-if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) +- add_dependencies(OpenImageIO_Util fmt_internal_target) +-else () +- target_link_libraries (OpenImageIO_Util +- PUBLIC fmt::fmt-header-only) +-endif () +- + if (WIN32) + add_definitions(-DWIN32_LEAN_AND_MEAN -DNOMINMAX -DNOGDI -DVC_EXTRALEAN) + target_link_libraries (OpenImageIO_Util PRIVATE psapi) +diff --git src/ptex.imageio/CMakeLists.txt src/ptex.imageio/CMakeLists.txt +index 16634fedb..82060ac29 100644 +--- src/ptex.imageio/CMakeLists.txt ++++ src/ptex.imageio/CMakeLists.txt +@@ -2,12 +2,9 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Ptex_FOUND) +- set(ptex_target Ptex::Ptex_dynamic) +- if (TARGET Ptex::Ptex_static AND (NOT TARGET Ptex::Ptex_dynamic OR LINKSTATIC)) +- set(ptex_target Ptex::Ptex_static) +- endif() ++if (USE_PTEX) + add_oiio_plugin (ptexinput.cpp +- LINK_LIBRARIES ${ptex_target} ZLIB::ZLIB ++ LINK_LIBRARIES ${ptex_LIBRARIES} ZLIB::ZLIB ++ INCLUDE_DIRS ${ptex_INCLUDE_DIRS} + DEFINITIONS "-DUSE_PTEX") + endif () diff --git a/recipes/openimageio/all/patches/2.5.12.0-cmake-targets.patch b/recipes/openimageio/all/patches/2.5.12.0-cmake-targets.patch new file mode 100644 index 0000000000000..2298a620c52ae --- /dev/null +++ b/recipes/openimageio/all/patches/2.5.12.0-cmake-targets.patch @@ -0,0 +1,521 @@ +diff --git CMakeLists.txt CMakeLists.txt +index d855110d6..aeebadae9 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -154,7 +154,7 @@ endif () + add_definitions (-DOIIO_INTERNAL=1) + + list (APPEND CMAKE_MODULE_PATH +- "${PROJECT_SOURCE_DIR}/src/cmake/modules" ++ #"${PROJECT_SOURCE_DIR}/src/cmake/modules" + "${PROJECT_SOURCE_DIR}/src/cmake") + + include (GNUInstallDirs) +@@ -233,7 +233,7 @@ if (OIIO_BUILD_TOOLS AND NOT BUILD_OIIOUTIL_ONLY) + add_subdirectory (src/iinfo) + add_subdirectory (src/maketx) + add_subdirectory (src/oiiotool) +- add_subdirectory (src/testtex) ++ #add_subdirectory (src/testtex) + add_subdirectory (src/iv) + endif () + +diff --git src/cmake/externalpackages.cmake src/cmake/externalpackages.cmake +index 3ffe300c7..3f307cec6 100644 +--- src/cmake/externalpackages.cmake ++++ src/cmake/externalpackages.cmake +@@ -45,14 +45,14 @@ if (NOT DEFINED Boost_USE_STATIC_LIBS) + set (Boost_USE_STATIC_LIBS "${LINKSTATIC}") + endif () + +-if (MSVC) +- # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: +- if (NOT Boost_USE_STATIC_LIBS) +- add_definitions (-DBOOST_ALL_DYN_LINK=1) +- endif () +-endif () +- +-set (Boost_COMPONENTS thread) ++#if (MSVC) ++# # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: ++# if (NOT Boost_USE_STATIC_LIBS) ++# add_definitions (-DBOOST_ALL_DYN_LINK=1) ++# endif () ++#endif () ++ ++set (Boost_COMPONENTS filesystem system thread container) + if (NOT USE_STD_FILESYSTEM) + list (APPEND Boost_COMPONENTS filesystem) + endif () +@@ -108,9 +108,9 @@ checked_find_package (OpenEXR REQUIRED + # building against Imath/OpenEXR 3.x when there is still a system-level + # install version of 2.x. + include_directories(BEFORE ${IMATH_INCLUDES} ${OPENEXR_INCLUDES}) +-if (MSVC AND NOT LINKSTATIC) +- add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? +-endif () ++#if (MSVC AND NOT LINKSTATIC) ++# add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? ++#endif () + if (OpenEXR_VERSION VERSION_GREATER_EQUAL 3.0) + set (OIIO_USING_IMATH 3) + else () +@@ -137,11 +137,15 @@ set (OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH OFF CACHE BOOL + "Exclude find_dependency(Imath) from the exported OpenImageIOConfig.cmake") + + # JPEG -- prefer JPEG-Turbo to regular libjpeg +-checked_find_package (libjpeg-turbo +- VERSION_MIN 2.1 +- DEFINITIONS -DUSE_JPEG_TURBO=1) +-if (NOT TARGET libjpeg-turbo::jpeg) # Try to find the non-turbo version ++if (USE_JPEGTURBO) ++ checked_find_package (libjpeg-turbo REQUIRED ++ DEFINITIONS -DUSE_JPEG_TURBO=1 ++ PRINT libjpeg-turbo_INCLUDES libjpeg-turbo_LIBRARIES) ++ add_library(JPEG::JPEG ALIAS libjpeg-turbo::libjpeg-turbo) ++elseif (USE_JPEG) # Try to find the non-turbo version + checked_find_package (JPEG REQUIRED) ++else () ++ message(FATAL_ERROR "JPEG library was not found!") + endif () + + # Pugixml setup. Normally we just use the version bundled with oiio, but +@@ -157,7 +161,7 @@ else () + endif() + + # From pythonutils.cmake +-find_python() ++#find_python() + if (USE_PYTHON) + checked_find_package (pybind11 REQUIRED VERSION_MIN 2.4.2) + endif () +@@ -167,111 +171,107 @@ endif () + # Dependencies for optional formats and features. If these are not found, + # we will continue building, but the related functionality will be disabled. + +-checked_find_package (PNG) ++if (USE_LIBPNG) ++ checked_find_package (PNG REQUIRED) ++endif() + +-checked_find_package (BZip2) # Used by ffmpeg and freetype +-if (NOT BZIP2_FOUND) +- set (BZIP2_LIBRARIES "") # TODO: why does it break without this? +-endif () ++if (USE_FREETYPE) ++ checked_find_package (Freetype REQUIRED ++ DEFINITIONS -DUSE_FREETYPE=1 ) ++endif() + +-checked_find_package (Freetype +- DEFINITIONS -DUSE_FREETYPE=1 ) +- +-checked_find_package (OpenColorIO +- DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 +- # PREFER_CONFIG +- ) +-if (OpenColorIO_FOUND) +- option (OIIO_DISABLE_BUILTIN_OCIO_CONFIGS +- "For deveoper debugging/testing ONLY! Disable OCIO 2.2 builtin configs." OFF) +- if (OIIO_DISABLE_BUILTIN_OCIO_CONFIGS OR "$ENV{OIIO_DISABLE_BUILTIN_OCIO_CONFIGS}") +- add_compile_definitions(OIIO_DISABLE_BUILTIN_OCIO_CONFIGS) +- endif () +-else () +- set (OpenColorIO_FOUND 0) ++if (USE_OPENCOLORIO) ++ checked_find_package (OpenColorIO REQUIRED ++ DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 ++ # PREFER_CONFIG ++ ) + endif () + +-checked_find_package (OpenCV 3.0 +- DEFINITIONS -DUSE_OPENCV=1) ++if (USE_OPENCV) ++ checked_find_package (OpenCV REQUIRED 3.0 ++ DEFINITIONS -DUSE_OPENCV=1) ++endif() + + # Intel TBB +-set (TBB_USE_DEBUG_BUILD OFF) +-checked_find_package (TBB 2017 +- SETVARIABLES OIIO_TBB +- PREFER_CONFIG) ++if (USE_TBB)# Intel TBB ++ set (TBB_USE_DEBUG_BUILD OFF) ++ checked_find_package (TBB 2017 REQUIRED ++ SETVARIABLES OIIO_TBB ++ PREFER_CONFIG) ++endif() + + # DCMTK is used to read DICOM images +-checked_find_package (DCMTK VERSION_MIN 3.6.1 +- PREFER_CONFIG) ++if (USE_DCMTK) ++ checked_find_package (DCMTK REQUIRED VERSION_MIN 3.6.1) # For DICOM images ++endif() + +-checked_find_package (FFmpeg VERSION_MIN 3.0) +-checked_find_package (GIF +- VERSION_MIN 4 +- RECOMMEND_MIN 5.0 +- RECOMMEND_MIN_REASON "for stability and thread safety") ++if (USE_FFMPEG) ++ checked_find_package (ffmpeg REQUIRED VERSION_MIN 3.0) ++endif() ++if (USE_GIF) ++ checked_find_package (GIF REQUIRED ++ VERSION_MIN 4 ++ RECOMMEND_MIN 5.0 ++ RECOMMEND_MIN_REASON "for stability and thread safety") ++endif() + + # For HEIF/HEIC/AVIF formats +-checked_find_package (Libheif VERSION_MIN 1.3 +- RECOMMEND_MIN 1.16 +- RECOMMEND_MIN_REASON "for orientation support") +-if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11) +- message (WARNING "Libheif 1.10 on Apple is known to be broken, disabling libheif support") +- set (Libheif_FOUND 0) +-endif () ++if (USE_LIBHEIF) ++ checked_find_package (libheif REQUIRED VERSION_MIN 1.3 ++ RECOMMEND_MIN 1.7 ++ RECOMMEND_MIN_REASON "for AVIF support") ++endif() + +-checked_find_package (LibRaw +- VERSION_MIN 0.18 +- PRINT LibRaw_r_LIBRARIES) +-if (LibRaw_FOUND AND LibRaw_VERSION VERSION_LESS 0.20 AND CMAKE_CXX_STANDARD VERSION_GREATER_EQUAL 17) +- message (STATUS "${ColorYellow}WARNING When building for C++17, LibRaw should be 0.20 or higher (found ${LibRaw_VERSION}). You may get errors, depending on the compiler.${ColorReset}") +- # Currently, we issue the above warning and let them take their chances. +- # If we wish to disable the LibRaw<0.20/C++17 combination that may fail, +- # just uncomment the following two lines. +- # set (LibRaw_FOUND 0) +- # set (LIBRAW_FOUND 0) +-endif () ++if (USE_LIBRAW) ++ checked_find_package (LibRaw REQUIRED ++ RECOMMEND_MIN 0.18 ++ RECOMMEND_MIN_REASON "for ACES support and better camera metadata" ++ PRINT LibRaw_r_LIBRARIES) ++endif() + +-checked_find_package (OpenJPEG VERSION_MIN 2.0 +- RECOMMEND_MIN 2.2 +- RECOMMEND_MIN_REASON "for multithreading support") +-# Note: Recent OpenJPEG versions have exported cmake configs, but we don't +-# find them reliable at all, so we stick to our FindOpenJPEG.cmake module. +- +-checked_find_package (OpenVDB +- VERSION_MIN 5.0 +- DEPS TBB +- DEFINITIONS -DUSE_OPENVDB=1) +-if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 10.1 AND CMAKE_CXX_STANDARD VERSION_LESS 17) +- message (WARNING "${ColorYellow}OpenVDB >= 10.1 (we found ${OpenVDB_VERSION}) can only be used when we build with C++17 or higher. Disabling OpenVDB support.${ColorReset}") +- set (OpenVDB_FOUND 0) +- add_compile_definitions(DISABLE_OPENVDB=1) +-endif () ++if (USE_OPENJPEG) ++ checked_find_package (OpenJPEG REQUIRED ++ VERSION_MIN 2.0 ++ RECOMMEND_MIN 2.2 ++ RECOMMEND_MIN_REASON "for multithreading support") ++ # Note: Recent OpenJPEG versions have exported cmake configs, but we don't ++ # find them reliable at all, so we stick to our FindOpenJPEG.cmake module. ++endif() + +-checked_find_package (Ptex PREFER_CONFIG) +-if (NOT Ptex_FOUND OR NOT Ptex_VERSION) +- # Fallback for inadequate Ptex exported configs. This will eventually +- # disappear when we can 100% trust Ptex's exports. +- unset (Ptex_FOUND) +- checked_find_package (Ptex) +-endif () ++if (USE_OPENVDB) ++ checked_find_package (OpenVDB REQUIRED ++ VERSION_MIN 5.0 ++ DEPS TBB ++ DEFINITIONS -DUSE_OPENVDB=1) ++ # Upstream contains a version check to ensure that CXX 17 or newer is used with ++ # OpenVDB >= 10.1. This is ensured by the conanfile for openvdb ++endif() + +-checked_find_package (WebP) +-# Note: When WebP 1.1 (released late 2019) is our minimum, we can use their +-# exported configs and remove our FindWebP.cmake module. ++if (USE_PTEX) ++ checked_find_package (ptex REQUIRED PREFER_CONFIG) ++endif() ++ ++if (USE_LIBWEBP) ++ checked_find_package (WebP REQUIRED) ++endif() + + option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF) +-checked_find_package (R3DSDK NO_RECORD_NOTFOUND) # RED camera ++if (USE_R3DSDK) ++ checked_find_package (R3DSDK REQUIRED) # RED camera ++endif () + + set (NUKE_VERSION "7.0" CACHE STRING "Nuke version to target") +-checked_find_package (Nuke NO_RECORD_NOTFOUND) ++if (USE_NUKE) ++ checked_find_package (Nuke REQUIRED) ++endif () + + + # Qt -- used for iv + option (USE_QT "Use Qt if found" ON) +-if (USE_QT) +- checked_find_package (OpenGL) # used for iv ++if (USE_OPENGL) ++ checked_find_package (OpenGL REQUIRED) # used for iv + endif () +-if (USE_QT AND OPENGL_FOUND) ++if (USE_QT AND USE_OPENGL) + checked_find_package (Qt6 COMPONENTS Core Gui Widgets OpenGLWidgets) + if (NOT Qt6_FOUND) + checked_find_package (Qt5 COMPONENTS Core Gui Widgets OpenGL) +@@ -295,13 +295,13 @@ macro (find_or_download_robin_map) + # for an installed version. Still prefer a copy that seems to be + # locally installed in this tree. + if (NOT BUILD_ROBINMAP_FORCE) +- find_package (Robinmap QUIET) ++ find_package (tsl-robin-map REQUIRED) + endif () + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then + # download and build it. + # Download the headers from github +- if ((BUILD_MISSING_ROBINMAP AND NOT ROBINMAP_FOUND) OR BUILD_ROBINMAP_FORCE) ++ if ((BUILD_MISSING_ROBINMAP AND NOT tsl-robin-map_FOUND) OR BUILD_ROBINMAP_FORCE) + message (STATUS "Downloading local Tessil/robin-map") + set (ROBINMAP_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/robin-map") + set (ROBINMAP_GIT_REPOSITORY "https://github.com/Tessil/robin-map") +@@ -319,7 +319,7 @@ macro (find_or_download_robin_map) + endif () + set (ROBINMAP_INCLUDE_DIR "${ROBINMAP_INSTALL_DIR}/include") + endif () +- checked_find_package (Robinmap REQUIRED) ++ checked_find_package (tsl-robin-map REQUIRED) + endmacro() + + find_or_download_robin_map () +@@ -338,7 +338,7 @@ macro (find_or_download_fmt) + # for an installed version. Still prefer a copy that seems to be + # locally installed in this tree. + if (NOT BUILD_FMT_FORCE) +- find_package (fmt QUIET) ++ find_package (fmt REQUIRED) + endif () + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then +@@ -373,7 +373,7 @@ macro (find_or_download_fmt) + set (fmt_VERSION "${FMT_VERSION_MAJOR}.${FMT_VERSION_MINOR}.${FMT_VERSION_PATCH}") + list (APPEND CFP_ALL_BUILD_DEPS_FOUND "${pkgname} ${${pkgname}_VERSION}") + else () +- get_target_property(FMT_INCLUDE_DIR fmt::fmt-header-only INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(FMT_INCLUDE_DIR fmt::fmt INTERFACE_INCLUDE_DIRECTORIES) + set (OIIO_USING_FMT_LOCAL FALSE) + checked_find_package (fmt REQUIRED + VERSION_MIN 7.0) +diff --git src/ffmpeg.imageio/CMakeLists.txt src/ffmpeg.imageio/CMakeLists.txt +index 8e47a8443..900d23101 100644 +--- src/ffmpeg.imageio/CMakeLists.txt ++++ src/ffmpeg.imageio/CMakeLists.txt +@@ -2,7 +2,7 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (FFmpeg_FOUND) ++if (USE_FFMPEG) + if (LINKSTATIC) + set (_static_suffixes .lib .a) + set (_static_libraries_found 0) +@@ -26,11 +26,9 @@ if (FFmpeg_FOUND) + endif() + + add_oiio_plugin (ffmpeginput.cpp +- INCLUDE_DIRS ${FFMPEG_INCLUDES} +- LINK_LIBRARIES ${FFMPEG_LIBRARIES} +- ${BZIP2_LIBRARIES} ++ LINK_LIBRARIES ffmpeg::avcodec ffmpeg::avformat ffmpeg::swscale + DEFINITIONS "-DUSE_FFMPEG" +- "-DOIIO_FFMPEG_VERSION=\"${FFMPEG_VERSION}\"") ++ "-DOIIO_FFMPEG_VERSION=\"${ffmpeg_VERSION}\"") + else() + message (STATUS "FFmpeg not found: ffmpeg plugin will not be built") + endif() +diff --git src/heif.imageio/CMakeLists.txt src/heif.imageio/CMakeLists.txt +index 5b6c30a85..e5bc55ef1 100644 +--- src/heif.imageio/CMakeLists.txt ++++ src/heif.imageio/CMakeLists.txt +@@ -2,32 +2,31 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Libheif_FOUND) +- if (LINKSTATIC) +- set (_static_suffixes .lib .a) +- set (_static_libraries_found 0) ++if (USE_LIBHEIF) ++ # if (LINKSTATIC) ++ # set (_static_suffixes .lib .a) ++ # set (_static_libraries_found 0) + +- foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) +- get_filename_component (_ext ${_libeheif_library} LAST_EXT) +- list (FIND _static_suffixes ${_ext} _index) +- if (${_index} GREATER -1) +- MATH (EXPR _static_libraries_found "${static_libraries_found}+1") +- endif() +- endforeach() ++ # foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) ++ # get_filename_component (_ext ${_libeheif_library} LAST_EXT) ++ # list (FIND _static_suffixes ${_ext} _index) ++ # if (${_index} GREATER -1) ++ # MATH (EXPR _static_libraries_found "${static_libraries_found}+1") ++ # endif() ++ # endforeach() + +- if (${_static_libraries_found} GREATER 0) +- message (STATUS "${ColorYellow}") +- message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") +- message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") +- message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") +- message (STATUS "dynamically-linked libheif.") +- message ("${ColorReset}") +- endif() +- endif() ++ # if (${_static_libraries_found} GREATER 0) ++ # message (STATUS "${ColorYellow}") ++ # message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") ++ # message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") ++ # message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") ++ # message (STATUS "dynamically-linked libheif.") ++ # message ("${ColorReset}") ++ # endif() ++ # endif() + + add_oiio_plugin (heifinput.cpp heifoutput.cpp +- INCLUDE_DIRS ${LIBHEIF_INCLUDES} +- LINK_LIBRARIES ${LIBHEIF_LIBRARIES} ++ LINK_LIBRARIES libheif::heif + DEFINITIONS "-DUSE_HEIF=1") + else () + message (WARNING "heif plugin will not be built") +diff --git src/include/CMakeLists.txt src/include/CMakeLists.txt +index 7bec09739..3db17086f 100644 +--- src/include/CMakeLists.txt ++++ src/include/CMakeLists.txt +@@ -64,7 +64,8 @@ install (FILES ${detail_headers} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail + COMPONENT developer) + +-if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) ++if (0) # Don't try to copy fmt libraries to target install folder ++ set(FMT_INCLUDES "${fmt_INCLUDE_DIR}") + set (fmt_headers_base_names) + foreach (header_name core.h format-inl.h format.h ostream.h printf.h + std.h base.h chrono.h) +diff --git src/jpeg2000.imageio/CMakeLists.txt src/jpeg2000.imageio/CMakeLists.txt +index 560e8d486..24348fe66 100644 +--- src/jpeg2000.imageio/CMakeLists.txt ++++ src/jpeg2000.imageio/CMakeLists.txt +@@ -2,10 +2,9 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (OPENJPEG_FOUND) ++if (USE_OPENJPEG) + add_oiio_plugin (jpeg2000input.cpp jpeg2000output.cpp +- INCLUDE_DIRS ${OPENJPEG_INCLUDES} +- LINK_LIBRARIES ${OPENJPEG_LIBRARIES} ++ LINK_LIBRARIES openjp2 + DEFINITIONS "-DUSE_OPENJPEG") + else() + message (WARNING "Jpeg-2000 plugin will not be built") +diff --git src/libOpenImageIO/CMakeLists.txt src/libOpenImageIO/CMakeLists.txt +index aeb7b7f93..9a32e4cf2 100644 +--- src/libOpenImageIO/CMakeLists.txt ++++ src/libOpenImageIO/CMakeLists.txt +@@ -154,19 +154,27 @@ target_link_libraries (OpenImageIO + ${OPENIMAGEIO_IMATH_TARGETS} + PRIVATE + ${OPENIMAGEIO_OPENEXR_TARGETS} +- ${OpenCV_LIBRARIES} + ${format_plugin_libs} # Add all the target link libraries from the plugins + $ + $ + $ + $ +- $ + ${BZIP2_LIBRARIES} + ZLIB::ZLIB +- $ ++ tsl::robin_map ++ Boost::filesystem Boost::thread Boost::system Boost::container + ${CMAKE_DL_LIBS} + ) + ++if (USE_OPENCV) ++ target_link_libraries (OpenImageIO PRIVATE opencv::opencv_core ++ opencv::opencv_imgproc ++ opencv::opencv_videoio) ++endif () ++if (USE_FREETYPE) ++ target_link_libraries (OpenImageIO PRIVATE Freetype::Freetype) ++endif() ++ + if (WIN32) + target_link_libraries (OpenImageIO PRIVATE psapi) + endif() +diff --git src/libutil/CMakeLists.txt src/libutil/CMakeLists.txt +index f873b3eed..cf5d4e74c 100644 +--- src/libutil/CMakeLists.txt ++++ src/libutil/CMakeLists.txt +@@ -20,20 +20,13 @@ target_link_libraries (OpenImageIO_Util + ${GCC_ATOMIC_LIBRARIES} + ${OPENIMAGEIO_IMATH_DEPENDENCY_VISIBILITY} + ${OPENIMAGEIO_IMATH_TARGETS} ++ fmt::fmt + PRIVATE +- $ +- $ ++ Boost::filesystem Boost::thread Boost::system + $ + ${CMAKE_DL_LIBS} + ) + +-if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) +- add_dependencies(OpenImageIO_Util fmt_internal_target) +-else () +- target_link_libraries (OpenImageIO_Util +- PUBLIC fmt::fmt-header-only) +-endif () +- + if (WIN32) + add_definitions(-DWIN32_LEAN_AND_MEAN -DNOMINMAX -DNOGDI -DVC_EXTRALEAN) + target_link_libraries (OpenImageIO_Util PRIVATE psapi) +diff --git src/ptex.imageio/CMakeLists.txt src/ptex.imageio/CMakeLists.txt +index 16634fedb..82060ac29 100644 +--- src/ptex.imageio/CMakeLists.txt ++++ src/ptex.imageio/CMakeLists.txt +@@ -2,12 +2,9 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Ptex_FOUND) +- set(ptex_target Ptex::Ptex_dynamic) +- if (TARGET Ptex::Ptex_static AND (NOT TARGET Ptex::Ptex_dynamic OR LINKSTATIC)) +- set(ptex_target Ptex::Ptex_static) +- endif() ++if (USE_PTEX) + add_oiio_plugin (ptexinput.cpp +- LINK_LIBRARIES ${ptex_target} ZLIB::ZLIB ++ LINK_LIBRARIES ${ptex_LIBRARIES} ZLIB::ZLIB ++ INCLUDE_DIRS ${ptex_INCLUDE_DIRS} + DEFINITIONS "-DUSE_PTEX") + endif () diff --git a/recipes/openimageio/config.yml b/recipes/openimageio/config.yml index 95116bd79b886..c3baaee7f7c7d 100644 --- a/recipes/openimageio/config.yml +++ b/recipes/openimageio/config.yml @@ -7,3 +7,11 @@ versions: folder: all "2.5.9.0": folder: all + "2.5.10.1": + folder: all + "2.5.11.0": + folder: all + "2.5.12.0": + folder: all + "2.5.13.0": + folder: all diff --git a/recipes/openjdk/all/conandata.yml b/recipes/openjdk/all/conandata.yml index bb0f8bea50c9b..41ac854b16462 100644 --- a/recipes/openjdk/all/conandata.yml +++ b/recipes/openjdk/all/conandata.yml @@ -1,4 +1,20 @@ sources: + "21.0.2": + Windows: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/13/GPL/openjdk-21.0.2_windows-x64_bin.zip" + sha256: "b6c17e747ae78cdd6de4d7532b3164b277daee97c007d3eaa2b39cca99882664" + Linux_x86_64: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/12/GPL/openjdk-21.0.2_linux-x64_bin.tar.gz" + sha256: "960a708e76bffa0864e3e756e03314d56aa9dfb253b0803ae8a35eef2188f475" + Linux_armv8: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/12/GPL/openjdk-21.0.2_linux-aarch64_bin.tar.gz" + sha256: "0fcd2bdd32de146288635e05a362a24217baf669a3fa8e145ed09c6ad96a8c38" + Macos_x86_64: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/12/GPL/openjdk-21.0.2_macos-x64_bin.tar.gz" + sha256: "2830aa583a7f1e6ea2673ead18c12a2b1f85e9d5b8d69b116666014b14b81656" + Macos_armv8: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/12/GPL/openjdk-21.0.2_macos-aarch64_bin.tar.gz" + sha256: "997e0797f304a423149fd72284e9bcf7782c4a969fcb49ef05dfa7e5e6b6fbd6" "21.0.1": Windows: url: "https://download.java.net/java/GA/jdk21.0.1/415e3f918a1f4062a0074a2794853d0d/12/GPL/openjdk-21.0.1_windows-x64_bin.zip" diff --git a/recipes/openjdk/all/conanfile.py b/recipes/openjdk/all/conanfile.py index becd2ce7c641c..33d8977b70cc4 100644 --- a/recipes/openjdk/all/conanfile.py +++ b/recipes/openjdk/all/conanfile.py @@ -16,12 +16,14 @@ class OpenJDK(ConanFile): license = "GPL-2.0-only WITH Classpath-exception-2.0", "GPL-2.0-only WITH OpenJDK-assembly-exception-1.0" topics = ("java", "jdk", "openjdk") settings = "os", "arch", "compiler", "build_type" - no_copy_source = True def package_id(self): del self.info.settings.compiler del self.info.settings.build_type + def configure(self): + self.settings.rm_safe("os.version") + def validate(self): if Version(self.version) < "19.0.2" and self.settings.arch != "x86_64": raise ConanInvalidConfiguration("Unsupported Architecture. This package currently only supports x86_64.") @@ -33,42 +35,42 @@ def build(self): if self.settings.os in ["Macos", "Linux"]: key = f"{self.settings.os}_{self.settings.arch}" get(self, **self.conan_data["sources"][self.version][str(key)], - destination=self.source_folder, strip_root=True) + destination=self.build_folder, strip_root=True) def package(self): if self.settings.os == "Macos": - source_folder = os.path.join(self.source_folder, f"jdk-{self.version}.jdk", "Contents", "Home") + build_folder = os.path.join(self.build_folder, f"jdk-{self.version}.jdk", "Contents", "Home") else: - source_folder = self.source_folder - symlinks.remove_broken_symlinks(self, source_folder) + build_folder = self.build_folder + symlinks.remove_broken_symlinks(self, build_folder) copy(self, pattern="*", - src=os.path.join(source_folder, "bin"), + src=os.path.join(build_folder, "bin"), dst=os.path.join(self.package_folder, "bin"), excludes=("msvcp140.dll", "vcruntime140.dll", "vcruntime140_1.dll")) copy(self, pattern="*", - src=os.path.join(source_folder, "include"), + src=os.path.join(build_folder, "include"), dst=os.path.join(self.package_folder, "include")) copy(self, pattern="*", - src=os.path.join(source_folder, "lib"), + src=os.path.join(build_folder, "lib"), dst=os.path.join(self.package_folder, "lib")) copy(self, pattern="*", - src=os.path.join(source_folder, "jmods"), + src=os.path.join(build_folder, "jmods"), dst=os.path.join(self.package_folder, "lib", "jmods")) copy(self, pattern="*", - src=os.path.join(source_folder, "legal"), + src=os.path.join(build_folder, "legal"), dst=os.path.join(self.package_folder, "licenses")) # conf folder is required for security settings, to avoid # java.lang.SecurityException: Can't read cryptographic policy directory: unlimited # https://github.com/conan-io/conan-center-index/pull/4491#issuecomment-774555069 copy(self, pattern="*", - src=os.path.join(source_folder, "conf"), + src=os.path.join(build_folder, "conf"), dst=os.path.join(self.package_folder, "conf")) def package_info(self): self.output.info(f"Creating JAVA_HOME environment variable with : {self.package_folder}") - self.runenv_info.append("JAVA_HOME", self.package_folder) - self.buildenv_info.append("JAVA_HOME", self.package_folder) + self.runenv_info.define_path("JAVA_HOME", self.package_folder) + self.buildenv_info.define_path("JAVA_HOME", self.package_folder) # TODO: remove `env_info` once the recipe is only compatible with Conan >= 2.0 self.env_info.JAVA_HOME = self.package_folder diff --git a/recipes/openjdk/config.yml b/recipes/openjdk/config.yml index 1e9a2a92440d2..c2d6c3ae88d91 100644 --- a/recipes/openjdk/config.yml +++ b/recipes/openjdk/config.yml @@ -1,4 +1,6 @@ versions: + "21.0.2": + folder: all "21.0.1": folder: all "19.0.2": diff --git a/recipes/openldap/all/conandata.yml b/recipes/openldap/all/conandata.yml index 9fc035f4ad145..0b8d44649e6e8 100644 --- a/recipes/openldap/all/conandata.yml +++ b/recipes/openldap/all/conandata.yml @@ -1,8 +1,7 @@ sources: + "2.6.7": + url: "https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.6.7.tgz" + sha256: "cd775f625c944ed78a3da18a03b03b08eea73c8aabc97b41bb336e9a10954930" "2.6.1": - url: https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.6.1.tgz - sha256: 9d576ea6962d7db8a2e2808574e8c257c15aef55f403a1fb5a0faf35de70e6f3 -patches: - "2.6.1": - - base_path: source_subfolder - patch_file: patches/configure-2.6.1.patch + url: "https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.6.1.tgz" + sha256: "9d576ea6962d7db8a2e2808574e8c257c15aef55f403a1fb5a0faf35de70e6f3" diff --git a/recipes/openldap/all/conanfile.py b/recipes/openldap/all/conanfile.py index 49a19895302e6..4992bb0b0e23f 100644 --- a/recipes/openldap/all/conanfile.py +++ b/recipes/openldap/all/conanfile.py @@ -1,110 +1,126 @@ import os -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.43.0" +import shutil + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualRunEnv +from conan.tools.files import chdir, copy, get, rm, rmdir, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" class OpenldapConan(ConanFile): name = "openldap" - description = "OpenLDAP C++ library" + description = "OpenLDAP C library" + license = "OLDAP-2.8" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.openldap.org/" - license = "OLDAP-2.8" topics = ("ldap", "load-balancer", "directory-access") - exports_sources = ["patches/*"] - settings = settings = "os", "compiler", "build_type", "arch" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "with_cyrus_sasl": [True, False] + "with_cyrus_sasl": [True, False], } default_options = { "shared": False, "fPIC": True, - "with_cyrus_sasl": True - + "with_cyrus_sasl": True, } - _autotools = None - _configure_vars = None - - @property - def _source_subfolder(self): - return "source_subfolder" def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") - def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("openssl/1.1.1q") + self.requires("openssl/[>=1.1 <4]") if self.options.with_cyrus_sasl: - self.requires("cyrus-sasl/2.1.27") + self.requires("cyrus-sasl/2.1.28") def validate(self): - if self.settings.os != "Linux": - raise ConanInvalidConfiguration( - f"{self.name} is only supported on Linux") - - def _configure_autotools(self): - if self._autotools: - return self._autotools - - def yes_no(v): return "yes" if v else "no" - self._autotools = AutoToolsBuildEnvironment(self) - configure_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), + if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: + raise ConanInvalidConfiguration(f"{self.name} is only supported on Unix platforms") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + def yes_no(v): + return "yes" if v else "no" + + tc = AutotoolsToolchain(self) + tc.configure_args += [ "--with-cyrus_sasl={}".format(yes_no(self.options.with_cyrus_sasl)), - "--with-pic={}".format(yes_no(self.options.get_safe("fPIC", True))), "--without-fetch", "--with-tls=openssl", - "--enable-auditlog"] - self._configure_vars = self._autotools.vars - self._configure_vars["systemdsystemunitdir"] = os.path.join( - self.package_folder, "res") - - # Need to link to -pthread instead of -lpthread for gcc 8 shared=True - # on CI job. Otherwise, linking fails. - self._autotools.libs.remove("pthread") - self._configure_vars["LIBS"] = self._configure_vars["LIBS"].replace( - "-lpthread", "-pthread") - - self._autotools.configure( - args=configure_args, - configure_dir=self._source_subfolder, - vars=self._configure_vars) - return self._autotools + "--enable-auditlog", + "--libexecdir=${prefix}/bin", + f"systemdsystemunitdir={os.path.join(self.package_folder, 'res')}", + ] + if cross_building(self): + # When cross-building, yielding_select should be explicit: + # https://git.openldap.org/openldap/openldap/-/blob/OPENLDAP_REL_ENG_2_5/configure.ac#L1636 + tc.configure_args.append("--with-yielding_select=yes") + # Workaround: https://bugs.openldap.org/show_bug.cgi?id=9228 + tc.configure_args.append("ac_cv_func_memcmp_working=yes") + if is_apple_os(self): + # macOS Ventura does not have soelim, but mandoc_soelim + tc.make_args.append("SOELIM=soelim" if shutil.which("soelim") else "SOELIM=mandoc_soelim") + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "configure"), + "WITH_SYSTEMD=no\nsystemdsystemunitdir=", "WITH_SYSTEMD=no") def build(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - autotools = self._configure_autotools() - - autotools.make(vars=self._configure_vars) + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - autotools = self._configure_autotools() - autotools.install(vars=self._configure_vars) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("COPYRIGHT", dst="licenses", src=self._source_subfolder) - for folder in ["var", "share", "etc", "lib/pkgconfig", "res"]: - tools.rmdir(os.path.join(self.package_folder, folder)) - tools.remove_files_by_mask( - os.path.join( - self.package_folder, - "lib"), - "*.la") + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "COPYRIGHT", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + rm(self, "*.la", self.package_folder, recursive=True) + fix_apple_shared_install_name(self) + for folder in ["var", "share", "etc", os.path.join("lib", "pkgconfig"), "home", "Users"]: + rmdir(self, os.path.join(self.package_folder, folder)) def package_info(self): - bin_path = os.path.join(self.package_folder, "bin") - self.env_info.PATH.append(bin_path) - self.output.info( - "Appending PATH environment variable: {}".format(bin_path)) + self.cpp_info.components["ldap"].set_property("pkg_config_name", "ldap") + self.cpp_info.components["ldap"].libs = ["ldap"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ldap"].system_libs = ["pthread", "resolv"] + self.cpp_info.components["ldap"].requires = ["lber", "openssl::ssl", "openssl::crypto"] + if self.options.with_cyrus_sasl: + self.cpp_info.components["ldap"].requires.append("cyrus-sasl::cyrus-sasl") - self.cpp_info.libs = ["ldap", "lber"] + self.cpp_info.components["lber"].set_property("pkg_config_name", "lber") + self.cpp_info.components["lber"].libs = ["lber"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["pthread"] + self.cpp_info.components["lber"].system_libs = ["pthread"] + + # TODO: to remove in conan v2 + bin_path = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_path) diff --git a/recipes/openldap/all/patches/configure-2.6.1.patch b/recipes/openldap/all/patches/configure-2.6.1.patch deleted file mode 100644 index 9fb405dfefc10..0000000000000 --- a/recipes/openldap/all/patches/configure-2.6.1.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/configure b/configure -index 8521174..8ea6133 100755 ---- a/configure -+++ b/configure -@@ -22337,7 +22337,6 @@ $as_echo "$as_me: WARNING: Strong authentication not supported!" >&2;} - fi - - WITH_SYSTEMD=no --systemdsystemunitdir= - ol_link_systemd=no - if test $ol_enable_slapd == no && test $ol_enable_balancer != yes ; then - if test $ol_with_systemd != no ; then diff --git a/recipes/openldap/all/test_package/CMakeLists.txt b/recipes/openldap/all/test_package/CMakeLists.txt index fb813fde0a56b..c77039fd606a9 100644 --- a/recipes/openldap/all/test_package/CMakeLists.txt +++ b/recipes/openldap/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) -find_package(openldap CONFIG REQUIRED) -add_executable(${PROJECT_NAME} test_package.cpp) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(openldap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} openldap::openldap) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/openldap/all/test_package/conanfile.py b/recipes/openldap/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/openldap/all/test_package/conanfile.py +++ b/recipes/openldap/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/openldap/all/test_package/test_package.c b/recipes/openldap/all/test_package/test_package.c new file mode 100644 index 0000000000000..ca578bf88f1df --- /dev/null +++ b/recipes/openldap/all/test_package/test_package.c @@ -0,0 +1,84 @@ +/* ldapurl -- a tool for generating LDAP URLs */ +/* $OpenLDAP$ */ +/* This work is part of OpenLDAP Software . + * + * Copyright 2008-2021 The OpenLDAP Foundation. + * Portions Copyright 2008 Pierangelo Masarati, SysNet + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* Portions Copyright (c) 1992-1996 Regents of the University of Michigan. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that this notice is preserved and that due credit is given + * to the University of Michigan at Ann Arbor. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. This + * software is provided ``as is'' without express or implied warranty. + */ +/* ACKNOWLEDGEMENTS: + * This work was originally developed by Pierangelo Masarati + * for inclusion in OpenLDAP software. + */ + +#include "openldap.h" + +#include +#include + +static int do_uri_create(LDAPURLDesc *lud) { + char *uri; + + if (lud->lud_scheme == NULL) { + lud->lud_scheme = "ldap"; + } + + if (lud->lud_port == -1) { + if (strcasecmp(lud->lud_scheme, "ldap") == 0) { + lud->lud_port = LDAP_PORT; + + } else if (strcasecmp(lud->lud_scheme, "ldaps") == 0) { + lud->lud_port = LDAPS_PORT; + + } else if (strcasecmp(lud->lud_scheme, "ldapi") == 0) { + lud->lud_port = 0; + + } else { + /* forgiving... */ + lud->lud_port = 0; + } + } + + if (lud->lud_scope == -1) { + lud->lud_scope = LDAP_SCOPE_DEFAULT; + } + + uri = ldap_url_desc2str(lud); + + if (uri == NULL) { + fprintf(stderr, "unable to generate URI\n"); + exit(EXIT_FAILURE); + } + + printf("%s\n", uri); + free(uri); + + return 0; +} + +int main() { + LDAPURLDesc lud = {0}; + + lud.lud_port = -1; + lud.lud_scope = -1; + + return do_uri_create(&lud); +} diff --git a/recipes/openldap/all/test_package/test_package.cpp b/recipes/openldap/all/test_package/test_package.cpp deleted file mode 100644 index ab1267d80b23a..0000000000000 --- a/recipes/openldap/all/test_package/test_package.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* ldapurl -- a tool for generating LDAP URLs */ -/* $OpenLDAP$ */ -/* This work is part of OpenLDAP Software . - * - * Copyright 2008-2021 The OpenLDAP Foundation. - * Portions Copyright 2008 Pierangelo Masarati, SysNet - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted only as authorized by the OpenLDAP - * Public License. - * - * A copy of this license is available in the file LICENSE in the - * top-level directory of the distribution or, alternatively, at - * . - */ -/* Portions Copyright (c) 1992-1996 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. This - * software is provided ``as is'' without express or implied warranty. - */ -/* ACKNOWLEDGEMENTS: - * This work was originally developed by Pierangelo Masarati - * for inclusion in OpenLDAP software. - */ - -#include -#include -#include "openldap.h" - -static int do_uri_create(LDAPURLDesc *lud) { - char *uri; - - if (lud->lud_scheme == NULL) { - lud->lud_scheme = "ldap"; - } - - if (lud->lud_port == -1) { - if (strcasecmp(lud->lud_scheme, "ldap") == 0) { - lud->lud_port = LDAP_PORT; - - } else if (strcasecmp(lud->lud_scheme, "ldaps") == 0) { - lud->lud_port = LDAPS_PORT; - - } else if (strcasecmp(lud->lud_scheme, "ldapi") == 0) { - lud->lud_port = 0; - - } else { - /* forgiving... */ - lud->lud_port = 0; - } - } - - if (lud->lud_scope == -1) { - lud->lud_scope = LDAP_SCOPE_DEFAULT; - } - - uri = ldap_url_desc2str(lud); - - if (uri == NULL) { - fprintf(stderr, "unable to generate URI\n"); - exit(EXIT_FAILURE); - } - - printf("%s\n", uri); - free(uri); - - return 0; -} - -int main() { - LDAPURLDesc lud = {0}; - - lud.lud_port = -1; - lud.lud_scope = -1; - - return do_uri_create(&lud); -} diff --git a/recipes/openldap/all/test_v1_package/CMakeLists.txt b/recipes/openldap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/openldap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/openldap/all/test_v1_package/conanfile.py b/recipes/openldap/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/openldap/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/openldap/config.yml b/recipes/openldap/config.yml index 36b28f1209ae7..7177bd469e00d 100644 --- a/recipes/openldap/config.yml +++ b/recipes/openldap/config.yml @@ -1,3 +1,5 @@ versions: + "2.6.7": + folder: all "2.6.1": folder: all diff --git a/recipes/openscenegraph/all/CMakeLists.txt b/recipes/openscenegraph/all/CMakeLists.txt index a0749127966c0..5acc346654c57 100644 --- a/recipes/openscenegraph/all/CMakeLists.txt +++ b/recipes/openscenegraph/all/CMakeLists.txt @@ -1,23 +1,44 @@ -cmake_minimum_required(VERSION 3.1.2) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) -include(${PROJECT_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(NO_OUTPUT_DIRS) +macro(custom_find_package name variable) + string(TOUPPER ${name} name_upper) + if(${variable}) + find_package(${name} ${ARGN} REQUIRED CONFIG + # Allow only Conan packages + NO_DEFAULT_PATH + PATHS ${CMAKE_PREFIX_PATH} + ) + set(${name_upper}_FOUND TRUE) + set(${name_upper}_VERSION_STRING ${${name}_VERSION_STRING}) + set(${name_upper}_INCLUDE_DIRS ${${name}_INCLUDE_DIRS}) + set(${name_upper}_INCLUDE_DIR ${${name}_INCLUDE_DIR}) + set(${name_upper}_LIBRARIES ${${name}_LIBRARIES}) + set(${name_upper}_DEFINITIONS ${${name}_DEFINITIONS}) + unset(name_upper) + else() + set(${name}_FOUND FALSE) + set(${name_upper}_FOUND FALSE) + endif() +endmacro() -# Hack to insure that conan's copy of these are used, rather than CMake's -# If this isn't here, find_package(X11) will pull in CMake's copy -find_package(Freetype QUIET) -find_package(Fontconfig QUIET) +custom_find_package(Boost OSG_WITH_ASIO) +custom_find_package(Asio OSG_WITH_ASIO) +custom_find_package(CURL OSG_WITH_CURL) +custom_find_package(Fontconfig OSG_TEXT_USE_FONTCONFIG) +custom_find_package(Freetype OSG_WITH_FREETYPE) +custom_find_package(GDAL OSG_WITH_GDAL) +custom_find_package(GIFLIB OSG_WITH_GIFLIB) +custom_find_package(GTA OSG_WITH_GTA) +custom_find_package(JPEG OSG_WITH_JPEG) +custom_find_package(Jasper OSG_WITH_JASPER) +custom_find_package(OpenEXR OSG_WITH_OPENEXR) +custom_find_package(PNG OSG_WITH_PNG) +custom_find_package(TIFF OSG_WITH_TIFF) +custom_find_package(ZLIB OSG_WITH_ZLIB) +custom_find_package(DCMTK OSG_WITH_DCMTK) +# custom_find_package(Poppler) +# custom_find_package(RSVG) +# custom_find_package(SDL2) -# Workaround limitations of the cmake_find_package generator -set(FREETYPE_FOUND ${Freetype_FOUND}) -if(FREETYPE_FOUND) - set(FREETYPE_LIBRARIES ${Freetype_LIBRARIES}) - set(FREETYPE_INCLUDE_DIRS ${Freetype_INCLUDE_DIRS}) -endif() - -if(APPLE) - add_compile_definitions("GL_SILENCE_DEPRECATION") -endif() - -add_subdirectory("source_subfolder") +add_subdirectory(src) diff --git a/recipes/openscenegraph/all/conan-official-osg-variables.cmake b/recipes/openscenegraph/all/conan-official-osg-variables.cmake new file mode 100644 index 0000000000000..636f54b308c40 --- /dev/null +++ b/recipes/openscenegraph/all/conan-official-osg-variables.cmake @@ -0,0 +1,23 @@ +# Reproduce https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/cmake/OpenSceneGraphConfig.cmake.in +# Component-specific variables are not created. Use the component targets instead. + +# Only export these for the OpenSceneGraph config file, not FindOSG.cmake +if(NOT DEFINED OSG_LIBRARIES) + set(OPENSCENEGRAPH_FOUND TRUE) + set(OPENSCENEGRAPH_LIBRARIES ${OpenSceneGraph_LIBRARIES}) + set(OPENSCENEGRAPH_INCLUDE_DIR ${OpenSceneGraph_INCLUDE_DIRS}) + set(OPENSCENEGRAPH_INCLUDE_DIRS ${OpenSceneGraph_INCLUDE_DIRS}) + + set(OPENSCENEGRAPH_VERSION ${OpenSceneGraph_VERSION}) + set(OPENSCENEGRAPH_VERSION_STRING ${OpenSceneGraph_VERSION_STRING}) + + set(OSG_LIBRARY ${OpenSceneGraph_LIBRARIES}) + set(OSG_LIBRARIES ${OpenSceneGraph_LIBRARIES}) + set(OSG_INCLUDE_DIR ${OpenSceneGraph_INCLUDE_DIRS}) + set(OSG_INCLUDE_DIRS ${OpenSceneGraph_INCLUDE_DIRS}) +endif() + +# Reproduce https://github.com/openscenegraph/OpenSceneGraph/blob/master/CMakeModules/FindOpenThreads.cmake +set(OPENTHREADS_FOUND TRUE) +set(OPENTHREADS_INCLUDE_DIR ${OpenSceneGraph_INCLUDE_DIRS}) +set(OPENTHREADS_LIBRARY OpenThreads::OpenThreads) diff --git a/recipes/openscenegraph/all/conandata.yml b/recipes/openscenegraph/all/conandata.yml index 0f1b6a2cc4790..094e9853e6fca 100644 --- a/recipes/openscenegraph/all/conandata.yml +++ b/recipes/openscenegraph/all/conandata.yml @@ -1,18 +1,38 @@ sources: 3.6.5: - sha256: aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12 - url: https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-3.6.5.tar.gz + url: "https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-3.6.5.tar.gz" + sha256: "aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12" patches: 3.6.5: - patch_file: patches/0001-fix-to_cmake_path-usage.patch - base_path: source_subfolder - - patch_file: patches/0002-Use-standard-CMake-name-for-gif.patch - base_path: source_subfolder - - patch_file: patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch - base_path: source_subfolder - - patch_file: patches/0004-Allow-explicit-control-of-plugins.patch - base_path: source_subfolder + patch_description: Fix cmake paths + patch_type: portability - patch_file: patches/0005-use-JPEG-target-for-plugin.patch - base_path: source_subfolder + patch_description: This fixes building against a static libjpeg on windows + patch_type: portability - patch_file: patches/0006-Declare-result-as-LONG-for-Mingw-build.patch - base_path: source_subfolder + patch_description: Win32's ChangeDisplaySettingsEx() API function is documented as returning `LONG`, which evidently is not always the same as `unsigned int` (Mingw64.) This cause a compile error on Mingw with clang10. + patch_type: official + patch_source: https://github.com/openscenegraph/OpenSceneGraph/commit/67468cce344dd5e503aaa1063845f34720563f79 + - patch_file: patches/0007-fix-msvc-with-std-c++17.patch + patch_description: Fix to be able to build with c++17 on MSVC + patch_type: official + patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1055 + - patch_file: patches/0008-replace-mem-fun-ref.patch + patch_description: Replaced std::mem_fun_ref usage to avoid compatiblity with modern compilers + patch_type: official + patch_source: https://github.com/openscenegraph/OpenSceneGraph/commit/8a0114a46a4bad9041297950fe3bfbb2aea6e1da + - patch_file: patches/0009-replace-auto-ptr-in-plugins.patch + patch_description: auto_ptr is removed in C++17. + patch_type: portability + patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1246 + - patch_file: patches/0010-replace-ptr-fun-in-obj-plugin.patch + patch_description: ptr_fun is removed in C++17 + patch_type: portability + patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1246 + - patch_file: patches/0011-remove-deprecated-register.patch + patch_description: The "register" keyword is deprecated as of C++17 + patch_type: bugfix + patch_source: + - https://github.com/openscenegraph/OpenSceneGraph/pull/1296 + - https://github.com/openscenegraph/OpenSceneGraph/pull/951 diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 5d6b6d3a14882..8ed902063ca31 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -1,25 +1,27 @@ +import os +import re +from pathlib import Path + from conan import ConanFile -from conan.tools.files import get, rmdir, rm, apply_conandata_patches +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os from conan.tools.build import cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, replace_in_file from conan.tools.scm import Version -from conan.tools.apple import is_apple_os -from conan.errors import ConanInvalidConfiguration -from conans import CMake -import os -import functools - -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class OpenSceneGraphConanFile(ConanFile): name = "openscenegraph" description = "OpenSceneGraph is an open source high performance 3D graphics toolkit" - topics = ("openscenegraph", "graphics") + license = ("LGPL-2.1-only", "WxWindows-exception-3.1") url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.openscenegraph.org" - license = "LGPL-2.1-only", "WxWindows-exception-3.1" + topics = ("graphics",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -42,11 +44,12 @@ class OpenSceneGraphConanFile(ConanFile): "with_gif": [True, False], "with_gta": [True, False], "with_jasper": [True, False], - "with_jpeg": [True, False], + "with_jpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg", False], "with_openexr": [True, False], "with_png": [True, False], "with_tiff": [True, False], "with_zlib": [True, False], + "with_avfoundation": [True, False], "opengl_profile": ["gl1", "gl2", "gl3", "glCore", "gles1", "gles2", "gles3", "gles2+gles3"], } default_options = { @@ -70,21 +73,20 @@ class OpenSceneGraphConanFile(ConanFile): "with_gif": True, "with_gta": False, "with_jasper": False, - "with_jpeg": True, + "with_jpeg": "libjpeg", "with_openexr": False, "with_png": True, "with_tiff": True, "with_zlib": True, "opengl_profile": "gl2", + "with_avfoundation": True, } - short_paths = True - exports_sources = "CMakeLists.txt", "patches/*.patch" - generators = "cmake", "cmake_find_package" - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + copy(self, "conan-official-osg-variables.cmake", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -102,163 +104,254 @@ def config_options(self): # imageio supports tiff files so the tiff plugin isn't needed on Apple platforms self.options.with_tiff = False + else: + del self.options.with_avfoundation def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if not self.options.with_zlib: # These require zlib support - del self.options.with_openexr - del self.options.with_png - del self.options.with_dcmtk + self.options.rm_safe("with_openexr") + self.options.rm_safe("with_png") + self.options.rm_safe("with_dcmtk") - def validate(self): - if self.options.get_safe("with_asio", False): - raise ConanInvalidConfiguration("ASIO support in OSG is broken, see https://github.com/openscenegraph/OpenSceneGraph/issues/921") - if hasattr(self, "settings_build") and cross_building(self): - raise ConanInvalidConfiguration("openscenegraph recipe cannot be cross-built yet. Contributions are welcome.") + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - if self.options.enable_windowing_system and self.settings.os == "Linux": + if self.options.enable_windowing_system and self.settings.os in ["Linux", "FreeBSD"]: self.requires("xorg/system") self.requires("opengl/system") if self.options.use_fontconfig: self.requires("fontconfig/2.14.2") - if self.options.get_safe("with_asio", False): + if self.options.get_safe("with_asio"): # Should these be private requires? - self.requires("asio/1.22.1") - self.requires("boost/1.81.0") + self.requires("asio/1.28.1") + self.requires("boost/1.83.0") if self.options.with_curl: - self.requires("libcurl/8.0.1") + self.requires("libcurl/[>=7.78 <9]") if self.options.get_safe("with_dcmtk"): - self.requires("dcmtk/3.6.6") + self.requires("dcmtk/3.6.7") if self.options.with_freetype: - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2") if self.options.with_gdal: - self.requires("gdal/3.4.3") + self.requires("gdal/3.8.3") if self.options.get_safe("with_gif"): self.requires("giflib/5.2.1") if self.options.with_gta: self.requires("libgta/1.2.1") if self.options.with_jasper: - self.requires("jasper/2.0.33") - if self.options.get_safe("with_jpeg"): + self.requires("jasper/4.2.0") + 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/3.0.2") + elif self.options.get_safe("with_jpeg") == "mozjpeg": + self.requires("mozjpeg/4.1.5") if self.options.get_safe("with_openexr"): - self.requires("openexr/3.1.7") + self.requires("openexr/3.2.3") if self.options.get_safe("with_png"): self.requires("libpng/1.6.40") if self.options.with_tiff: - self.requires("libtiff/4.5.1") + self.requires("libtiff/4.6.0") if self.options.with_zlib: - self.requires("zlib/1.2.13") - - def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + self.requires("zlib/[>=1.2.11 <2]") - def _patch_sources(self): - apply_conandata_patches(self) - - for package in ("Fontconfig", "Freetype", "GDAL", "GIFLIB", "GTA", "Jasper", "OpenEXR"): - # Prefer conan's find package scripts over osg's - os.unlink(os.path.join(self._source_subfolder, "CMakeModules", "Find{}.cmake".format(package))) + def validate(self): + if self.options.get_safe("with_asio"): + raise ConanInvalidConfiguration( + "ASIO support in OSG is broken, " + "see https://github.com/openscenegraph/OpenSceneGraph/issues/921" + ) + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration( + "openscenegraph recipe cannot be cross-built yet. " + "Contributions are welcome." + ) - @functools.lru_cache(1) - def _configured_cmake(self): - cmake = CMake(self) + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - cmake.definitions["USE_3RDPARTY_BIN"] = False + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_3RDPARTY_BIN"] = False - cmake.definitions["DYNAMIC_OPENSCENEGRAPH"] = self.options.shared - cmake.definitions["DYNAMIC_OPENTHREADS"] = self.options.shared + tc.variables["DYNAMIC_OPENSCENEGRAPH"] = self.options.shared + tc.variables["DYNAMIC_OPENTHREADS"] = self.options.shared - cmake.definitions["BUILD_OSG_APPLICATIONS"] = self.options.build_applications - cmake.definitions["BUILD_OSG_EXAMPLES"] = False + tc.variables["BUILD_OSG_APPLICATIONS"] = self.options.build_applications + tc.variables["BUILD_OSG_EXAMPLES"] = False - cmake.definitions["OSG_NOTIFY_DISABLED"] = not self.options.enable_notify - cmake.definitions["OSG_USE_DEPRECATED_API"] = self.options.enable_deprecated_api - cmake.definitions["OSG_PROVIDE_READFILE"] = self.options.enable_readfile - cmake.definitions["OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION"] = self.options.enable_ref_ptr_implicit_output_conversion - cmake.definitions["OSG_USE_REF_PTR_SAFE_DEREFERENCE"] = self.options.enable_ref_ptr_safe_dereference - cmake.definitions["OSG_ENVVAR_SUPPORTED"] = self.options.enable_envvar_support + tc.variables["OSG_NOTIFY_DISABLED"] = not self.options.enable_notify + tc.variables["OSG_USE_DEPRECATED_API"] = self.options.enable_deprecated_api + tc.variables["OSG_PROVIDE_READFILE"] = self.options.enable_readfile + tc.variables["OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION"] = self.options.enable_ref_ptr_implicit_output_conversion + tc.variables["OSG_USE_REF_PTR_SAFE_DEREFERENCE"] = self.options.enable_ref_ptr_safe_dereference + tc.variables["OSG_ENVVAR_SUPPORTED"] = self.options.enable_envvar_support if not self.options.enable_windowing_system: - cmake.definitions["OSG_WINDOWING_SYSTEM"] = None + tc.variables["OSG_WINDOWING_SYSTEM"] = None - cmake.definitions["BUILD_OSG_DEPRECATED_SERIALIZERS"] = self.options.enable_deprecated_serializers + tc.variables["BUILD_OSG_DEPRECATED_SERIALIZERS"] = self.options.enable_deprecated_serializers - cmake.definitions["OSG_TEXT_USE_FONTCONFIG"] = self.options.use_fontconfig + tc.variables["OSG_TEXT_USE_FONTCONFIG"] = self.options.use_fontconfig - cmake.definitions["OPENGL_PROFILE"] = str(self.options.opengl_profile).upper() + tc.variables["OPENGL_PROFILE"] = str(self.options.opengl_profile).upper() # Disable option dependencies unless we have a package for them - cmake.definitions["OSG_WITH_FREETYPE"] = self.options.with_freetype - cmake.definitions["OSG_WITH_OPENEXR"] = self.options.get_safe("with_openexr", False) - cmake.definitions["OSG_WITH_INVENTOR"] = False - cmake.definitions["OSG_WITH_JASPER"] = self.options.with_jasper - cmake.definitions["OSG_WITH_OPENCASCADE"] = False - cmake.definitions["OSG_WITH_FBX"] = False - cmake.definitions["OSG_WITH_ZLIB"] = self.options.with_zlib - cmake.definitions["OSG_WITH_GDAL"] = self.options.with_gdal - cmake.definitions["OSG_WITH_GTA"] = self.options.with_gta - cmake.definitions["OSG_WITH_CURL"] = self.options.with_curl - cmake.definitions["OSG_WITH_LIBVNCSERVER"] = False - cmake.definitions["OSG_WITH_DCMTK"] = self.options.get_safe("with_dcmtk", False) - cmake.definitions["OSG_WITH_FFMPEG"] = False - cmake.definitions["OSG_WITH_DIRECTSHOW"] = False - cmake.definitions["OSG_WITH_SDL"] = False - cmake.definitions["OSG_WITH_POPPLER"] = False - cmake.definitions["OSG_WITH_RSVG"] = False - cmake.definitions["OSG_WITH_NVTT"] = False - cmake.definitions["OSG_WITH_ASIO"] = self.options.get_safe("with_asio", False) - cmake.definitions["OSG_WITH_ZEROCONF"] = False - cmake.definitions["OSG_WITH_LIBLAS"] = False - cmake.definitions["OSG_WITH_GIF"] = self.options.get_safe("with_gif", False) - cmake.definitions["OSG_WITH_JPEG"] = self.options.get_safe("with_jpeg", False) - cmake.definitions["OSG_WITH_PNG"] = self.options.get_safe("with_png", False) - cmake.definitions["OSG_WITH_TIFF"] = self.options.with_tiff + tc.variables["OSG_WITH_FREETYPE"] = self.options.with_freetype + tc.variables["OSG_WITH_OPENEXR"] = self.options.get_safe("with_openexr", False) + tc.variables["OSG_WITH_INVENTOR"] = False + tc.variables["OSG_WITH_JASPER"] = self.options.with_jasper + tc.variables["OSG_WITH_OPENCASCADE"] = False + tc.variables["OSG_WITH_FBX"] = False + tc.variables["OSG_WITH_ZLIB"] = self.options.with_zlib + tc.variables["OSG_WITH_GDAL"] = self.options.with_gdal + tc.variables["OSG_WITH_GTA"] = self.options.with_gta + tc.variables["OSG_WITH_CURL"] = self.options.with_curl + tc.variables["OSG_WITH_LIBVNCSERVER"] = False + tc.variables["OSG_WITH_DCMTK"] = self.options.get_safe("with_dcmtk", False) + tc.variables["OSG_WITH_FFMPEG"] = False + tc.variables["OSG_WITH_DIRECTSHOW"] = False + tc.variables["OSG_WITH_SDL"] = False + tc.variables["OSG_WITH_POPPLER"] = False + tc.variables["OSG_WITH_RSVG"] = False + tc.variables["OSG_WITH_NVTT"] = False + tc.variables["OSG_WITH_ASIO"] = self.options.get_safe("with_asio", False) + tc.variables["OSG_WITH_ZEROCONF"] = False + tc.variables["OSG_WITH_LIBLAS"] = False + tc.variables["OSG_WITH_GIFLIB"] = self.options.get_safe("with_gif", False) + tc.variables["OSG_WITH_JPEG"] = self.options.get_safe("with_jpeg", False) + tc.variables["OSG_WITH_PNG"] = self.options.get_safe("with_png", False) + tc.variables["OSG_WITH_TIFF"] = self.options.with_tiff + + if (self.options.get_safe("with_avfoundation")): + tc.variables["OSG_WITH_AV_FOUNDATION"] = True if self.settings.os == "Windows": # osg has optional quicktime support on Windows - cmake.definitions["CMAKE_DISABLE_FIND_PACKAGE_QuickTime"] = True + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_QuickTime"] = True + + tc.variables["OSG_MSVC_VERSIONED_DLL"] = False - cmake.definitions["OSG_MSVC_VERSIONED_DLL"] = False + if is_apple_os(self): + tc.preprocessor_definitions["GL_SILENCE_DEPRECATION"] = "1" - cmake.configure() + tc.generate() - return cmake + deps = CMakeDeps(self) + deps.set_property("freetype", "cmake_module_file_name", "Freetype") + deps.set_property("giflib", "cmake_file_name", "GIFLIB") + deps.generate() + + def _patch_sources(self): + for package in ["Fontconfig", "Freetype", "GDAL", "GIFLIB", "GTA", "Jasper", "OpenEXR"]: + # Prefer conan's find package scripts over osg's + os.unlink(os.path.join(self.source_folder, "CMakeModules", f"Find{package}.cmake")) + plugins_root = Path(self.source_path.joinpath("src", "osgPlugins")) + for path in plugins_root.rglob("CMakeLists.txt"): + if path.parent == plugins_root: + # Don't replace in the root dir + continue + content = path.read_text() + # Correct usage of *_LIBRARY variables to *_LIBRARIES + content = content.replace("_LIBRARY", "_LIBRARIES") + # Allow explicit control of plugins via OSG_WITH_* variables + # e.g. replace IF(FFMPEG_FOUND) with IF(OSG_WITH_FFMPEG) + content = re.sub(r"\b([A-Z]+)_FOUND\b", r"OSG_WITH_\1", content) + path.write_text(content) + for path in self.source_path.joinpath(self.source_folder, "CMakeModules").rglob("*.cmake"): + content = path.read_text(encoding='utf-8', errors='ignore') + lib_match = re.search(r'FIND_LIBRARY\(([^ ]+)_LIBRARY', content) + if lib_match: + library_name = lib_match.group(1) + new_content = re.sub(rf'\b{library_name}_LIBRARY\b', rf'{library_name}_LIBRARIES', content) + path.write_text(new_content) + + apply_conandata_patches(self) + + # Not sure why, but CMake fails to find the EXPAT::EXPAT target created by Conan when Fontconfig is found as a module. + replace_in_file(self, os.path.join(self.source_folder, "src", "osgText", "CMakeLists.txt"), + "find_package(Fontconfig MODULE)", "find_package(Fontconfig CONFIG REQUIRED)") + replace_in_file(self, os.path.join(self.source_folder, "src", "osgPlugins", "freetype", "CMakeLists.txt"), + "SET(TARGET_EXTERNAL_LIBRARIES ${FREETYPE_LIBRARIES} )", "SET(TARGET_EXTERNAL_LIBRARIES Freetype::Freetype)") + + # osg uses imageio on Apple platforms. PNG_FOUND will be set by `FIND_PACKAGE(Freetype)` + # in the OSG cmake code and without this patch the png plugin will be included even though it shouldn't. + replace_in_file(self, os.path.join(self.source_folder, "src", "osgPlugins", "CMakeLists.txt"), + "PNG_FOUND", "PNG_FOUND AND OSG_WITH_PNG") + + # Only add curl plugin if actually requested. + replace_in_file(self, os.path.join(self.source_folder, "src", "osgPlugins", "CMakeLists.txt"), + "CURL_FOUND", "CURL_FOUND AND OSG_WITH_CURL") def build(self): self._patch_sources() - - self._configured_cmake().build() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) + cmake.build() def package(self): - self._configured_cmake().install() + cmake = CMake(self) + cmake.install() - self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "conan-official-osg-variables.cmake", + dst=os.path.join(self.package_folder, "lib", "cmake"), + src=os.path.join(self.source_folder, os.pardir)) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rm(self, "*.pdb", self.package_folder, True) def package_info(self): - # FindOpenSceneGraph.cmake is shipped with cmake and is a traditional cmake script - # It doesn't setup targets and only provides a few variables: - # - OPENSCENEGRAPH_FOUND - # - OPENSCENEGRAPH_VERSION - # - OPENSCENEGRAPH_INCLUDE_DIRS - # - OPENSCENEGRAPH_LIBRARIES - # Unfortunately, the cmake_find_package generators don't currently allow directly setting variables, - # but it will set the last three of these if the name of the package is OPENSCENEGRAPH (it uses - # the filename for the first, so OpenSceneGraph_FOUND gets set, not OPENSCENEGRAPH_FOUND) - # TODO: set OPENSCENEGRAPH_FOUND in cmake_find_package and cmake_find_package_multi - self.cpp_info.filenames["cmake_find_package"] = "OpenSceneGraph" - self.cpp_info.filenames["cmake_find_package_multi"] = "OpenSceneGraph" - self.cpp_info.names["cmake_find_package"] = "OPENSCENEGRAPH" - self.cpp_info.names["cmake_find_package_multi"] = "OPENSCENEGRAPH" + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/cmake/OpenSceneGraphConfig.cmake.in + self.cpp_info.set_property("cmake_file_name", "OpenSceneGraph") + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/CMakeModules/FindOSG.cmake + self.cpp_info.set_property("cmake_module_file_name", "OSG") + # Disable the automatically created targets, use the "openscenegraph" component instead + self.cpp_info.set_property("pkg_config_name", None) + self.cpp_info.set_property("cmake_target_name", None) + + # Export CMake variables set by the project + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + cmake_vars_module = os.path.join("lib", "cmake", "conan-official-osg-variables.cmake") + self.cpp_info.set_property("cmake_build_modules", [cmake_vars_module]) + + # The main component that depends on all non-plugin components + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/pkgconfig/openscenegraph.pc.in + openscenegraph = self.cpp_info.components["openscenegraph"] + openscenegraph.set_property("pkg_config_name", "openscenegraph") + # Unofficial CMake target + openscenegraph.set_property("cmake_target_name", "OpenSceneGraph::OpenSceneGraph") + openscenegraph.requires = [ + "osg", + "osgDB", + "osgFX", + "osgGA", + "osgParticle", + "osgSim", + "osgText", + "osgUtil", + "osgTerrain", + "osgManipulator", + "osgViewer", + "osgWidget", + "osgShadow", + "osgAnimation", + "osgVolume", + ] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "OpenSceneGraph" + self.cpp_info.names["cmake_find_package_multi"] = "OpenSceneGraph" + openscenegraph.names["cmake_find_package"] = "OpenSceneGraph" + openscenegraph.names["cmake_find_package_multi"] = "OpenSceneGraph" + self.cpp_info.build_modules["cmake_find_package"].append(cmake_vars_module) + self.cpp_info.build_modules["cmake_find_package_multi"].append(cmake_vars_module) if self.settings.build_type == "Debug": postfix = "d" @@ -275,49 +368,52 @@ def setup_plugin(plugin): plugin_library.libs = [] if self.options.shared else [lib + postfix] plugin_library.requires = ["OpenThreads", "osg", "osgDB", "osgUtil"] if not self.options.shared: - plugin_library.libdirs = [os.path.join("lib", "osgPlugins-{}".format(self.version))] + plugin_library.libdirs = [os.path.join("lib", f"osgPlugins-{self.version}")] return plugin_library def setup_serializers(lib): plugins = [] if lib not in ("osgDB", "osgWidget", "osgPresentation"): - plugins.append("serializers_{}".format(lib.lower())) + plugins.append(f"serializers_{lib.lower()}") if self.options.enable_deprecated_serializers: if lib not in ("osgUtil", "osgDB", "osgGA", "osgManipulator", "osgUI", "osgPresentation"): - plugins.append("deprecated_{}".format(lib.lower())) + plugins.append(f"deprecated_{lib.lower()}") for plugin in plugins: setup_plugin(plugin).requires.append(lib) def setup_library(lib): library = self.cpp_info.components[lib] library.libs = [lib + postfix] - library.names["pkg_config"] = "openscenegraph-{}".format(lib) + library.set_property("pkg_config_name", f"openscenegraph-{lib}") setup_serializers(lib) return library # Core libraries # requires obtained from osg's source code - # TODO: FindOpenThreads.cmake is shipped with CMake, so we should generate separate - # files for it with cmake_find_package and cmake_find_package_multi + # The project installs FindOpenThreads.cmake as a separate module. + # Conan cannot recreate that, but let's export it as a component instead. + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/CMakeModules/FindOpenThreads.cmake + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/pkgconfig/openthreads.pc.in library = self.cpp_info.components["OpenThreads"] library.libs = ["OpenThreads" + postfix] - library.names["pkg_config"] = "openthreads" - if self.settings.os == "Linux": + library.set_property("pkg_config_name", "openthreads") + library.set_property("cmake_target_name", "OpenThreads::OpenThreads") + if self.settings.os in ["Linux", "FreeBSD"]: library.system_libs = ["pthread"] library = setup_library("osg") library.requires = ["OpenThreads", "opengl::opengl"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: library.system_libs = ["m", "rt", "dl"] if not self.options.shared: library.defines.append("OSG_LIBRARY_STATIC") library = setup_library("osgDB") library.requires = ["osg", "osgUtil", "OpenThreads"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: library.system_libs = ["dl"] - elif self.settings.os == "Macos": + elif is_apple_os(self): library.frameworks = ["Carbon", "Cocoa"] if self.options.with_zlib: library.requires.append("zlib::zlib") @@ -333,7 +429,7 @@ def setup_library(lib): library = setup_library("osgViewer") library.requires = ["osgGA", "osgText", "osgDB", "osgUtil", "osg"] if self.options.enable_windowing_system: - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: library.requires.append("xorg::xorg") elif is_apple_os(self): library.frameworks = ["Cocoa"] @@ -350,7 +446,8 @@ def setup_library(lib): setup_library("osgSim").requires = ["osgText", "osgUtil", "osgDB", "osg", "OpenThreads"] setup_library("osgTerrain").requires = ["osgUtil", "osgDB", "osg", "OpenThreads"] setup_library("osgWidget").requires = ["osgText", "osgViewer", "osgDB", "osg", "OpenThreads"] - setup_library("osgPresentation").requires = ["osgViewer", "osgUI", "osgWidget", "osgManipulator", "osgVolume", "osgFX", "osgText", "osgGA", "osgUtil", "osgDB", "osg", "OpenThreads"] + setup_library("osgPresentation").requires = ["osgViewer", "osgUI", "osgWidget", "osgManipulator", "osgVolume", + "osgFX", "osgText", "osgGA", "osgUtil", "osgDB", "osg", "OpenThreads"] # Start of plugins @@ -369,7 +466,7 @@ def setup_library(lib): setup_plugin("osg") plugin = setup_plugin("ive") - plugin.requires.extend(("osgSim", "osgFX", "osgText", "osgTerrain", "osgVolume")) + plugin.requires.extend(["osgSim", "osgFX", "osgText", "osgTerrain", "osgVolume"]) if self.options.with_zlib: plugin.requires.append("zlib::zlib") @@ -390,8 +487,12 @@ def setup_library(lib): setup_plugin("vtf") setup_plugin("ktx") - if self.options.get_safe("with_jpeg"): + if self.options.get_safe("with_jpeg") == "libjpeg": setup_plugin("jpeg").requires.append("libjpeg::libjpeg") + elif self.options.get_safe("with_jpeg") == "libjpeg-turbo": + setup_plugin("jpeg").requires.append("libjpeg-turbo::jpeg") + elif self.options.get_safe("with_jpeg") == "mozjpeg": + setup_plugin("jpeg").requires.append("mozjpeg::libjpeg") if self.options.with_jasper: setup_plugin("jp2").requires.append("jasper::jasper") @@ -403,13 +504,13 @@ def setup_library(lib): setup_plugin("gif").requires.append("giflib::giflib") if self.options.get_safe("with_png"): - setup_plugin("png").requires.extend(("libpng::libpng", "zlib::zlib")) + setup_plugin("png").requires.extend(["libpng::libpng", "zlib::zlib"]) if self.options.with_tiff: setup_plugin("tiff").requires.append("libtiff::libtiff") if self.options.with_gdal: - setup_plugin("gdal").requires.extend(("osgTerrain", "gdal::gdal")) + setup_plugin("gdal").requires.extend(["osgTerrain", "gdal::gdal"]) setup_plugin("ogr").requires.append("gdal::gdal") if self.options.with_gta: @@ -418,13 +519,13 @@ def setup_library(lib): # 3D Image plugins if self.options.get_safe("with_dcmtk"): plugin = setup_plugin("dicom") - plugin.requires.extend(("osgVolume", "dcmtk::dcmtk")) + plugin.requires.extend(["osgVolume", "dcmtk::dcmtk"]) if self.settings.os == "Windows": plugin.system_libs = ["wsock32", "ws2_32"] # 3rd party 3d plugins setup_plugin("3dc") - setup_plugin("p3d").requires.extend(("osgGA", "osgText", "osgVolume", "osgFX", "osgViewer", "osgPresentation")) + setup_plugin("p3d").requires.extend(["osgGA", "osgText", "osgVolume", "osgFX", "osgViewer", "osgPresentation"]) if self.options.with_curl: plugin = setup_plugin("curl") @@ -462,15 +563,15 @@ def setup_library(lib): setup_plugin("md2") setup_plugin("osgtgz") setup_plugin("tgz") - setup_plugin("shp").requires.extend(("osgSim", "osgTerrain")) + setup_plugin("shp").requires.extend(["osgSim", "osgTerrain"]) setup_plugin("txf").requires.append("osgText") setup_plugin("bsp") setup_plugin("mdl") - setup_plugin("gles").requires.extend(("osgUtil", "osgAnimation")) - setup_plugin("osgjs").requires.extend(("osgAnimation", "osgSim")) + setup_plugin("gles").requires.extend(["osgUtil", "osgAnimation"]) + setup_plugin("osgjs").requires.extend(["osgAnimation", "osgSim"]) setup_plugin("lwo").requires.append("osgFX") setup_plugin("ply") - setup_plugin("txp").requires.extend(("osgSim", "osgText")) + setup_plugin("txp").requires.extend(["osgSim", "osgText"]) # with_ffmpeg # setup_plugin("ffmpeg") @@ -484,16 +585,20 @@ def setup_library(lib): if is_apple_os(self): setup_plugin("imageio").frameworks = ["Accelerate"] - if ((self.settings.os == "Macos" and self.settings.os.version and Version(self.settings.os.version) >= "10.8") - or (self.settings.os == "iOS" and Version(self.settings.os.version) >= "6.0")): + if (self.options.get_safe("with_avfoundation")): plugin = setup_plugin("avfoundation") plugin.requires.append("osgViewer") plugin.frameworks = ["AVFoundation", "Cocoa", "CoreVideo", "CoreMedia", "QuartzCore"] - if self.settings.os == "Macos" and self.settings.os.version and Version(self.settings.os.version) <= "10.6" and self.settings.arch == "x86": + if ( + is_apple_os(self) + and self.settings.os.version + and Version(self.settings.os.version) <= "10.6" + and self.settings.arch == "x86" + ): setup_plugin("qt").frameworks = ["QuickTime"] - if self.settings.os == "Macos" and self.settings.arch == "x86": + if is_apple_os(self) and self.settings.arch == "x86": plugin = setup_plugin("QTKit") plugin.requires.append("osgViewer") plugin.frameworks = ["QTKit", "Cocoa", "QuickTime", "CoreVideo"] @@ -502,7 +607,7 @@ def setup_library(lib): # setup_plugin("nvtt") if self.options.with_freetype: - setup_plugin("freetype").requires.extend(("osgText", "freetype::freetype")) + setup_plugin("freetype").requires.extend(["osgText", "freetype::freetype"]) if self.options.with_zlib: setup_plugin("zip") @@ -535,7 +640,7 @@ def setup_library(lib): # setup_plugin("sdl") if self.options.get_safe("with_asio", False): - setup_plugin("resthttp").requires.extend(("osgPresentation", "asio::asio", "boost::boost")) + setup_plugin("resthttp").requires.extend(["osgPresentation", "asio::asio", "boost::boost"]) # with_zeroconf # setup_plugin("zeroconf") diff --git a/recipes/openscenegraph/all/patches/0002-Use-standard-CMake-name-for-gif.patch b/recipes/openscenegraph/all/patches/0002-Use-standard-CMake-name-for-gif.patch deleted file mode 100644 index 7a75a5c326228..0000000000000 --- a/recipes/openscenegraph/all/patches/0002-Use-standard-CMake-name-for-gif.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 17ad9caac56282e89d0e6a62c9564b99e2736225 Mon Sep 17 00:00:00 2001 -From: "R. Andrew Ohana" -Date: Thu, 17 Sep 2020 16:51:45 -0700 -Subject: [PATCH 2/5] Use standard CMake name for gif - ---- - CMakeLists.txt | 2 +- - src/osgPlugins/CMakeLists.txt | 2 +- - src/osgPlugins/gif/CMakeLists.txt | 4 ++-- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0ef2edd33..5e0c8f349 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -813,7 +813,7 @@ ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID) - # can use Quicktime. - IF(NOT ANDROID) - IF(NOT APPLE) -- FIND_PACKAGE(GIFLIB) -+ FIND_PACKAGE(GIF) - FIND_PACKAGE(JPEG) - FIND_PACKAGE(PNG) - FIND_PACKAGE(TIFF) -diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt -index 812550412..2a88684b5 100644 ---- a/src/osgPlugins/CMakeLists.txt -+++ b/src/osgPlugins/CMakeLists.txt -@@ -108,7 +108,7 @@ ENDIF() - IF(OPENEXR_FOUND AND ZLIB_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) - ADD_PLUGIN_DIRECTORY(exr) - ENDIF() --IF(GIFLIB_FOUND) -+IF(GIF_FOUND) - ADD_PLUGIN_DIRECTORY(gif) - ENDIF() - IF(PNG_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -diff --git a/src/osgPlugins/gif/CMakeLists.txt b/src/osgPlugins/gif/CMakeLists.txt -index 642339af1..0db0296cc 100644 ---- a/src/osgPlugins/gif/CMakeLists.txt -+++ b/src/osgPlugins/gif/CMakeLists.txt -@@ -1,7 +1,7 @@ --INCLUDE_DIRECTORIES( ${GIFLIB_INCLUDE_DIR} ) -+INCLUDE_DIRECTORIES( ${GIF_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterGIF.cpp ) --SET(TARGET_LIBRARIES_VARS GIFLIB_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS GIF_LIBRARY ) - #### end var setup ### - SETUP_PLUGIN(gif) - --- -2.21.0.windows.1 - diff --git a/recipes/openscenegraph/all/patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch b/recipes/openscenegraph/all/patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch deleted file mode 100644 index b3965bd4897eb..0000000000000 --- a/recipes/openscenegraph/all/patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch +++ /dev/null @@ -1,155 +0,0 @@ -From 4925ff028681f79b8c0cb1d8e0772ca026c6e63e Mon Sep 17 00:00:00 2001 -From: "R. Andrew Ohana" -Date: Thu, 17 Sep 2020 17:06:49 -0700 -Subject: [PATCH 3/5] Correct usage of *_LIBRARY to *_LIBRARIES - ---- - src/osgPlugins/curl/CMakeLists.txt | 4 ++-- - src/osgPlugins/gdal/CMakeLists.txt | 2 +- - src/osgPlugins/gif/CMakeLists.txt | 2 +- - src/osgPlugins/gta/CMakeLists.txt | 2 +- - src/osgPlugins/jp2/CMakeLists.txt | 2 +- - src/osgPlugins/jpeg/CMakeLists.txt | 2 +- - src/osgPlugins/ogr/CMakeLists.txt | 2 +- - src/osgPlugins/png/CMakeLists.txt | 2 +- - src/osgPlugins/tiff/CMakeLists.txt | 2 +- - src/osgPlugins/vnc/CMakeLists.txt | 2 +- - 10 files changed, 11 insertions(+), 11 deletions(-) - -diff --git a/src/osgPlugins/curl/CMakeLists.txt b/src/osgPlugins/curl/CMakeLists.txt -index 667631f07..4afb738c7 100644 ---- a/src/osgPlugins/curl/CMakeLists.txt -+++ b/src/osgPlugins/curl/CMakeLists.txt -@@ -23,11 +23,11 @@ SET(TARGET_H - - IF(ZLIB_FOUND) - SET(TARGET_LIBRARIES_VARS -- CURL_LIBRARY -+ CURL_LIBRARIES - ZLIB_LIBRARIES) - ELSE() - SET(TARGET_LIBRARIES_VARS -- CURL_LIBRARY) -+ CURL_LIBRARIES) - ENDIF() - - IF(WIN32 OR MINGW) -diff --git a/src/osgPlugins/gdal/CMakeLists.txt b/src/osgPlugins/gdal/CMakeLists.txt -index f1b670701..353bc9fc6 100644 ---- a/src/osgPlugins/gdal/CMakeLists.txt -+++ b/src/osgPlugins/gdal/CMakeLists.txt -@@ -9,7 +9,7 @@ SET(TARGET_H - DataSetLayer.h - ) - --SET(TARGET_LIBRARIES_VARS GDAL_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS GDAL_LIBRARIES ) - SET(TARGET_ADDED_LIBRARIES osgTerrain ) - - IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") -diff --git a/src/osgPlugins/gif/CMakeLists.txt b/src/osgPlugins/gif/CMakeLists.txt -index 0db0296cc..99d1e26dc 100644 ---- a/src/osgPlugins/gif/CMakeLists.txt -+++ b/src/osgPlugins/gif/CMakeLists.txt -@@ -1,7 +1,7 @@ - INCLUDE_DIRECTORIES( ${GIF_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterGIF.cpp ) --SET(TARGET_LIBRARIES_VARS GIF_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS GIF_LIBRARIES ) - #### end var setup ### - SETUP_PLUGIN(gif) - -diff --git a/src/osgPlugins/gta/CMakeLists.txt b/src/osgPlugins/gta/CMakeLists.txt -index 2b910a628..16466fefc 100644 ---- a/src/osgPlugins/gta/CMakeLists.txt -+++ b/src/osgPlugins/gta/CMakeLists.txt -@@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${GTA_INCLUDE_DIRS} ) - - SET(TARGET_SRC ReaderWriterGTA.cpp ) - --SET(TARGET_LIBRARIES_VARS GTA_LIBRARY) -+SET(TARGET_LIBRARIES_VARS GTA_LIBRARIES) - - #### end var setup ### - SETUP_PLUGIN(gta) -diff --git a/src/osgPlugins/jp2/CMakeLists.txt b/src/osgPlugins/jp2/CMakeLists.txt -index b95537680..adcd84f64 100644 ---- a/src/osgPlugins/jp2/CMakeLists.txt -+++ b/src/osgPlugins/jp2/CMakeLists.txt -@@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${JASPER_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterJP2.cpp ) - --SET(TARGET_LIBRARIES_VARS JASPER_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS JASPER_LIBRARIES ) - - IF(WIN32) - ADD_DEFINITIONS(-DJAS_WIN_MSVC_BUILD) -diff --git a/src/osgPlugins/jpeg/CMakeLists.txt b/src/osgPlugins/jpeg/CMakeLists.txt -index 7117713a0..2d290a29d 100644 ---- a/src/osgPlugins/jpeg/CMakeLists.txt -+++ b/src/osgPlugins/jpeg/CMakeLists.txt -@@ -5,6 +5,6 @@ SET(TARGET_SRC - ReaderWriterJPEG.cpp - ) - --SET(TARGET_LIBRARIES_VARS JPEG_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS JPEG_LIBRARIES ) - #### end var setup ### - SETUP_PLUGIN(jpeg) -diff --git a/src/osgPlugins/ogr/CMakeLists.txt b/src/osgPlugins/ogr/CMakeLists.txt -index 01b71e360..ea8b9706a 100644 ---- a/src/osgPlugins/ogr/CMakeLists.txt -+++ b/src/osgPlugins/ogr/CMakeLists.txt -@@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${GDAL_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterOGR.cpp) - --SET(TARGET_LIBRARIES_VARS GDAL_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS GDAL_LIBRARIES ) - - IF(CMAKE_COMPILER_IS_GNUCXX) - # Remove -Wshadow flag as it barfs on ffmoeg headers -diff --git a/src/osgPlugins/png/CMakeLists.txt b/src/osgPlugins/png/CMakeLists.txt -index 33df903d2..c4a6a2acc 100644 ---- a/src/osgPlugins/png/CMakeLists.txt -+++ b/src/osgPlugins/png/CMakeLists.txt -@@ -5,7 +5,7 @@ IF(OSG_CPP_EXCEPTIONS_AVAILABLE) - ENDIF() - - SET(TARGET_SRC ReaderWriterPNG.cpp ) --SET(TARGET_LIBRARIES_VARS PNG_LIBRARY ZLIB_LIBRARIES ) -+SET(TARGET_LIBRARIES_VARS PNG_LIBRARIES ZLIB_LIBRARIES ) - - - #### end var setup ### -diff --git a/src/osgPlugins/tiff/CMakeLists.txt b/src/osgPlugins/tiff/CMakeLists.txt -index fc945d68e..6b856eab2 100644 ---- a/src/osgPlugins/tiff/CMakeLists.txt -+++ b/src/osgPlugins/tiff/CMakeLists.txt -@@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${TIFF_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterTIFF.cpp ) - --SET(TARGET_LIBRARIES_VARS TIFF_LIBRARY) -+SET(TARGET_LIBRARIES_VARS TIFF_LIBRARIES) - - #### end var setup ### - SETUP_PLUGIN(tiff) -diff --git a/src/osgPlugins/vnc/CMakeLists.txt b/src/osgPlugins/vnc/CMakeLists.txt -index 9a54b2bf2..49bb2dce4 100644 ---- a/src/osgPlugins/vnc/CMakeLists.txt -+++ b/src/osgPlugins/vnc/CMakeLists.txt -@@ -5,7 +5,7 @@ INCLUDE_DIRECTORIES(${LIBVNCSERVER_INCLUDE_DIR}) - SET(TARGET_EXTERNAL_LIBRARIES - ${LIBVNCCLIENT_LIBRARY} - ${ZLIB_LIBRARIES} -- ${JPEG_LIBRARY} ) -+ ${JPEG_LIBRARIES} ) - - SET(TARGET_ADDED_LIBRARIES osgWidget ) - --- -2.21.0.windows.1 - diff --git a/recipes/openscenegraph/all/patches/0004-Allow-explicit-control-of-plugins.patch b/recipes/openscenegraph/all/patches/0004-Allow-explicit-control-of-plugins.patch deleted file mode 100644 index 19caf4dfed537..0000000000000 --- a/recipes/openscenegraph/all/patches/0004-Allow-explicit-control-of-plugins.patch +++ /dev/null @@ -1,259 +0,0 @@ -From 04859156034c6762338411d5f2c07d02d0a7b814 Mon Sep 17 00:00:00 2001 -From: "R. Andrew Ohana" -Date: Thu, 17 Sep 2020 17:25:12 -0700 -Subject: [PATCH 4/5] Allow explicit control of plugins - ---- - src/osgDB/CMakeLists.txt | 8 ++-- - src/osgPlugins/CMakeLists.txt | 58 ++++++++++++++--------------- - src/osgPlugins/curl/CMakeLists.txt | 4 +- - src/osgPlugins/dicom/CMakeLists.txt | 2 +- - src/osgPlugins/ive/CMakeLists.txt | 2 +- - 5 files changed, 37 insertions(+), 37 deletions(-) - -diff --git a/src/osgDB/CMakeLists.txt b/src/osgDB/CMakeLists.txt -index 340aae095..59b8b3a0d 100644 ---- a/src/osgDB/CMakeLists.txt -+++ b/src/osgDB/CMakeLists.txt -@@ -147,19 +147,19 @@ IF(AV_FOUNDATION_FOUND) - ADD_DEFINITIONS(-DUSE_AV_FOUNDATION) - ENDIF() - --IF(FFMPEG_FOUND) -+IF(OSG_WITH_FFMPEG) - ADD_DEFINITIONS(-DUSE_FFMPEG) - ENDIF() - --IF(INVENTOR_FOUND) -+IF(OSG_WITH_INVENTOR) - ADD_DEFINITIONS(-DUSE_INVENTOR) - ENDIF() - --IF(OPENVRML_FOUND) -+IF(OSG_WITH_OPENVRML) - ADD_DEFINITIONS(-DUSE_VRML) - ENDIF() - --IF( ZLIB_FOUND ) -+IF(OSG_WITH_ZLIB) - ADD_DEFINITIONS( -DUSE_ZLIB ) - INCLUDE_DIRECTORIES( ${ZLIB_INCLUDE_DIR} ) - SET(COMPRESSION_LIBRARIES ZLIB_LIBRARIES) -diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt -index 2a88684b5..24dc68667 100644 ---- a/src/osgPlugins/CMakeLists.txt -+++ b/src/osgPlugins/CMakeLists.txt -@@ -99,29 +99,29 @@ ADD_PLUGIN_DIRECTORY(dot) - ADD_PLUGIN_DIRECTORY(vtf) - ADD_PLUGIN_DIRECTORY(ktx) - --IF(JPEG_FOUND) -+IF(OSG_WITH_JPEG) - ADD_PLUGIN_DIRECTORY(jpeg) - ENDIF() --IF(JASPER_FOUND) -+IF(OSG_WITH_JASPER) - ADD_PLUGIN_DIRECTORY(jp2) - ENDIF() --IF(OPENEXR_FOUND AND ZLIB_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_OPENEXR) - ADD_PLUGIN_DIRECTORY(exr) - ENDIF() --IF(GIF_FOUND) -+IF(OSG_WITH_GIF) - ADD_PLUGIN_DIRECTORY(gif) - ENDIF() --IF(PNG_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_PNG) - ADD_PLUGIN_DIRECTORY(png) - ENDIF() --IF(TIFF_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_TIFF) - ADD_PLUGIN_DIRECTORY(tiff) - ENDIF() --IF(GDAL_FOUND) -+IF(OSG_WITH_GDAL) - ADD_PLUGIN_DIRECTORY(gdal) - ADD_PLUGIN_DIRECTORY(ogr) - ENDIF() --IF(GTA_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_GTA) - ADD_PLUGIN_DIRECTORY(gta) - ENDIF() - -@@ -130,9 +130,9 @@ ENDIF() - # - # 3D Image plugins - # --IF(DCMTK_FOUND AND ZLIB_FOUND) -+IF(OSG_WITH_DCMTK) - ADD_PLUGIN_DIRECTORY(dicom) --ELSE() -+ELSEIF(FALSE) - IF(ITK_FOUND) - ADD_PLUGIN_DIRECTORY(dicom) - ENDIF() -@@ -147,29 +147,29 @@ ADD_PLUGIN_DIRECTORY(3dc) - - ADD_PLUGIN_DIRECTORY(p3d) - --IF(CURL_FOUND) -+IF(OSG_WITH_CURL) - ADD_PLUGIN_DIRECTORY(curl) - ENDIF() - --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - ADD_PLUGIN_DIRECTORY(gz) - ENDIF() - - IF(NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE) -- IF(INVENTOR_FOUND) -+ IF(OSG_WITH_INVENTOR) - ADD_PLUGIN_DIRECTORY(Inventor) - ENDIF() - ENDIF() - --IF(COLLADA_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_COLLADA) - ADD_PLUGIN_DIRECTORY(dae) - ENDIF() - --IF(FBX_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_FBX) - ADD_PLUGIN_DIRECTORY(fbx) - ENDIF() - --IF(OPENCASCADE_FOUND) -+IF(OSG_WITH_OPENCASCADE) - ADD_PLUGIN_DIRECTORY(OpenCASCADE) - ENDIF() - -@@ -209,15 +209,15 @@ IF(OSG_CPP_EXCEPTIONS_AVAILABLE) - ADD_PLUGIN_DIRECTORY(txp) - ENDIF() - --IF(FFMPEG_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_FFMPEG) - ADD_PLUGIN_DIRECTORY(ffmpeg) - ENDIF() - --IF(GSTREAMER_FOUND AND GLIB_FOUND) -+IF(OSG_WITH_GSTREAMER) - ADD_PLUGIN_DIRECTORY(gstreamer) - ENDIF() - --IF(DIRECTSHOW_FOUND) -+IF(OSG_WITH_DIRECTSHOW) - ADD_PLUGIN_DIRECTORY(directshow) - ENDIF() - -@@ -241,28 +241,28 @@ IF(QTKIT_FOUND) - ADD_PLUGIN_DIRECTORY(QTKit) - ENDIF() - --IF(NVTT_FOUND) -+IF(OSG_WITH_NVTT) - ADD_PLUGIN_DIRECTORY(nvtt) - ENDIF() - - --IF(FREETYPE_FOUND) -+IF(OSG_WITH_FREETYPE) - ADD_PLUGIN_DIRECTORY(freetype) - ENDIF() - --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - ADD_PLUGIN_DIRECTORY(zip) - ENDIF() - --IF(RSVG_FOUND) -+IF(OSG_WITH_RSVG) - ADD_PLUGIN_DIRECTORY(svg) - ENDIF() - --IF(POPPLER_FOUND) -+IF(OSG_WITH_POPPLER) - ADD_PLUGIN_DIRECTORY(pdf) - ENDIF() - --IF(LIBVNCSERVER_FOUND) -+IF(OSG_WITH_LIBVNCSERVER) - ADD_PLUGIN_DIRECTORY(vnc) - ENDIF() - -@@ -272,7 +272,7 @@ ADD_PLUGIN_DIRECTORY(osc) - ADD_PLUGIN_DIRECTORY(trk) - ADD_PLUGIN_DIRECTORY(tf) - --IF(LIBLAS_FOUND) -+IF(OSG_WITH_LIBLAS) - ADD_PLUGIN_DIRECTORY(las) - ENDIF() - -@@ -299,16 +299,16 @@ ENDIF() - # - # Device integration plugins - # --IF (SDL_FOUND) -+IF(OSG_WITH_SDL) - ADD_PLUGIN_DIRECTORY(sdl) - ENDIF(SDL_FOUND) - --IF(ASIO_FOUND) -+IF(OSG_WITH_ASIO) - ADD_PLUGIN_DIRECTORY(RestHttpDevice) - ENDIF(ASIO_FOUND) - - --IF(ZEROCONF_FOUND) -+IF(OSG_WITH_ZEROCONF) - ADD_PLUGIN_DIRECTORY(ZeroConfDevice) - ENDIF() - -diff --git a/src/osgPlugins/curl/CMakeLists.txt b/src/osgPlugins/curl/CMakeLists.txt -index 4afb738c7..fb5b98498 100644 ---- a/src/osgPlugins/curl/CMakeLists.txt -+++ b/src/osgPlugins/curl/CMakeLists.txt -@@ -5,7 +5,7 @@ IF(WIN32) - SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:MSVCRT") - ENDIF() - --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - ADD_DEFINITIONS(-DUSE_ZLIB) - INCLUDE_DIRECTORIES( ${CURL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) - ELSE() -@@ -21,7 +21,7 @@ SET(TARGET_H - ReaderWriterCURL.h - ) - --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - SET(TARGET_LIBRARIES_VARS - CURL_LIBRARIES - ZLIB_LIBRARIES) -diff --git a/src/osgPlugins/dicom/CMakeLists.txt b/src/osgPlugins/dicom/CMakeLists.txt -index 3f159a9c5..06ccd17ed 100644 ---- a/src/osgPlugins/dicom/CMakeLists.txt -+++ b/src/osgPlugins/dicom/CMakeLists.txt -@@ -1,4 +1,4 @@ --IF (DCMTK_FOUND) -+IF (TRUE) - - # note, we have to include a '/' in front of the directory string to prevent a CMake bug from ignoring the directory - INCLUDE_DIRECTORIES(${DCMTK_INCLUDE_DIRS}) -diff --git a/src/osgPlugins/ive/CMakeLists.txt b/src/osgPlugins/ive/CMakeLists.txt -index 784a79c7e..40030b27d 100644 ---- a/src/osgPlugins/ive/CMakeLists.txt -+++ b/src/osgPlugins/ive/CMakeLists.txt -@@ -1,4 +1,4 @@ --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - ADD_DEFINITIONS(-DUSE_ZLIB) - INCLUDE_DIRECTORIES( ${ZLIB_INCLUDE_DIR}) - ENDIF() --- -2.21.0.windows.1 - diff --git a/recipes/openscenegraph/all/patches/0007-fix-msvc-with-std-c++17.patch b/recipes/openscenegraph/all/patches/0007-fix-msvc-with-std-c++17.patch new file mode 100644 index 0000000000000..39046ed3994aa --- /dev/null +++ b/recipes/openscenegraph/all/patches/0007-fix-msvc-with-std-c++17.patch @@ -0,0 +1,50 @@ +diff --git a/src/osg/DisplaySettings.cpp b/src/osg/DisplaySettings.cpp +index 5c699c8b0..5c097cf66 100644 +--- a/src/osg/DisplaySettings.cpp ++++ b/src/osg/DisplaySettings.cpp +@@ -22,9 +22,6 @@ + #include + #include + +-using namespace osg; +-using namespace std; +- + #if defined(WIN32) && !defined(__CYGWIN__) + #include + extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; } +@@ -32,6 +29,9 @@ extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; } + extern "C" { int NvOptimusEnablement=0x00000001; } + #endif + ++using namespace osg; ++using namespace std; ++ + void DisplaySettings::setNvOptimusEnablement(int value) + { + NvOptimusEnablement = value; +diff --git a/src/osgPlugins/cfg/ConfigParser.cpp b/src/osgPlugins/cfg/ConfigParser.cpp +index 263c82896..4247cc2af 100644 +--- a/src/osgPlugins/cfg/ConfigParser.cpp ++++ b/src/osgPlugins/cfg/ConfigParser.cpp +@@ -235,7 +235,7 @@ + #include "CameraConfig.h" + + +-using namespace std; ++ + using namespace osgProducer; + + static void ConfigParser_error( const char * ); +diff --git a/src/osgPlugins/cfg/ConfigParser.y b/src/osgPlugins/cfg/ConfigParser.y +index cf9adf507..5221be184 100644 +--- a/src/osgPlugins/cfg/ConfigParser.y ++++ b/src/osgPlugins/cfg/ConfigParser.y +@@ -34,7 +34,7 @@ + #include + + +-using namespace std; ++ + using namespace Producer; + + static void ConfigParser_error( const char * ); diff --git a/recipes/openscenegraph/all/patches/0008-replace-mem-fun-ref.patch b/recipes/openscenegraph/all/patches/0008-replace-mem-fun-ref.patch new file mode 100644 index 0000000000000..5f86f332a80cf --- /dev/null +++ b/recipes/openscenegraph/all/patches/0008-replace-mem-fun-ref.patch @@ -0,0 +1,13 @@ +diff --git a/src/osgUtil/tristripper/include/detail/graph_array.h b/src/osgUtil/tristripper/include/detail/graph_array.h +index dc1f38027..ce7000cc8 100644 +--- a/src/osgUtil/tristripper/include/detail/graph_array.h ++++ b/src/osgUtil/tristripper/include/detail/graph_array.h +@@ -446,7 +446,7 @@ inline void graph_array::swap(graph_type & Right) + template + inline void unmark_nodes(graph_array & G) + { +- std::for_each(G.begin(), G.end(), std::mem_fun_ref(&graph_array::node::unmark)); ++ for(typename graph_array::node_iterator itr = G.begin(); itr != G.end(); ++itr) itr->unmark(); + } + + diff --git a/recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch b/recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch new file mode 100644 index 0000000000000..de0f3ee7139ef --- /dev/null +++ b/recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch @@ -0,0 +1,75 @@ +diff --git a/src/osgPlugins/dae/ReaderWriterDAE.cpp b/src/osgPlugins/dae/ReaderWriterDAE.cpp +index fc1a448d4..3b883f19a 100644 +--- a/src/osgPlugins/dae/ReaderWriterDAE.cpp ++++ b/src/osgPlugins/dae/ReaderWriterDAE.cpp +@@ -32,7 +32,7 @@ + + #define SERIALIZER() OpenThreads::ScopedLock lock(_serializerMutex) + +-#if __cplusplus > 199711L ++#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L) + #define smart_ptr std::unique_ptr + #else + #define smart_ptr std::auto_ptr +diff --git a/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp b/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp +index 69826c456..9bba5532a 100644 +--- a/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp ++++ b/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp +@@ -10,6 +10,11 @@ + + #define STREAM_TIMEOUT_IN_SECONDS_TO_CONSIDER_IT_DEAD 10 + ++#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L) ++ template using smart_ptr = std::unique_ptr; ++#else ++ #define smart_ptr std::auto_ptr ++#endif + + namespace osgFFmpeg { + +@@ -23,8 +28,8 @@ FFmpegImageStream::FFmpegImageStream() : + { + setOrigin(osg::Image::TOP_LEFT); + +- std::auto_ptr decoder(new FFmpegDecoder); +- std::auto_ptr commands(new CommandQueue); ++ smart_ptr decoder(new FFmpegDecoder); ++ smart_ptr commands(new CommandQueue); + + m_decoder = decoder.release(); + m_commands = commands.release(); +diff --git a/src/osgPlugins/gdal/ReaderWriterGDAL.cpp b/src/osgPlugins/gdal/ReaderWriterGDAL.cpp +index 298e02fcc..113c9c45f 100644 +--- a/src/osgPlugins/gdal/ReaderWriterGDAL.cpp ++++ b/src/osgPlugins/gdal/ReaderWriterGDAL.cpp +@@ -34,6 +34,12 @@ + + #define SERIALIZER() OpenThreads::ScopedLock lock(_serializerMutex) + ++#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L) ++ #define smart_ptr std::unique_ptr ++#else ++ #define smart_ptr std::auto_ptr ++#endif ++ + // From easyrgb.com + float Hue_2_RGB( float v1, float v2, float vH ) + { +@@ -123,7 +129,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter + + initGDAL(); + +- std::auto_ptr dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); ++ smart_ptr dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); + if (!dataset.get()) return ReadResult::FILE_NOT_HANDLED; + + int dataWidth = dataset->GetRasterXSize(); +@@ -577,7 +583,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter + + initGDAL(); + +- std::auto_ptr dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); ++ smart_ptr dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); + if (!dataset.get()) return ReadResult::FILE_NOT_HANDLED; + + int dataWidth = dataset->GetRasterXSize(); diff --git a/recipes/openscenegraph/all/patches/0010-replace-ptr-fun-in-obj-plugin.patch b/recipes/openscenegraph/all/patches/0010-replace-ptr-fun-in-obj-plugin.patch new file mode 100644 index 0000000000000..139031361bc28 --- /dev/null +++ b/recipes/openscenegraph/all/patches/0010-replace-ptr-fun-in-obj-plugin.patch @@ -0,0 +1,24 @@ +diff --git a/src/osgPlugins/obj/obj.cpp b/src/osgPlugins/obj/obj.cpp +index 859add652..3580e5181 100644 +--- a/src/osgPlugins/obj/obj.cpp ++++ b/src/osgPlugins/obj/obj.cpp +@@ -37,10 +37,15 @@ using namespace obj; + + static std::string strip( const std::string& ss ) + { +- std::string result; +- result.assign( std::find_if( ss.begin(), ss.end(), std::not1( std::ptr_fun< int, int >( isspace ) ) ), +- std::find_if( ss.rbegin(), ss.rend(), std::not1( std::ptr_fun< int, int >( isspace ) ) ).base() ); +- return( result ); ++ std::string::const_iterator it = ss.begin(); ++ while (it != ss.end() && isspace(*it)) ++ it++; ++ ++ std::string::const_reverse_iterator rit = ss.rbegin(); ++ while (rit.base() != it && isspace(*rit)) ++ rit++; ++ ++ return std::string(it, rit.base()); + } + + /* diff --git a/recipes/openscenegraph/all/patches/0011-remove-deprecated-register.patch b/recipes/openscenegraph/all/patches/0011-remove-deprecated-register.patch new file mode 100644 index 0000000000000..9a1ea80d16a65 --- /dev/null +++ b/recipes/openscenegraph/all/patches/0011-remove-deprecated-register.patch @@ -0,0 +1,187 @@ +From b9f32bf6df5af101624bb065175097d8d96067c2 Mon Sep 17 00:00:00 2001 +From: czoido +Date: Thu, 25 Jan 2024 09:32:10 +0100 +Subject: [PATCH] remove deprecated register + +--- + src/osgPlugins/cfg/ConfigLexer.cpp | 40 ++++++++++++++--------------- + src/osgPlugins/cfg/ConfigParser.cpp | 16 ++++++------ + 2 files changed, 28 insertions(+), 28 deletions(-) + +diff --git a/src/osgPlugins/cfg/ConfigLexer.cpp b/src/osgPlugins/cfg/ConfigLexer.cpp +index 4e169efe4..cba6d6f9e 100644 +--- a/src/osgPlugins/cfg/ConfigLexer.cpp ++++ b/src/osgPlugins/cfg/ConfigLexer.cpp +@@ -832,9 +832,9 @@ YY_MALLOC_DECL + + YY_DECL + { +- register yy_state_type yy_current_state; +- register char *yy_cp, *yy_bp; +- register int yy_act; ++ yy_state_type yy_current_state; ++ char *yy_cp, *yy_bp; ++ int yy_act; + + #line 35 ".././ConfigLexer.l" + +@@ -881,7 +881,7 @@ YY_DECL + yy_match: + do + { +- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; ++ YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; +@@ -1598,9 +1598,9 @@ void yyFlexLexer::LexerOutput( const char* buf, int size ) + + int yyFlexLexer::yy_get_next_buffer() + { +- register char *dest = yy_current_buffer->yy_ch_buf; +- register char *source = yytext_ptr; +- register int number_to_move, i; ++ char *dest = yy_current_buffer->yy_ch_buf; ++ char *source = yytext_ptr; ++ int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) +@@ -1730,14 +1730,14 @@ int yyFlexLexer::yy_get_next_buffer() + + yy_state_type yyFlexLexer::yy_get_previous_state() + { +- register yy_state_type yy_current_state; +- register char *yy_cp; ++ yy_state_type yy_current_state; ++ char *yy_cp; + + yy_current_state = yy_start; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { +- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); ++ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; +@@ -1764,10 +1764,10 @@ yy_state_type yyFlexLexer::yy_get_previous_state() + + yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) + { +- register int yy_is_jam; +- register char *yy_cp = yy_c_buf_p; ++ int yy_is_jam; ++ char *yy_cp = yy_c_buf_p; + +- register YY_CHAR yy_c = 1; ++ YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; +@@ -1786,9 +1786,9 @@ yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) + } + + +-void yyFlexLexer::yyunput( int c, register char* yy_bp ) ++void yyFlexLexer::yyunput( int c, char* yy_bp ) + { +- register char *yy_cp = yy_c_buf_p; ++ char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; +@@ -1796,10 +1796,10 @@ void yyFlexLexer::yyunput( int c, register char* yy_bp ) + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ +- register int number_to_move = yy_n_chars + 2; +- register char *dest = &yy_current_buffer->yy_ch_buf[ ++ int number_to_move = yy_n_chars + 2; ++ char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; +- register char *source = ++ char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) +@@ -2119,7 +2119,7 @@ yyconst char *s2; + int n; + #endif + { +- register int i; ++ int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +@@ -2133,7 +2133,7 @@ static int yy_flex_strlen( s ) + yyconst char *s; + #endif + { +- register int n; ++ int n; + for ( n = 0; s[n]; ++n ) + ; + +diff --git a/src/osgPlugins/cfg/ConfigParser.cpp b/src/osgPlugins/cfg/ConfigParser.cpp +index 263c82896..62d30c3f5 100644 +--- a/src/osgPlugins/cfg/ConfigParser.cpp ++++ b/src/osgPlugins/cfg/ConfigParser.cpp +@@ -351,7 +351,7 @@ union yyalloc + # define YYCOPY(To, From, Count) \ + do \ + { \ +- register YYSIZE_T yyi; \ ++ YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ +@@ -1025,7 +1025,7 @@ yystrlen (yystr) + const char *yystr; + # endif + { +- register const char *yys = yystr; ++ const char *yys = yystr; + + while (*yys++ != '\0') + continue; +@@ -1050,8 +1050,8 @@ yystpcpy (yydest, yysrc) + const char *yysrc; + # endif + { +- register char *yyd = yydest; +- register const char *yys = yysrc; ++ char *yyd = yydest; ++ const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; +@@ -1175,8 +1175,8 @@ yyparse () + #endif + { + +- register int yystate; +- register int yyn; ++ int yystate; ++ int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; +@@ -1194,12 +1194,12 @@ yyparse () + /* The state stack. */ + short yyssa[YYINITDEPTH]; + short *yyss = yyssa; +- register short *yyssp; ++ short *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; +- register YYSTYPE *yyvsp; ++ YYSTYPE *yyvsp; + + + +-- +2.39.3 (Apple Git-145) + diff --git a/recipes/openscenegraph/all/test_package/CMakeLists.txt b/recipes/openscenegraph/all/test_package/CMakeLists.txt index c2aca0be1b70a..fcd48ccf6e39d 100644 --- a/recipes/openscenegraph/all/test_package/CMakeLists.txt +++ b/recipes/openscenegraph/all/test_package/CMakeLists.txt @@ -1,21 +1,58 @@ -cmake_minimum_required(VERSION 3.1.2) -project(test_package) - -include(${PROJECT_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -find_package(OpenSceneGraph REQUIRED) - -include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}) -link_libraries(${OPENSCENEGRAPH_LIBRARIES}) -add_compile_definitions(${OPENSCENEGRAPH_COMPILE_DEFINITIONS}) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) +find_package(OpenSceneGraph REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} OpenSceneGraph::OpenSceneGraph) -get_property(cache_variables DIRECTORY PROPERTY CACHE_VARIABLES) -foreach(cache_variable ${cache_variables}) - if("${cache_variable}" MATCHES "^OSG_HAS_(WITH_.+)$") - add_compile_definitions("${CMAKE_MATCH_1}=${${cache_variable}}") - endif() +get_directory_property(compile_definitions DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS) +foreach(compile_definition ${compile_definitions}) + if("${compile_definition}" MATCHES "(WITH_.+)=(1)$") + string(REPLACE "=" ";" definition_list ${compile_definition}) + list(GET definition_list 0 definition_key) + list(GET definition_list 1 definition_value) + message("Defined: ${definition_key}=${definition_value}") + if("${definition_key}" STREQUAL "WITH_BMP") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_bmp) + endif() + if("${definition_key}" STREQUAL "WITH_JPEG") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_jpeg) + endif() + if("${definition_key}" STREQUAL "WITH_JASPER") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_jp2) + endif() + if("${definition_key}" STREQUAL "WITH_OPENEXR") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_exr) + endif() + if("${definition_key}" STREQUAL "WITH_GIF") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_gif) + endif() + if("${definition_key}" STREQUAL "WITH_PNG") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_png) + endif() + if("${definition_key}" STREQUAL "WITH_TIFF") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_tiff) + endif() + if("${definition_key}" STREQUAL "WITH_GDAL") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_gdal) + endif() + if("${definition_key}" STREQUAL "WITH_GTA") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_gta) + endif() + if("${definition_key}" STREQUAL "WITH_DCMTK") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_dicom) + endif() + if("${definition_key}" STREQUAL "WITH_CURL") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_curl) + endif() + if("${definition_key}" STREQUAL "WITH_ZLIB") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_gz) + endif() + if("${definition_key}" STREQUAL "WITH_FREETYPE") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_freetype) + endif() + if("${definition_key}" STREQUAL "WITH_IMAGEIO") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_imageio) + endif() + endif() endforeach() - -add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/openscenegraph/all/test_package/conanfile.py b/recipes/openscenegraph/all/test_package/conanfile.py index 0e02c2d008408..b27efd09cb3f1 100644 --- a/recipes/openscenegraph/all/test_package/conanfile.py +++ b/recipes/openscenegraph/all/test_package/conanfile.py @@ -1,25 +1,43 @@ -from conans import CMake, ConanFile, tools +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" - def build(self): - cmake = CMake(self) - for key, value in self.options["openscenegraph"].items(): + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + for key, value in self.dependencies["openscenegraph"].options.items(): if key.startswith("with_"): - cmake.definitions["OSG_HAS_" + key.upper()] = 1 if value else 0 - if self.settings.os == "Macos": - cmake.definitions["OSG_HAS_WITH_GIF"] = 0 - cmake.definitions["OSG_HAS_WITH_JPEG"] = 0 - cmake.definitions["OSG_HAS_WITH_PNG"] = 0 + tc.preprocessor_definitions[key.upper()] = 1 if str(value) != "False" else 0 + #OSG always builds the bmp plugin + tc.preprocessor_definitions["WITH_BMP"] = 1 + if is_apple_os(self): + tc.preprocessor_definitions["WITH_GIF"] = 0 + tc.preprocessor_definitions["WITH_JPEG"] = 0 + tc.preprocessor_definitions["WITH_PNG"] = 0 + # OSG builds the imageio plugin on apple platforms + tc.preprocessor_definitions["WITH_IMAGEIO"] = 1 + tc.generate() + + 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) + 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/openscenegraph/all/test_package/test_package.cpp b/recipes/openscenegraph/all/test_package/test_package.cpp index d165af7b34733..c833eb8e3caee 100644 --- a/recipes/openscenegraph/all/test_package/test_package.cpp +++ b/recipes/openscenegraph/all/test_package/test_package.cpp @@ -4,14 +4,8 @@ #include #include -// OSG always builds the bmp plugin -#define WITH_BMP 1 - -// OSG builds the imageio plugin on apple platforms -#ifdef __APPLE__ -# define WITH_IMAGEIO 1 -#else -# define WITH_IMAGEIO 0 +#ifndef WITH_IMAGEIO +#define WITH_IMAGEIO 0 #endif #ifdef OSG_LIBRARY_STATIC diff --git a/recipes/openssh/all/conandata.yml b/recipes/openssh/all/conandata.yml new file mode 100644 index 0000000000000..e3ccaa5b6d5e6 --- /dev/null +++ b/recipes/openssh/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "9.6p1": + url: "https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.6p1.tar.gz" + sha256: "910211c07255a8c5ad654391b40ee59800710dd8119dd5362de09385aa7a777c" + "9.1p1": + url: "https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.1p1.tar.gz" + sha256: "19f85009c7e3e23787f0236fbb1578392ab4d4bf9f8ec5fe6bc1cd7e8bfdd288" diff --git a/recipes/openssh/all/conanfile.py b/recipes/openssh/all/conanfile.py new file mode 100644 index 0000000000000..193d5c2993c51 --- /dev/null +++ b/recipes/openssh/all/conanfile.py @@ -0,0 +1,141 @@ +from os.path import join + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, replace_in_file, rmdir, export_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.54.0" + + +class PackageConan(ConanFile): + name = "openssh" + description = "The OpenSSH (portable) suite of secure connectivity tools" + license = "SSH-OpenSSH" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.openssh.com/portable.html" + topics = ("security", "cryptography", "login", "keychain", "file-sharing", "ssh") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_libcrypto": [False, "libressl", "openssl"], + "with_pam": [False, "openpam"], # linux-pam and Solaris PAM are also supported + "with_selinux": [True, False], + "with_libedit": [True, False], + "with_strip": [True, False], + "with_sandbox": [False, "auto", "capsicum", "darwin", "rlimit", "seccomp_filter", "systrace", "pledge"] + } + default_options = { + "with_libcrypto": "openssl", + "with_pam": False, + "with_selinux": False, + "with_libedit": False, + "with_strip": True, + "with_sandbox": "auto" + } + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_libcrypto == "openssl": + self.requires("openssl/[>=1.1 <4]") + elif self.options.with_libcrypto == "libressl": + self.requires("libressl/3.9.1") + if self.options.with_pam == "openpam": + self.requires("openpam/20190224") + if self.options.with_libedit: + self.requires("editline/3.1") + + def validate(self): + if self.settings.os in ["baremetal", "Windows"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + if self.version in ["9.1p1", "9.6p1"]: + # Backport configure script fix to accept OpenSSL versions in the 3.x series + # See https://github.com/openssh/openssh-portable/commit/2eded551ba96e66bc3afbbcc883812c2eac02bd7 + replace_in_file(self, join(self.source_folder, "configure"), "300*", "30*") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + ad = AutotoolsDeps(self) + ad.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.append("--without-zlib-version-check") + + if not self.options.with_strip: + tc.configure_args.append("--disable-strip") + + if self.options.with_selinux: + tc.configure_args.append("--with-selinux") + + if self.options.with_pam: + tc.configure_args.append("--with-pam") + + if self.options.with_libedit: + editline = self.dependencies["editline"] + tc.configure_args.append("--with-libedit={}".format(editline.package_folder)) + + if self.options.with_libcrypto == "openssl": + openssl = self.dependencies["openssl"] + tc.configure_args.append("--with-ssl-dir={}".format(openssl.package_folder)) + # It needs libcrypto.so in build time context + if openssl.options.shared: + env = VirtualRunEnv(self) + env.generate(scope="build") + elif self.options.with_libcrypto == "libressl": + libressl = self.dependencies["libressl"] + tc.configure_args.append("--with-ssl-dir={}".format(libressl.package_folder)) + else: + tc.configure_args.append("--without-openssl") + + if self.options.with_sandbox != 'auto': + tc.configure_args.append("--with-sandbox={}".format(self.options.with_sandbox or "no")) + + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + + install_target = 'install-nokeys' if cross_building(self) else 'install' + autotools.install(target=install_target) + + copy(self, "LICENCE", src=self.source_folder, dst=join(self.package_folder, "licenses"), ignore_case=True) + copy(self, "*", src=join(self.package_folder, "libexec"), dst=join(self.package_folder, "bin"), ignore_case=True) + + rmdir(self, join(self.package_folder, "etc")) + rmdir(self, join(self.package_folder, "var")) + rmdir(self, join(self.package_folder, "share")) + rmdir(self, join(self.package_folder, "libexec")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + bindir = join(self.package_folder, "bin") + self.runenv_info.prepend_path("PATH", bindir) diff --git a/recipes/openssh/all/test_package/conanfile.py b/recipes/openssh/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6198df68dc282 --- /dev/null +++ b/recipes/openssh/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +from conan import ConanFile +from conan.tools.build import can_run + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + pass + + def test(self): + if can_run(self): + self.run("ssh -Q help", env="conanrun") diff --git a/recipes/openssh/config.yml b/recipes/openssh/config.yml new file mode 100644 index 0000000000000..a033c3a0343f3 --- /dev/null +++ b/recipes/openssh/config.yml @@ -0,0 +1,5 @@ +versions: + "9.6p1": + folder: all + "9.1p1": + folder: all diff --git a/recipes/openssl/1.x.x/conandata.yml b/recipes/openssl/1.x.x/conandata.yml index 22aae5e08d56c..26bc447884d03 100644 --- a/recipes/openssl/1.x.x/conandata.yml +++ b/recipes/openssl/1.x.x/conandata.yml @@ -1,10 +1,7 @@ sources: 1.1.1w: sha256: cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8 - url: - - "https://www.openssl.org/source/openssl-1.1.1w.tar.gz" - - "https://www.openssl.org/source/old/1.1.1/openssl-1.1.1w.tar.gz" - - "https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz" + url: "https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz" patches: 1.1.1w: - patch_file: patches/1.1.1-tvos-watchos.patch diff --git a/recipes/openssl/1.x.x/conanfile.py b/recipes/openssl/1.x.x/conanfile.py index 073a01dcd3cdc..424f65ac487e9 100644 --- a/recipes/openssl/1.x.x/conanfile.py +++ b/recipes/openssl/1.x.x/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.env import Environment, VirtualBuildEnv from conan.tools.files import ( apply_conandata_patches, chdir, copy, export_conandata_patches, - get, load, rename, replace_in_file, rm, rmdir, save + get, load, replace_in_file, rm, rmdir, save ) from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps from conan.tools.layout import basic_layout @@ -144,7 +144,7 @@ def validate(self): def build_requirements(self): if self._settings_build.os == "Windows": if not self.options.no_asm: - self.tool_requires("nasm/2.15.05") + self.tool_requires("nasm/2.16.01") if self._use_nmake: self.tool_requires("strawberryperl/5.32.1.1") else: @@ -539,10 +539,6 @@ def package(self): with chdir(self, self.source_folder): self.run(f"nmake -f Makefile install_sw DESTDIR={self.package_folder}") rm(self, "*.pdb", self.package_folder, recursive=True) - if self.settings.build_type == "Debug": - with chdir(self, os.path.join(self.package_folder, "lib")): - rename(self, "libssl.lib", "libssld.lib") - rename(self, "libcrypto.lib", "libcryptod.lib") else: autotools = Autotools(self) with chdir(self, self.source_folder): @@ -619,9 +615,8 @@ def package_info(self): self.cpp_info.components["ssl"].set_property("cmake_target_name", "OpenSSL::SSL") self.cpp_info.components["ssl"].set_property("pkg_config_name", "libssl") if self._use_nmake: - libsuffix = "d" if self.settings.build_type == "Debug" else "" - self.cpp_info.components["ssl"].libs = ["libssl" + libsuffix] - self.cpp_info.components["crypto"].libs = ["libcrypto" + libsuffix] + self.cpp_info.components["ssl"].libs = ["libssl"] + self.cpp_info.components["crypto"].libs = ["libcrypto"] else: self.cpp_info.components["ssl"].libs = ["ssl"] self.cpp_info.components["crypto"].libs = ["crypto"] diff --git a/recipes/openssl/3.x.x/conandata.yml b/recipes/openssl/3.x.x/conandata.yml index f693517720dd4..0e6fcf58a8a23 100644 --- a/recipes/openssl/3.x.x/conandata.yml +++ b/recipes/openssl/3.x.x/conandata.yml @@ -1,42 +1,19 @@ sources: + 3.2.2: + url: "https://github.com/openssl/openssl/releases/download/openssl-3.2.2/openssl-3.2.2.tar.gz" + sha256: 197149c18d9e9f292c43f0400acaba12e5f52cacfe050f3d199277ea738ec2e7 3.2.1: - url: - - "https://www.openssl.org/source/openssl-3.2.1.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.2.1/openssl-3.2.1.tar.gz" + url: "https://github.com/openssl/openssl/releases/download/openssl-3.2.1/openssl-3.2.1.tar.gz" sha256: 83c7329fe52c850677d75e5d0b0ca245309b97e8ecbcfdc1dfdc4ab9fac35b39 - 3.2.0: - url: - - "https://www.openssl.org/source/openssl-3.2.0.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.2.0/openssl-3.2.0.tar.gz" - sha256: 14c826f07c7e433706fb5c69fa9e25dab95684844b4c962a2cf1bf183eb4690e + 3.1.6: + url: "https://github.com/openssl/openssl/releases/download/openssl-3.1.6/openssl-3.1.6.tar.gz" + sha256: 5d2be4036b478ef3cb0a854ca9b353072c3a0e26d8a56f8f0ab9fb6ed32d38d7 3.1.5: - url: - - "https://www.openssl.org/source/openssl-3.1.5.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.1.5/openssl-3.1.5.tar.gz" + url: "https://github.com/openssl/openssl/releases/download/openssl-3.1.5/openssl-3.1.5.tar.gz" sha256: 6ae015467dabf0469b139ada93319327be24b98251ffaeceda0221848dc09262 - 3.1.4: - url: - - "https://www.openssl.org/source/openssl-3.1.4.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.1.4/openssl-3.1.4.tar.gz" - sha256: 840af5366ab9b522bde525826be3ef0fb0af81c6a9ebd84caa600fea1731eee3 - 3.1.3: - url: - - "https://www.openssl.org/source/openssl-3.1.3.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.1.3/openssl-3.1.3.tar.gz" - sha256: f0316a2ebd89e7f2352976445458689f80302093788c466692fb2a188b2eacf6 + 3.0.14: + url: "https://github.com/openssl/openssl/releases/download/openssl-3.0.14/openssl-3.0.14.tar.gz" + sha256: eeca035d4dd4e84fc25846d952da6297484afa0650a6f84c682e39df3a4123ca 3.0.13: - url: - - "https://www.openssl.org/source/openssl-3.0.13.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.0.13/openssl-3.0.13.tar.gz" + url: "https://github.com/openssl/openssl/releases/download/openssl-3.0.13/openssl-3.0.13.tar.gz" sha256: 88525753f79d3bec27d2fa7c66aa0b92b3aa9498dafd93d7cfa4b3780cdae313 - 3.0.12: - url: - - "https://www.openssl.org/source/openssl-3.0.12.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.0.12/openssl-3.0.12.tar.gz" - sha256: f93c9e8edde5e9166119de31755fc87b4aa34863662f67ddfcba14d0b6b69b61 -patches: - 3.2.0: - - patch_file: "patches/3.2.0-fix-winsock2.patch" - patch_description: "Only include winsock2.h for struct timeval if needed" - patch_type: "bugfix" - patch_source: "https://github.com/openssl/openssl/commit/ba58e9f1e22dd9ee2e37078640dcbe9f520a555d" diff --git a/recipes/openssl/3.x.x/conanfile.py b/recipes/openssl/3.x.x/conanfile.py index 975619cd1b911..6b88374a14b20 100644 --- a/recipes/openssl/3.x.x/conanfile.py +++ b/recipes/openssl/3.x.x/conanfile.py @@ -2,11 +2,10 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name, is_apple_os, XCRun from conan.tools.build import build_jobs -from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rename, replace_in_file, rmdir, save +from conan.tools.files import chdir, copy, get, replace_in_file, rm, rmdir, save from conan.tools.gnu import AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path -from conan.tools.scm import Version import fnmatch import os @@ -131,9 +130,6 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") - def export_sources(self): - export_conandata_patches(self) - def layout(self): basic_layout(self, src_folder="src") @@ -152,7 +148,7 @@ def validate(self): def build_requirements(self): if self._settings_build.os == "Windows": if not self.options.no_asm: - self.tool_requires("nasm/2.15.05") + self.tool_requires("nasm/2.16.01") if self._use_nmake: self.tool_requires("strawberryperl/5.32.1.1") else: @@ -358,20 +354,20 @@ def _configure_args(self): openssldir = self.options.openssldir or self._get_default_openssl_dir() openssldir = unix_path(self, openssldir) if self.win_bash else openssldir args = [ - '"%s"' % (self._target), + f'"{self._target}"', "shared" if self.options.shared else "no-shared", + "--debug" if self.settings.build_type == "Debug" else "--release", "--prefix=/", "--libdir=lib", - "--openssldir=\"%s\"" % openssldir, - "no-unit-test", + f"--openssldir=\"{openssldir}\"", "no-threads" if self.options.no_threads else "threads", - "PERL=%s" % self._perl, + f"PERL={self._perl}", + "no-unit-test", "no-tests", - "--debug" if self.settings.build_type == "Debug" else "--release", ] if self.settings.os == "Android": - args.append(" -D__ANDROID_API__=%s" % str(self.settings.os.api_level)) # see NOTES.ANDROID + args.append(f" -D__ANDROID_API__={str(self.settings.os.api_level)}") # see NOTES.ANDROID if self.settings.os == "Emscripten": args.append("-D__STDC_NO_ATOMICS__=1") if self.settings.os == "Windows": @@ -449,22 +445,22 @@ def _create_targets(self, cflags, cxxflags, defines, ldflags): perlasm_scheme = "" if self._perlasm_scheme: - perlasm_scheme = 'perlasm_scheme => "%s",' % self._perlasm_scheme + perlasm_scheme = f'perlasm_scheme => "{self._perlasm_scheme}",' - defines = " ".join(defines) + defines = '", "'.join(defines) defines = 'defines => add("%s"),' % defines if defines else "" targets = "my %targets" if self._asm_target: - ancestor = '[ "%s", asm("%s") ]' % (self._ancestor_target, self._asm_target) + ancestor = f'[ "{self._ancestor_target}", asm("{self._asm_target}") ]' else: - ancestor = '[ "%s" ]' % self._ancestor_target + ancestor = f'[ "{self._ancestor_target}" ]' shared_cflag = "" shared_extension = "" shared_target = "" if self.settings.os == "Neutrino": if self.options.shared: - shared_extension = 'shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",' + shared_extension = r'shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",' shared_target = 'shared_target => "gnu-shared",' if self.options.get_safe("fPIC", True): shared_cflag = 'shared_cflag => "-fPIC",' @@ -486,7 +482,7 @@ def _create_targets(self, cflags, cxxflags, defines, ldflags): shared_cflag=shared_cflag, lflags=" ".join(ldflags) ) - self.output.info("using target: %s -> %s" % (self._target, self._ancestor_target)) + self.output.info(f"using target: {self._target} -> {self._ancestor_target}") self.output.info(config) save(self, os.path.join(self.source_folder, "Configurations", "20-conan.conf"), config) @@ -498,7 +494,7 @@ def _run_make(self, targets=None, parallel=True, install=False): if targets: command.extend(targets) if not self._use_nmake: - command.append(("-j%s" % build_jobs(self)) if parallel else "-j1") + command.append(f"-j{build_jobs(self)}" if parallel else "-j1") self.run(" ".join(command), env="conanbuild") @property @@ -509,15 +505,12 @@ def _perl(self): def _make(self): with chdir(self, self.source_folder): - # workaround for clang-cl not producing .pdb files - if self._is_clang_cl: - save(self, "ossl_static.pdb", "") args = " ".join(self._configure_args) if self._use_nmake: self._replace_runtime_in_file(os.path.join("Configurations", "10-main.conf")) - self.run("{perl} ./Configure {args}".format(perl=self._perl, args=args), env="conanbuild") + self.run(f"{self._perl} ./Configure {args}", env="conanbuild") if self._use_nmake: # When `--prefix=/`, the scripts derive `\` without escaping, which # causes issues on Windows @@ -529,7 +522,6 @@ def _make_install(self): self._run_make(targets=["install_sw"], parallel=False, install=True) def build(self): - apply_conandata_patches(self) self._make() configdata_pm = self._adjust_path(os.path.join(self.source_folder, "configdata.pm")) self.run(f"{self._perl} {configdata_pm} --dump") @@ -550,16 +542,7 @@ def package(self): if is_apple_os(self): fix_apple_shared_install_name(self) - for root, _, files in os.walk(self.package_folder): - for filename in files: - if fnmatch.fnmatch(filename, "*.pdb"): - os.unlink(os.path.join(self.package_folder, root, filename)) - if self._use_nmake: - if self.settings.build_type == "Debug": - with chdir(self, os.path.join(self.package_folder, "lib")): - rename(self, "libssl.lib", "libssld.lib") - rename(self, "libcrypto.lib", "libcryptod.lib") - + rm(self, "*.pdb", self.package_folder, "lib") if self.options.shared: libdir = os.path.join(self.package_folder, "lib") for file in os.listdir(libdir): @@ -579,6 +562,7 @@ def package(self): copy(self, "fips.so", src=provdir, dst=modules_dir) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) self._create_cmake_module_variables( os.path.join(self.package_folder, self._module_file_rel_path) @@ -632,7 +616,7 @@ def _module_subfolder(self): @property def _module_file_rel_path(self): return os.path.join(self._module_subfolder, - "conan-official-{}-variables.cmake".format(self.name)) + f"conan-official-{self.name}-variables.cmake") def package_info(self): self.cpp_info.set_property("cmake_file_name", "OpenSSL") @@ -649,9 +633,8 @@ def package_info(self): self.cpp_info.components["crypto"].set_property("cmake_build_modules", [self._module_file_rel_path]) if self._use_nmake: - libsuffix = "d" if self.settings.build_type == "Debug" else "" - self.cpp_info.components["ssl"].libs = ["libssl" + libsuffix] - self.cpp_info.components["crypto"].libs = ["libcrypto" + libsuffix] + self.cpp_info.components["ssl"].libs = ["libssl"] + self.cpp_info.components["crypto"].libs = ["libcrypto"] else: self.cpp_info.components["ssl"].libs = ["ssl"] self.cpp_info.components["crypto"].libs = ["crypto"] diff --git a/recipes/openssl/3.x.x/patches/3.2.0-fix-winsock2.patch b/recipes/openssl/3.x.x/patches/3.2.0-fix-winsock2.patch deleted file mode 100644 index 6e91678b02dd7..0000000000000 --- a/recipes/openssl/3.x.x/patches/3.2.0-fix-winsock2.patch +++ /dev/null @@ -1,36 +0,0 @@ -From ba58e9f1e22dd9ee2e37078640dcbe9f520a555d Mon Sep 17 00:00:00 2001 -From: Hugo Landau -Date: Fri, 24 Nov 2023 10:03:30 +0000 -Subject: [PATCH] Only include winsock2.h for struct timeval if needed - -Fixes #22811 - -Reviewed-by: Tomas Mraz -Reviewed-by: Matt Caswell -Reviewed-by: Matthias St. Pierre -(Merged from https://github.com/openssl/openssl/pull/22813) ---- - include/openssl/e_ostime.h | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/include/openssl/e_ostime.h b/include/openssl/e_ostime.h -index 8a7cc9880fa79..0e17487504992 100644 ---- a/include/openssl/e_ostime.h -+++ b/include/openssl/e_ostime.h -@@ -22,7 +22,15 @@ - */ - - # if defined(OPENSSL_SYS_WINDOWS) --# include -+# if !defined(_WINSOCKAPI_) -+ /* -+ * winsock2.h defines _WINSOCK2API_ and both winsock2.h and winsock.h define -+ * _WINSOCKAPI_. Both of these provide struct timeval. Don't include -+ * winsock2.h if either header has been included to avoid breakage with -+ * applications that prefer to use over . -+ */ -+# include -+# endif - # else - # include - # endif diff --git a/recipes/openssl/config.yml b/recipes/openssl/config.yml index 25589dc6caa23..1ab48b68f1e65 100644 --- a/recipes/openssl/config.yml +++ b/recipes/openssl/config.yml @@ -1,21 +1,15 @@ versions: - # 3.2.x releases - 3.2.1: + "3.2.2": folder: "3.x.x" - 3.2.0: + "3.2.1": folder: "3.x.x" - # 3.1.x releases - 3.1.5: + "3.1.6": folder: "3.x.x" - 3.1.4: + "3.1.5": folder: "3.x.x" - 3.1.3: + "3.0.14": folder: "3.x.x" - # 3.0.x releases - 3.0.13: + "3.0.13": folder: "3.x.x" - 3.0.12: - folder: "3.x.x" - # 1.1.1x releases - 1.1.1w: + "1.1.1w": folder: "1.x.x" diff --git a/recipes/opentelemetry-cpp/all/conandata.yml b/recipes/opentelemetry-cpp/all/conandata.yml index f30d3731760b0..ce31f611ba274 100644 --- a/recipes/opentelemetry-cpp/all/conandata.yml +++ b/recipes/opentelemetry-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.14.2": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.14.2.tar.gz" + sha256: "c7e7801c9f6228751cdb9dd4724d0f04777ed53f524c8828e73bf4c9f894e0bd" "1.12.0": url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.12.0.tar.gz" sha256: "09c208a21fb1159d114a3ea15dc1bcc5dee28eb39907ba72a6012d2c7b7564a0" diff --git a/recipes/opentelemetry-cpp/all/conanfile.py b/recipes/opentelemetry-cpp/all/conanfile.py index f96b644388da0..60940dcfcab3b 100644 --- a/recipes/opentelemetry-cpp/all/conanfile.py +++ b/recipes/opentelemetry-cpp/all/conanfile.py @@ -92,6 +92,8 @@ def config_options(self): self.options.rm_safe("fPIC") if Version(self.version) >= "1.10": del self.options.with_jaeger + if Version(self.version) >= "1.11": + del self.options.with_logs_preview def configure(self): if self.options.shared: @@ -110,8 +112,10 @@ def requirements(self): if self.options.with_abseil: self.requires("abseil/20230125.3", transitive_headers=True) - if self.options.with_otlp_grpc: + if self.options.with_otlp_grpc or self.options.with_otlp_http: self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True) + + if self.options.with_otlp_grpc: self.requires("grpc/1.54.3", transitive_headers=True, transitive_libs=True) if (self.options.with_zipkin or @@ -170,9 +174,11 @@ def validate(self): raise ConanInvalidConfiguration("opentelemetry-cpp >= 1.12.0 does not support Apple Clang on Conan v1") def build_requirements(self): - if self.options.with_otlp_grpc: - self.tool_requires("opentelemetry-proto/1.0.0") + if self.options.with_otlp_grpc or self.options.with_otlp_http: + self.tool_requires("opentelemetry-proto/1.2.0") self.tool_requires("protobuf/") + + if self.options.with_otlp_grpc: self.tool_requires("grpc/") def _create_cmake_module_variables(self, module_file): @@ -216,7 +222,8 @@ def generate(self): tc.cache_variables["WITH_JAEGER"] = self.options.get_safe("with_jaeger", False) tc.cache_variables["WITH_NO_GETENV"] = self.options.with_no_getenv tc.cache_variables["WITH_ETW"] = self.options.with_etw - tc.cache_variables["WITH_LOGS_PREVIEW"] = self.options.with_logs_preview + if Version(self.version) < "1.11": + tc.cache_variables["WITH_LOGS_PREVIEW"] = self.options.with_logs_preview tc.cache_variables["WITH_ASYNC_EXPORT_PREVIEW"] = self.options.with_async_export_preview tc.cache_variables["WITH_METRICS_EXEMPLAR_PREVIEW"] = self.options.with_metrics_exemplar_preview tc.cache_variables["OPENTELEMETRY_INSTALL"] = True @@ -286,6 +293,7 @@ def _otel_libraries(self): "opentelemetry_trace", "opentelemetry_version", ] + if self.options.with_otlp_http or self.options.with_elasticsearch or self.options.get_safe("with_jaeger") or self.options.with_zipkin: # https://github.com/open-telemetry/opentelemetry-cpp/blob/v1.12.0/CMakeLists.txt#L452-L460 libraries.append(self._http_client_name) @@ -298,17 +306,17 @@ def _otel_libraries(self): libraries.append("opentelemetry_exporter_otlp_grpc") libraries.append("opentelemetry_exporter_otlp_grpc_metrics") libraries.append("opentelemetry_exporter_otlp_grpc_client") - if self.options.with_logs_preview: + if Version(self.version) >= "1.11" or self.options.with_logs_preview: libraries.append("opentelemetry_exporter_otlp_grpc_log") if self.options.with_otlp_http: libraries.append("opentelemetry_exporter_otlp_http") libraries.append("opentelemetry_exporter_otlp_http_client") libraries.append("opentelemetry_exporter_otlp_http_metric") - if self.options.with_logs_preview: + if Version(self.version) >= "1.11" or self.options.with_logs_preview: libraries.append("opentelemetry_exporter_otlp_http_log") if self.options.with_prometheus: libraries.append("opentelemetry_exporter_prometheus") - if self.options.with_elasticsearch and self.options.with_logs_preview: + if self.options.with_elasticsearch and (Version(self.version) >= "1.11" or self.options.with_logs_preview): libraries.append("opentelemetry_exporter_elasticsearch_logs") if self.options.with_zipkin: libraries.append("opentelemetry_exporter_zipkin_trace") @@ -316,7 +324,7 @@ def _otel_libraries(self): libraries.append("opentelemetry_exporter_jaeger_trace") libraries.append("opentelemetry_metrics") libraries.append("opentelemetry_exporter_ostream_metrics") - if self.options.with_logs_preview: + if Version(self.version) >= "1.11" or self.options.with_logs_preview: libraries.extend([ "opentelemetry_logs", "opentelemetry_exporter_ostream_logs", @@ -347,7 +355,7 @@ def package_info(self): self.cpp_info.components["opentelemetry_exporter_in_memory"].libs = [] - if self.options.with_logs_preview: + if Version(self.version) >= "1.11" or self.options.with_logs_preview: self.cpp_info.components["opentelemetry_logs"].requires.extend([ "opentelemetry_resources", "opentelemetry_common", @@ -379,6 +387,11 @@ def package_info(self): "opentelemetry_trace", ]) + if Version(self.version) >= "1.11": + self.cpp_info.components["opentelemetry_otlp_recordable"].requires.extend([ + "opentelemetry_logs", + ]) + if self.options.with_otlp_grpc: self.cpp_info.components["opentelemetry_exporter_otlp_grpc_client"].requires.extend([ "grpc::grpc++", @@ -395,7 +408,7 @@ def package_info(self): "opentelemetry_exporter_otlp_grpc_client" ]) - if self.options.with_logs_preview: + if Version(self.version) >= "1.11" or self.options.with_logs_preview: self.cpp_info.components["opentelemetry_exporter_otlp_grpc_log"].requires.extend([ "opentelemetry_otlp_recordable", "opentelemetry_exporter_otlp_grpc_client", @@ -425,7 +438,7 @@ def package_info(self): "opentelemetry_exporter_otlp_http_client" ]) - if self.options.with_logs_preview: + if Version(self.version) >= "1.11" or self.options.with_logs_preview: self.cpp_info.components["opentelemetry_exporter_otlp_http_log"].requires.extend([ "opentelemetry_otlp_recordable", "opentelemetry_exporter_otlp_http_client", diff --git a/recipes/opentelemetry-cpp/config.yml b/recipes/opentelemetry-cpp/config.yml index a678af123ada5..2d959457e4aec 100644 --- a/recipes/opentelemetry-cpp/config.yml +++ b/recipes/opentelemetry-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.14.2": + folder: all "1.12.0": folder: all "1.9.1": diff --git a/recipes/opentelemetry-proto/all/conandata.yml b/recipes/opentelemetry-proto/all/conandata.yml index 818f6d6956d04..043fc48fd9594 100644 --- a/recipes/opentelemetry-proto/all/conandata.yml +++ b/recipes/opentelemetry-proto/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.3.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.3.0.tar.gz" + sha256: "73a678b0ff7a29b581381566a2230fe2a00b864608786c99c050a4492e2bbafc" + "1.2.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.2.0.tar.gz" + sha256: "516dc94685dbaa14fb792788f31d2ef2b0c3ad08dfa8a9a8164e3cf60c1ab6f7" "1.1.0": url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.1.0.tar.gz" sha256: "df491a05f3fcbf86cc5ba5c9de81f6a624d74d4773d7009d573e37d6e2b6af64" diff --git a/recipes/opentelemetry-proto/config.yml b/recipes/opentelemetry-proto/config.yml index 471fe8eea644f..b7acdadec16ea 100644 --- a/recipes/opentelemetry-proto/config.yml +++ b/recipes/opentelemetry-proto/config.yml @@ -1,4 +1,8 @@ versions: + "1.3.0": + folder: all + "1.2.0": + folder: all "1.1.0": folder: all "1.0.0": diff --git a/recipes/openvdb/all/CMakeLists.txt b/recipes/openvdb/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- a/recipes/openvdb/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/openvdb/all/conandata.yml b/recipes/openvdb/all/conandata.yml index 902318df1e3ae..35817586160ea 100644 --- a/recipes/openvdb/all/conandata.yml +++ b/recipes/openvdb/all/conandata.yml @@ -1,8 +1,10 @@ sources: - "8.0.1": - url: "https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v8.0.1.tar.gz" - sha256: "a6845da7c604d2c72e4141c898930ac8a2375521e535f696c2cd92bebbe43c4f" -patches: - "8.0.1": - - patch_file: "patches/0001-Find-packages-fixes.patch" - base_path: "source_subfolder" + "11.0.0": + url: "https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v11.0.0.tar.gz" + sha256: "6314ff1db057ea90050763e7b7d7ed86d8224fcd42a82cdbb9c515e001b96c74" + "10.1.0": + url: "https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v10.1.0.tar.gz" + sha256: "2746236e29659a0d35ab90d832f7c7987dd2537587a1a2f9237d9c98afcd5817" + "9.1.0": + url: "https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v9.1.0.tar.gz" + sha256: "914ee417b4607c75c95b53bc73a0599de4157c7d6a32e849e80f24e40fb64181" diff --git a/recipes/openvdb/all/conanfile.py b/recipes/openvdb/all/conanfile.py index 10e73dc4150e4..5f385526168c2 100644 --- a/recipes/openvdb/all/conanfile.py +++ b/recipes/openvdb/all/conanfile.py @@ -1,11 +1,16 @@ -from conan.tools.microsoft import is_msvc -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools import os +import re + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rm, replace_in_file +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version - -required_conan_version = ">=1.45.0" +required_conan_version = ">=1.53.0" class OpenVDBConan(ConanFile): @@ -16,232 +21,281 @@ class OpenVDBConan(ConanFile): "manipulation of sparse volumetric data discretized on three-dimensional grids." ) license = "MPL-2.0" - topics = ("voxel", "voxelizer", "volume-rendering", "fx") - homepage = "https://github.com/AcademySoftwareFoundation/openvdb" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AcademySoftwareFoundation/openvdb" + topics = ("voxel", "voxelizer", "volume-rendering", "fx", "vdb") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], + "build_ax": [True, False], + "simd": [None, "SSE42", "AVX"], + "use_colored_output": [True, False], + "use_delayed_loading": [True, False], + "use_explicit_instantiation": [True, False], + "use_imath_half": [True, False], "with_blosc": [True, False], - "with_zlib": [True, False], + # Deprecated because EXR is only used when building executables, which the recipe does not support + "with_exr": ["deprecated", True, False], "with_log4cplus": [True, False], - "with_exr": [True, False], - "simd": [None, "SSE42", "AVX"], + "with_zlib": [True, False], } default_options = { "shared": False, "fPIC": True, + "build_ax": False, + "simd": None, + "use_colored_output": False, + "use_delayed_loading": False, + "use_explicit_instantiation": False, + "use_imath_half": True, "with_blosc": True, + "with_exr": "deprecated", + "with_log4cplus": False, # Disabled by default because it is not compatible with C++17 "with_zlib": True, - "with_log4cplus": False, - "with_exr": False, - "simd": None, } - - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" + options_description = { + "build_ax": "Build the OpenVDB AX library.", + "simd": ( + "Choose whether to enable SIMD compiler flags or not. " + "Although not required, it is strongly recommended to enable SIMD. AVX implies SSE42." + ), + "use_colored_output": "Always produce ANSI-colored output (GNU/Clang only).", + "use_delayed_loading": "Build the core OpenVDB library with delayed-loading.", + "use_explicit_instantiation": ( + "Use explicit instantiation for all supported classes and methods against a pre-defined " + "list of OpenVDB trees. This makes the core library larger and slower to compile, but speeds up " + "the compilation of all dependent code by bypassing the expensive template instantiation. " + "Disabled by default in ConanCenter to avoid excessive memory usage during compilation." + ), + "use_imath_half": ( + "Use the definition of half-precision floating point types from the Imath library. " + "If False, the embedded definition provided by OpenVDB is used. " + "You may set this to on to force Imath half to be used if you know it to be required." + ), + "with_blosc": "Use Blosc for improved disk compression. Recommended.", + "with_log4cplus": "Use log4cplus for improved OpenVDB Logging.", + "with_zlib": "Use ZLib for disk serialization compression. ZLib can only be disabled if Blosc is also disabled.", + } @property - def _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return 17 if Version(self.version) >= "10.0.0" else 14 @property def _compilers_min_version(self): - return { - "msvc": "191", - "Visual Studio": "15", # Should we check toolset? - "gcc": "6.3.1", - "clang": "3.8", - "apple-clang": "3.8", - "intel": "17", - } - - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + if Version(self.version) >= "10.0.0": + # https://github.com/AcademySoftwareFoundation/openvdb/blob/v10.0.1/doc/dependencies.txt#L56-L84 + return { + "msvc": "192.8", + "Visual Studio": "16", + "gcc": "9.3.1", + "clang": "5.0", + "apple-clang": "12.0", + "intel-cc": "19", + } + else: + # https://github.com/AcademySoftwareFoundation/openvdb/blob/v9.1.0/doc/dependencies.txt#L56-L84 + return { + "msvc": "191.0", + "Visual Studio": "15", + "gcc": "6.3.1", + "clang": "3.8", + "apple-clang": "10.0", + "intel-cc": "17", + } def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if is_msvc(self): + # Supported by GCC and Clang only + del self.options.use_colored_output + if Version(self.version) < "10.0.0": + del self.options.use_explicit_instantiation + del self.options.use_delayed_loading def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + # with_exr is deprecated and has no effect + del self.info.options.with_exr def requirements(self): - self.requires("boost/1.79.0") - self.requires("onetbb/2020.3") - self.requires("openexr/2.5.7") # required for IlmBase::Half + # https://github.com/AcademySoftwareFoundation/openvdb/blob/v10.0.1/doc/dependencies.txt#L36-L84 + self.requires("boost/1.84.0", transitive_headers=True) + self.requires("onetbb/2021.10.0", transitive_headers=True, transitive_libs=True) + if self.options.use_imath_half: + self.requires("imath/3.1.9", transitive_headers=True, transitive_libs=True) if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") - if self.options.with_exr: - # Not necessary now. Required for IlmBase::IlmImf - self.requires("openexr/2.5.7") if self.options.with_blosc: - self.requires("c-blosc/1.21.1") + self.requires("c-blosc/1.21.5") if self.options.with_log4cplus: - self.requires("log4cplus/2.0.7") + # log4cplus 2.x is not supported + self.requires("log4cplus/1.2.2", transitive_headers=True) - def _check_compilier_version(self): + def _check_compiler_version(self): compiler = str(self.settings.compiler) - version = tools.Version(self.settings.compiler.version) minimum_version = self._compilers_min_version.get(compiler, False) - if minimum_version and version < minimum_version: - raise ConanInvalidConfiguration(f"{self.name} requires a {compiler} version greater than {minimum_version}") + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.name} requires a {compiler} version greater than {minimum_version}" + ) def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 14) + check_min_cppstd(self, self._min_cppstd) if self.settings.arch not in ("x86", "x86_64"): if self.options.simd: raise ConanInvalidConfiguration("Only intel architectures support SSE4 or AVX.") - self._check_compilier_version() + self._check_compiler_version() + if self.options.with_exr != "deprecated": + self.output.warning("with_exr option is deprecated, do not use anymore.") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if Version(self.version) >= "10.0.0": + self.tool_requires("cmake/[>=3.18 <4]") + if self.options.build_ax: + if self._settings_build.os == "Windows": + self.tool_requires("winflexbison/2.5.25") + else: + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + tc.variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.shared + tc.variables["OPENVDB_BUILD_AX"] = self.options.build_ax + tc.variables["OPENVDB_BUILD_BINARIES"] = False + tc.variables["OPENVDB_BUILD_CORE"] = True + tc.variables["OPENVDB_BUILD_DOCS"] = False + tc.variables["OPENVDB_BUILD_HOUDINI_ABITESTS"] = False + tc.variables["OPENVDB_BUILD_HOUDINI_PLUGIN"] = False + tc.variables["OPENVDB_BUILD_MAYA_PLUGIN"] = False + tc.variables["OPENVDB_BUILD_NANOVDB"] = False # nanovdb should be packaged separately in CCI + tc.variables["OPENVDB_BUILD_PYTHON_MODULE"] = False + tc.variables["OPENVDB_CORE_SHARED"] = self.options.shared + tc.variables["OPENVDB_CORE_STATIC"] = not self.options.shared + tc.variables["OPENVDB_CXX_STRICT"] = False + tc.variables["OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING"] = True + tc.variables["OPENVDB_ENABLE_RPATH"] = True + tc.variables["OPENVDB_ENABLE_UNINSTALL"] = False + tc.variables["OPENVDB_FUTURE_DEPRECATION"] = True + tc.variables["OPENVDB_INSTALL_CMAKE_MODULES"] = False + tc.variables["OPENVDB_SIMD"] = self.options.simd + tc.variables["OPENVDB_USE_DELAYED_LOADING"] = self.options.get_safe("use_delayed_loading", False) + tc.variables["USE_AX"] = False # used only by Python bindings and the Houdini plugin + tc.variables["USE_BLOSC"] = self.options.with_blosc + tc.variables["USE_COLORED_OUTPUT"] = self.options.get_safe("use_colored_output", False) + tc.variables["USE_EXPLICIT_INSTANTIATION"] = self.options.get_safe("use_explicit_instantiation", False) + tc.variables["USE_EXR"] = False + tc.variables["USE_HOUDINI"] = False + tc.variables["USE_IMATH_HALF"] = self.options.get_safe("use_imath_half", False) + tc.variables["USE_LOG4CPLUS"] = self.options.with_log4cplus + tc.variables["USE_MAYA"] = False + tc.variables["USE_NANOVDB"] = False + tc.variables["USE_PKGCONFIG"] = False + tc.variables["USE_PNG"] = False + tc.variables["USE_STATIC_DEPENDENCIES"] = False + tc.variables["USE_TBB"] = True # Only affects the nanovdb component + tc.variables["USE_ZLIB"] = self.options.with_zlib + tc.generate() + + tc = CMakeDeps(self) + tc.set_property("c-blosc", "cmake_file_name", "Blosc") + tc.set_property("c-blosc", "cmake_target_name", "Blosc::blosc") + tc.set_property("openexr", "cmake_file_name", "IlmBase") + tc.set_property("openexr::ilmbase_half", "cmake_target_name", "IlmBase::Half") + tc.set_property("log4cplus", "cmake_target_name", "Log4cplus::log4cplus") + tc.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) # Remove FindXXX files from OpenVDB. Let Conan do the job - tools.remove_files_by_mask(os.path.join(self._source_subfolder, "cmake"), "Find*") - with open("FindBlosc.cmake", "w") as f: - f.write( - """find_package(c-blosc) -if(c-blosc_FOUND) - add_library(blosc INTERFACE) - target_link_libraries(blosc INTERFACE c-blosc::c-blosc) - add_library(Blosc::blosc ALIAS blosc) -endif() -""" - ) - with open("FindIlmBase.cmake", "w") as f: - f.write( - """find_package(OpenEXR) -if(OpenEXR_FOUND) - add_library(Half INTERFACE) - add_library(IlmThread INTERFACE) - add_library(Iex INTERFACE) - add_library(Imath INTERFACE) - add_library(IlmImf INTERFACE) - target_link_libraries(Half INTERFACE OpenEXR::OpenEXR) - target_link_libraries(IlmThread INTERFACE OpenEXR::OpenEXR) - target_link_libraries(Iex INTERFACE OpenEXR::OpenEXR) - target_link_libraries(Imath INTERFACE OpenEXR::OpenEXR) - target_link_libraries(IlmImf INTERFACE OpenEXR::OpenEXR) - add_library(IlmBase::Half ALIAS Half) - add_library(IlmBase::IlmThread ALIAS IlmThread) - add_library(IlmBase::Iex ALIAS Iex) - add_library(IlmBase::Imath ALIAS Imath) - add_library(OpenEXR::IlmImf ALIAS IlmImf) - endif() - """ - ) + rm(self, "Find*.cmake", os.path.join(self.source_folder, "cmake"), recursive=True) + # Relax version checks in find_package(), + # since the config/module files produced by CMakeDeps do not support gt major version checks + cmakelists = self.source_path.joinpath("openvdb", "openvdb", "CMakeLists.txt") + cmakelists.write_text(re.sub(r"\$\{MINIMUM_\S+_VERSION}", "", cmakelists.read_text())) + replace_in_file(self, os.path.join(self.source_folder, "openvdb", "openvdb", "CMakeLists.txt"), + "OPENVDB_FUTURE_DEPRECATION", "FALSE") def build(self): self._patch_sources() - cmake = self._configure_cmake() - cmake.build() - - @functools.lru_cache(1) - def _configure_cmake(self): cmake = CMake(self) - # exposed options - cmake.definitions["USE_BLOSC"] = self.options.with_blosc - cmake.definitions["USE_ZLIB"] = self.options.with_zlib - cmake.definitions["USE_LOG4CPLUS"] = self.options.with_log4cplus - cmake.definitions["USE_EXR"] = self.options.with_exr - cmake.definitions["OPENVDB_SIMD"] = self.options.simd - - cmake.definitions["OPENVDB_CORE_SHARED"] = self.options.shared - cmake.definitions["OPENVDB_CORE_STATIC"] = not self.options.shared - - # All available options but not exposed yet. Set to default values - cmake.definitions["OPENVDB_BUILD_CORE"] = True - cmake.definitions["OPENVDB_BUILD_BINARIES"] = False - cmake.definitions["OPENVDB_BUILD_PYTHON_MODULE"] = False - cmake.definitions["OPENVDB_BUILD_UNITTESTS"] = False - cmake.definitions["OPENVDB_BUILD_DOCS"] = False - cmake.definitions["OPENVDB_BUILD_HOUDINI_PLUGIN"] = False - cmake.definitions["OPENVDB_BUILD_HOUDINI_ABITESTS"] = False - - cmake.definitions["OPENVDB_BUILD_AX"] = False - cmake.definitions["OPENVDB_BUILD_AX_BINARIES"] = False - cmake.definitions["OPENVDB_BUILD_AX_UNITTESTS"] = False - - cmake.definitions["OPENVDB_BUILD_MAYA_PLUGIN"] = False - cmake.definitions["OPENVDB_ENABLE_RPATH"] = False - cmake.definitions["OPENVDB_CXX_STRICT"] = False - cmake.definitions["USE_HOUDINI"] = False - cmake.definitions["USE_MAYA"] = False - cmake.definitions["USE_STATIC_DEPENDENCIES"] = False - cmake.definitions["USE_PKGCONFIG"] = False - cmake.definitions["OPENVDB_INSTALL_CMAKE_MODULES"] = False - - cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared - cmake.definitions["OPENEXR_USE_STATIC_LIBS"] = not self.options["openexr"].shared - - cmake.definitions["OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING"] = True - - cmake.configure(build_folder=self._build_subfolder) - return cmake + cmake.configure() + cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) cmake.install() + @property + def _public_defines(self): + defines = [] + if self.options.shared: + defines.append("OPENVDB_DLL") + else: + defines.append("OPENVDB_STATICLIB") + if self.settings.os == "Windows": + defines.append("_WIN32") + defines.append("NOMINMAX") + if self.options.with_log4cplus: + defines.append("OPENVDB_USE_LOG4CPLUS") + return defines + def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "OpenVDB") self.cpp_info.set_property("cmake_target_name", "OpenVDB::openvdb") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + main_component = self.cpp_info.components["openvdb-core"] lib_prefix = "lib" if is_msvc(self) and not self.options.shared else "" - self.cpp_info.components["openvdb-core"].libs = [lib_prefix + "openvdb"] - - lib_define = "OPENVDB_DLL" if self.options.shared else "OPENVDB_STATICLIB" - self.cpp_info.components["openvdb-core"].defines.append(lib_define) - - if self.settings.os == "Windows": - self.cpp_info.components["openvdb-core"].defines.append("_WIN32") - self.cpp_info.components["openvdb-core"].defines.append("NOMINMAX") - - if not self.options["openexr"].shared: - self.cpp_info.components["openvdb-core"].defines.append("OPENVDB_OPENEXR_STATICLIB") - if self.options.with_exr: - self.cpp_info.components["openvdb-core"].defines.append("OPENVDB_TOOLS_RAYTRACER_USE_EXR") - if self.options.with_log4cplus: - self.cpp_info.components["openvdb-core"].defines.append("OPENVDB_USE_LOG4CPLUS") + main_component.libs = [lib_prefix + "openvdb"] + main_component.defines = self._public_defines + if self.settings.os in ("Linux", "FreeBSD"): + main_component.system_libs = ["pthread"] - self.cpp_info.components["openvdb-core"].requires = [ + main_component.requires = [ "boost::iostreams", "boost::system", "onetbb::onetbb", - "openexr::openexr", # should be "openexr::Half", ] if self.settings.os == "Windows": - self.cpp_info.components["openvdb-core"].requires.append("boost::disable_autolinking") - + main_component.requires.append("boost::disable_autolinking") if self.options.with_zlib: - self.cpp_info.components["openvdb-core"].requires.append("zlib::zlib") + main_component.requires.append("zlib::zlib") if self.options.with_blosc: - self.cpp_info.components["openvdb-core"].requires.append("c-blosc::c-blosc") + main_component.requires.append("c-blosc::c-blosc") if self.options.with_log4cplus: - self.cpp_info.components["openvdb-core"].requires.append("log4cplus::log4cplus") - - if self.settings.os in ("Linux", "FreeBSD"): - self.cpp_info.components["openvdb-core"].system_libs = ["pthread"] + main_component.requires.append("log4cplus::log4cplus") + if self.options.use_imath_half: + main_component.requires.append("imath::imath") # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "OpenVDB" self.cpp_info.names["cmake_find_package_multi"] = "OpenVDB" - self.cpp_info.components["openvdb-core"].names["cmake_find_package"] = "openvdb" - self.cpp_info.components["openvdb-core"].names["cmake_find_package_multi"] = "openvdb" - self.cpp_info.components["openvdb-core"].set_property("cmake_target_name", "OpenVDB::openvdb") + main_component.names["cmake_find_package"] = "openvdb" + main_component.names["cmake_find_package_multi"] = "openvdb" + main_component.set_property("cmake_target_name", "OpenVDB::openvdb") diff --git a/recipes/openvdb/all/patches/0001-Find-packages-fixes.patch b/recipes/openvdb/all/patches/0001-Find-packages-fixes.patch deleted file mode 100644 index 65027361b1c53..0000000000000 --- a/recipes/openvdb/all/patches/0001-Find-packages-fixes.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ---- openvdb/openvdb/CMakeLists.txt -+++ openvdb/openvdb/CMakeLists.txt -@@ -413,8 +413,7 @@ if(WIN32) - # @note OPENVDB_OPENEXR_STATICLIB is old functionality from the makefiles - # used in PlatformConfig.h to configure EXR exports. Once this file - # is completely removed, this define can be too -- get_target_property(ILMBASE_LIB_TYPE IlmBase::Half TYPE) -- if(OPENEXR_USE_STATIC_LIBS OR (${ILMBASE_LIB_TYPE} STREQUAL STATIC_LIBRARY)) -+ if(OPENEXR_USE_STATIC_LIBS) - list(APPEND OPENVDB_CORE_PUBLIC_DEFINES -DOPENVDB_OPENEXR_STATICLIB) - endif() - list(APPEND OPENVDB_CORE_PUBLIC_DEFINES -D_WIN32 -DNOMINMAX) - diff --git a/recipes/openvdb/all/test_package/CMakeLists.txt b/recipes/openvdb/all/test_package/CMakeLists.txt index 1016f9a6ff31e..5665948f27dfd 100644 --- a/recipes/openvdb/all/test_package/CMakeLists.txt +++ b/recipes/openvdb/all/test_package/CMakeLists.txt @@ -1,11 +1,12 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(OpenVDB REQUIRED) +find_package(OpenVDB REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE OpenVDB::openvdb) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +if (OpenVDB_VERSION VERSION_GREATER_EQUAL "10.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/openvdb/all/test_package/conanfile.py b/recipes/openvdb/all/test_package/conanfile.py index 19e6a0c06e3d8..ef5d7042163ec 100644 --- a/recipes/openvdb/all/test_package/conanfile.py +++ b/recipes/openvdb/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/openvdb/all/test_v1_package/CMakeLists.txt b/recipes/openvdb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/openvdb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libgit2/0.28.x/test_package/conanfile.py b/recipes/openvdb/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/libgit2/0.28.x/test_package/conanfile.py rename to recipes/openvdb/all/test_v1_package/conanfile.py diff --git a/recipes/openvdb/config.yml b/recipes/openvdb/config.yml index d603f0308422b..203a6bdcd5a75 100644 --- a/recipes/openvdb/config.yml +++ b/recipes/openvdb/config.yml @@ -1,3 +1,7 @@ versions: - "8.0.1": + "11.0.0": + folder: all + "10.1.0": + folder: all + "9.1.0": folder: all diff --git a/recipes/openvino/all/conandata.yml b/recipes/openvino/all/conandata.yml index dd23e75ae9252..a47bfa540ad57 100644 --- a/recipes/openvino/all/conandata.yml +++ b/recipes/openvino/all/conandata.yml @@ -1,4 +1,20 @@ sources: + "2024.1.0": + "openvino": + url: "https://github.com/openvinotoolkit/openvino/archive/refs/tags/2024.1.0.tar.gz" + sha256: "b298a91b5aae252ef9883e0f2017e88677be88a9839b1aa2f6e9f70067d98ce6" + "arm_compute": + url: "https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v24.02.1.tar.gz" + sha256: "590d5cb710355bce2ddfe7117529c2f492cd253b548f709bbfe84702203d99c8" + "onednn_cpu": + url: "https://github.com/openvinotoolkit/oneDNN/archive/26633ae49edd4353a29b7170d9fcef6b2d79f4b3.tar.gz" + sha256: "3cd4a2aea30cd6ca689e63545cf986f8e83c88333b73d42bb750fcaf08940b17" + "mlas": + url: "https://github.com/openvinotoolkit/mlas/archive/d1bc25ec4660cddd87804fcf03b2411b5dfb2e94.tar.gz" + sha256: "0a44fbfd4b13e8609d66ddac4b11a27c90c1074cde5244c91ad197901666004c" + "onednn_gpu": + url: "https://github.com/oneapi-src/oneDNN/archive/4e6ff043c439652fcf6c400ac4e0c81bbac7c71c.tar.gz" + sha256: "c3543d560fbbb7297df91c191cc9bf682322c5554302e256f1bf4a757424a331" "2024.0.0": "openvino": url: "https://github.com/openvinotoolkit/openvino/archive/refs/tags/2024.0.0.tar.gz" @@ -47,23 +63,12 @@ sources: "onednn_gpu": url: "https://github.com/oneapi-src/oneDNN/archive/284ad4574939fa784e4ddaa1f4aa577b8eb7a017.tar.gz" sha256: "16f36078339cd08b949efea1d863344cb0b742d9f5898937d07a591b0c4da517" - "2023.1.0": - "openvino": - url: "https://github.com/openvinotoolkit/openvino/archive/refs/tags/2023.1.0.tar.gz" - sha256: "ff88596b342440185874ddbe22874b47ad7b923f14671921af760b15c98aacd6" - "arm_compute": - url: "https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v23.02.1.tar.gz" - sha256: "c3a443e26539f866969242e690cf0651ef629149741ee18732f954c734da6763" - "onednn_cpu": - url: "https://github.com/openvinotoolkit/oneDNN/archive/ae825539bd850d1ad5c83d4bb0d56c65d46d5842.tar.gz" - sha256: "1204df17785c8603f9dfa1f4f91e91e5ffd4391bf7680d2b256de2513490ebee" - "mlas": - url: "https://github.com/openvinotoolkit/mlas/archive/c7c8a631315000f17c650af34431009d2f22129c.tar.gz" - sha256: "7b790dfeef8e1dd612f920c85186c52ad3a3e2245e2a2afd6cc91ce4b1dc64a9" - "onednn_gpu": - url: "https://github.com/oneapi-src/oneDNN/archive/4b82a66ed38ecaa993352e5cc6ed7753656b8a26.tar.gz" - sha256: "cb17c003fe51bc9b4e20189573956b4446468162adf0fc4cea2ee0820cff0cd0" patches: + "2024.1.0": + - patch_file: "patches/2024.1.0/0001-fix-cxxflags.patch" + patch_description: "Fix build failure when explicitly passing different gcc ABI via cxx flags" + patch_type: "portability" + patch_source: "https://github.com/openvinotoolkit/openvino/pull/24274" "2024.0.0": - patch_file: "patches/2024.0.0/0001-Include-mutex-for-std-call_once.patch" patch_description: "Include mutex for std::call_once" @@ -82,40 +87,3 @@ patches: patch_description: "Fixed issue with version on Windows" patch_type: "portability" patch_source: "https://github.com/openvinotoolkit/openvino/pull/19628" - "2023.1.0": - - patch_file: "patches/2023.1.0/0001-cpu-plugin-compilation-c++17.patch" - patch_description: "Fixed CPU plugin compilation with C++17" - patch_type: "portability" - patch_source: "https://github.com/openvinotoolkit/openvino/pull/19628" - - patch_file: "patches/2023.1.0/0002-core-compilation-c++17.patch" - patch_description: "Fixed OpenVINO Core compilation with C++17" - patch_type: "portability" - patch_source: "https://github.com/openvinotoolkit/openvino/pull/19707" - - patch_file: "patches/2023.1.0/0003-fixed-gpu-with-onednn-build.patch" - patch_description: "Fixed Intel GPU plugin with oneDNN" - patch_type: "portability" - # severals PR are merged into a single patch including: - # https://github.com/openvinotoolkit/openvino/pull/19668, - # https://github.com/openvinotoolkit/openvino/pull/19715, - # https://github.com/openvinotoolkit/openvino/pull/19716, - # https://github.com/openvinotoolkit/openvino/pull/19762 and - patch_source: "https://github.com/openvinotoolkit/openvino/pull/19811" - - patch_file: "patches/2023.1.0/0004-fixed-gpu-plugin-with-clang.patch" - patch_description: "Fixed order of initialization of static variables in GPU plugin compiled with clang" - patch_type: "portability" - patch_source: "https://github.com/openvinotoolkit/openvino/pull/19768" - - patch_file: "patches/2023.1.0/0005-dynamic-protobuf.patch" - patch_description: "Added a workaround for OpenVINO to work with dynamic protobuf" - patch_type: "portability" - # severals PR are merged into a single patch including: - # https://github.com/openvinotoolkit/openvino/pull/19599, - # https://github.com/openvinotoolkit/openvino/pull/19758 and - patch_source: "https://github.com/openvinotoolkit/openvino/pull/20612" - - patch_file: "patches/2023.1.0/0006-macos-14.patch" - patch_description: "Support macos 14" - patch_type: "portability" - patch_source: "https://github.com/openvinotoolkit/openvino/pull/19946" - - patch_file: "patches/2023.1.0/0007-compilation-c++23.patch" - patch_description: "Compilation with C++23" - patch_type: "portability" - patch_source: "https://github.com/openvinotoolkit/openvino/pull/20724" diff --git a/recipes/openvino/all/conanfile.py b/recipes/openvino/all/conanfile.py index d5b090836295b..fca46b7f10736 100644 --- a/recipes/openvino/all/conanfile.py +++ b/recipes/openvino/all/conanfile.py @@ -14,7 +14,6 @@ class OpenvinoConan(ConanFile): name = "openvino" - # Optional metadata license = "Apache-2.0" homepage = "https://github.com/openvinotoolkit/openvino" url = "https://github.com/conan-io/conan-center-index" @@ -100,6 +99,10 @@ def _target_x86_64(self): def _gna_option_available(self): return self.settings.os in ["Linux", "Windows"] and self._target_x86_64 and Version(self.version) < "2024.0.0" + @property + def _npu_option_available(self): + return self.settings.os in ["Linux", "Windows"] and self._target_x86_64 and Version(self.version) >= "2024.1.0" + @property def _gpu_option_available(self): return self.settings.os != "Macos" and self._target_x86_64 @@ -205,6 +208,8 @@ def generate(self): toolchain.cache_variables["ENABLE_ONEDNN_FOR_GPU"] = self.options.shared or not self.options.enable_cpu if self._gna_option_available: toolchain.cache_variables["ENABLE_INTEL_GNA"] = False + if self._npu_option_available: + toolchain.cache_variables["ENABLE_INTEL_NPU"] = False # SW plugins toolchain.cache_variables["ENABLE_AUTO"] = self.options.enable_auto toolchain.cache_variables["ENABLE_MULTI"] = self.options.enable_auto diff --git a/recipes/openvino/all/dependencies/dependencies-2023.1.0.yml b/recipes/openvino/all/dependencies/dependencies-2023.1.0.yml deleted file mode 100644 index fd126ded2ddee..0000000000000 --- a/recipes/openvino/all/dependencies/dependencies-2023.1.0.yml +++ /dev/null @@ -1,2 +0,0 @@ -onnx: "1.13.1" -ade: "0.1.2d" diff --git a/recipes/openvino/all/dependencies/dependencies-2024.1.0.yml b/recipes/openvino/all/dependencies/dependencies-2024.1.0.yml new file mode 100644 index 0000000000000..f99604741682a --- /dev/null +++ b/recipes/openvino/all/dependencies/dependencies-2024.1.0.yml @@ -0,0 +1 @@ +onnx: "1.15.0" diff --git a/recipes/openvino/all/patches/2023.1.0/0001-cpu-plugin-compilation-c++17.patch b/recipes/openvino/all/patches/2023.1.0/0001-cpu-plugin-compilation-c++17.patch deleted file mode 100644 index da6548b7c9115..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0001-cpu-plugin-compilation-c++17.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/src/plugins/intel_cpu/src/cpu_tensor.cpp b/src/plugins/intel_cpu/src/cpu_tensor.cpp -index 48d8fdd4be..815edd9309 100644 ---- a/src/plugins/intel_cpu/src/cpu_tensor.cpp -+++ b/src/plugins/intel_cpu/src/cpu_tensor.cpp -@@ -68,8 +68,9 @@ void Tensor::update_strides() const { - OPENVINO_ASSERT(blocked_desc, "not a valid blocked memory descriptor."); - auto& strides = blocked_desc->getStrides(); - m_strides.resize(strides.size()); -- std::transform(strides.cbegin(), strides.cend(), m_strides.begin(), -- std::bind1st(std::multiplies(), m_element_type.size())); -+ std::transform(strides.cbegin(), strides.cend(), m_strides.begin(), [this] (const size_t stride) { -+ return stride * m_element_type.size(); -+ }); - } - - void* Tensor::data(const element::Type& element_type) const { diff --git a/recipes/openvino/all/patches/2023.1.0/0002-core-compilation-c++17.patch b/recipes/openvino/all/patches/2023.1.0/0002-core-compilation-c++17.patch deleted file mode 100644 index 2df86d8ed0ec6..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0002-core-compilation-c++17.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/src/frontends/common/src/utils.cpp b/src/frontends/common/src/utils.cpp -index 8ef7481551..3a0db585fd 100644 ---- a/src/frontends/common/src/utils.cpp -+++ b/src/frontends/common/src/utils.cpp -@@ -12,10 +12,6 @@ - # include - # include - # include --# ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT --# include --# include --# endif - #else - # if defined(WINAPI_FAMILY) && !WINAPI_PARTITION_DESKTOP - # error "Only WINAPI_PARTITION_DESKTOP is supported, because of GetModuleHandleEx[A|W]" -diff --git a/src/frontends/paddle/src/input_model.cpp b/src/frontends/paddle/src/input_model.cpp -index 6987b3285e..287fa5e54a 100644 ---- a/src/frontends/paddle/src/input_model.cpp -+++ b/src/frontends/paddle/src/input_model.cpp -@@ -13,14 +13,10 @@ - #include "openvino/frontend/paddle/node_context.hpp" - #include "openvino/opsets/opset7.hpp" - #include "openvino/util/common_util.hpp" -+#include "openvino/util/file_util.hpp" - #include "paddle_utils.hpp" - #include "place.hpp" - --#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) --# include --# include --#endif -- - namespace ov { - namespace frontend { - namespace paddle { -@@ -169,9 +165,7 @@ std::basic_string get_const_path(const std::basic_string& folder_with_weig - #if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) - template <> - std::basic_string get_const_path(const std::basic_string& folder, const std::string& name) { -- std::wstring_convert> converter; -- std::wstring _name = converter.from_bytes(name); -- return folder + paddle::get_path_sep() + _name; -+ return folder + paddle::get_path_sep() + ov::util::string_to_wstring(name); - } - #endif - diff --git a/recipes/openvino/all/patches/2023.1.0/0003-fixed-gpu-with-onednn-build.patch b/recipes/openvino/all/patches/2023.1.0/0003-fixed-gpu-with-onednn-build.patch deleted file mode 100644 index e5791b37c7a7a..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0003-fixed-gpu-with-onednn-build.patch +++ /dev/null @@ -1,684 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 461f1a209c..0b552b3da3 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -47,6 +47,7 @@ message (STATUS "CMAKE_GENERATOR ....................... " ${CMAKE_GENERATOR}) - message (STATUS "CPACK_GENERATOR ....................... " ${CPACK_GENERATOR}) - message (STATUS "CMAKE_C_COMPILER_ID ................... " ${CMAKE_C_COMPILER_ID}) - message (STATUS "CMAKE_CXX_COMPILER_ID ................. " ${CMAKE_CXX_COMPILER_ID}) -+message (STATUS "CMAKE_CXX_STANDARD .................... " ${CMAKE_CXX_STANDARD}) - if(OV_GENERATOR_MULTI_CONFIG) - string(REPLACE ";" " " config_types "${CMAKE_CONFIGURATION_TYPES}") - message (STATUS "CMAKE_CONFIGURATION_TYPES ............. " ${config_types}) -diff --git a/cmake/developer_package/plugins/plugins.cmake b/cmake/developer_package/plugins/plugins.cmake -index 436685355a..ea187411d1 100644 ---- a/cmake/developer_package/plugins/plugins.cmake -+++ b/cmake/developer_package/plugins/plugins.cmake -@@ -117,6 +117,10 @@ function(ov_add_plugin) - # install rules - if(NOT OV_PLUGIN_SKIP_INSTALL OR NOT BUILD_SHARED_LIBS) - string(TOLOWER "${OV_PLUGIN_DEVICE_NAME}" install_component) -+ if(NOT BUILD_SHARED_LIBS) -+ # in case of static libs everything is installed to 'core' -+ set(install_component ${OV_CPACK_COMP_CORE}) -+ endif() - - if(OV_PLUGIN_PSEUDO_DEVICE) - set(plugin_hidden HIDDEN) -diff --git a/cmake/features.cmake b/cmake/features.cmake -index e4b60c89e0..7327b262a2 100644 ---- a/cmake/features.cmake -+++ b/cmake/features.cmake -@@ -23,7 +23,7 @@ endif() - - ie_dependent_option (ENABLE_INTEL_GPU "GPU OpenCL-based plugin for OpenVINO Runtime" ${ENABLE_INTEL_GPU_DEFAULT} "X86_64 OR AARCH64;NOT APPLE;NOT WINDOWS_STORE;NOT WINDOWS_PHONE" OFF) - --if (ANDROID OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) OR NOT BUILD_SHARED_LIBS) -+if (ANDROID OR MINGW OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) OR (NOT BUILD_SHARED_LIBS AND ENABLE_INTEL_CPU)) - # oneDNN doesn't support old compilers and android builds for now, so we'll build GPU plugin without oneDNN - # also, in case of static build CPU's and GPU's oneDNNs will conflict, so we are disabling GPU's one in this case - set(ENABLE_ONEDNN_FOR_GPU_DEFAULT OFF) -diff --git a/cmake/templates/OpenVINOConfig.cmake.in b/cmake/templates/OpenVINOConfig.cmake.in -index 9eb1cfdd35..7dda80d8a3 100644 ---- a/cmake/templates/OpenVINOConfig.cmake.in -+++ b/cmake/templates/OpenVINOConfig.cmake.in -@@ -223,6 +223,10 @@ macro(_ov_find_tbb) - PATHS ${_tbb_bind_dir} - NO_CMAKE_FIND_ROOT_PATH - NO_DEFAULT_PATH) -+ if(TARGET TBBbind::tbbbind_2_5) -+ # To solve https://cmake.org/cmake/help/latest/policy/CMP0111.html warnings -+ set_property(TARGET TBBbind::tbbbind_2_5 PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG) -+ endif() - unset(_tbb_bind_dir) - endif() - unset(install_tbbbind) -@@ -343,11 +347,15 @@ endmacro() - macro(_ov_find_intel_cpu_dependencies) - set(_OV_ENABLE_CPU_ACL "@DNNL_USE_ACL@") - if(_OV_ENABLE_CPU_ACL) -- set(_ov_in_install_tree "@PACKAGE_ARM_COMPUTE_LIB_DIR@") -+ set(_ov_in_install_tree "@PACKAGE_OPENVINO_LIB_DIR@") - if(_ov_in_install_tree) -- set_and_check(ARM_COMPUTE_LIB_DIR "@PACKAGE_ARM_COMPUTE_LIB_DIR@") -+ set_and_check(ARM_COMPUTE_LIB_DIR "@PACKAGE_OPENVINO_LIB_DIR@") - set(ACL_DIR "${CMAKE_CURRENT_LIST_DIR}") - else() -+ if(NOT TARGET arm_compute::arm_compute) -+ # for case when build tree is used separately, e.g. OpenVINODeveloperPackageConfig.cmake -+ set_and_check(ARM_COMPUTE_LIB_DIR "@PACKAGE_CMAKE_ARCHIVE_OUTPUT_DIRECTORY@") -+ endif() - set_and_check(ACL_DIR "@PACKAGE_FIND_ACL_PATH@") - endif() - -@@ -363,16 +371,50 @@ macro(_ov_find_intel_gpu_dependencies) - set(_OV_ENABLE_INTEL_GPU "@ENABLE_INTEL_GPU@") - set(_OV_ENABLE_SYSTEM_OPENCL "@ENABLE_SYSTEM_OPENCL@") - if(_OV_ENABLE_INTEL_GPU AND _OV_ENABLE_SYSTEM_OPENCL) -- set(_OV_OpenCLICDLoader_FOUND "@OpenCLICDLoader_FOUND@") -- if(_OV_OpenCLICDLoader_FOUND) -- _ov_find_dependency(OpenCLICDLoader) -- else() -- _ov_find_dependency(OpenCL) -- endif() -- unset(_OV_OpenCLICDLoader_FOUND) -+ _ov_find_dependency(OpenCL) - endif() - unset(_OV_ENABLE_INTEL_GPU) - unset(_OV_ENABLE_SYSTEM_OPENCL) -+ -+ set(_OV_ENABLE_ONEDNN_FOR_GPU "@ENABLE_ONEDNN_FOR_GPU@") -+ if(_OV_ENABLE_ONEDNN_FOR_GPU AND NOT TARGET onednn_gpu_tgt) -+ set(_OV_DNNL_GPU_LIBRARY_NAME "@DNNL_GPU_LIBRARY_NAME@") -+ -+ set(_ov_in_install_tree "@PACKAGE_OPENVINO_LIB_DIR@") -+ if(_ov_in_install_tree) -+ set(onednn_gpu_lib "${CMAKE_STATIC_LIBRARY_PREFIX}${_OV_DNNL_GPU_LIBRARY_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") -+ set_and_check(onednn_gpu_lib_root "@PACKAGE_OPENVINO_LIB_DIR@") -+ if(WIN32) -+ if(OV_GENERATOR_MULTI_CONFIG) -+ set(extra_args PATH_SUFFIXES ${CMAKE_CONFIGURATION_TYPES}) -+ else() -+ set(extra_args PATH_SUFFIXES ${CMAKE_BUILD_TYPE}) -+ endif() -+ endif() -+ -+ find_library(onednn_gpu_lib_path -+ NAMES ${_OV_DNNL_GPU_LIBRARY_NAME} -+ PATHS ${onednn_gpu_lib_root} -+ ${extra_args}) -+ -+ if(NOT onednn_gpu_lib_path) -+ message(FATAL_ERROR "Internal error: failed to find '${_OV_DNNL_GPU_LIBRARY_NAME}' in '${onednn_gpu_lib_root}'") -+ endif() -+ -+ unset(extra_args) -+ unset(onednn_gpu_lib) -+ else() -+ set_and_check(onednn_gpu_lib_path "@PACKAGE_ONEDNN_GPU_LIB_PATH@") -+ endif() -+ -+ set_target_properties(openvino::onednn_gpu_tgt PROPERTIES -+ INTERFACE_LINK_LIBRARIES "${onednn_gpu_lib_path}") -+ -+ unset(onednn_gpu_lib_path) -+ unset(_ov_in_install_tree) -+ unset(_OV_DNNL_GPU_LIBRARY_NAME) -+ endif() -+ unset(_OV_ENABLE_ONEDNN_FOR_GPU) - endmacro() - - macro(_ov_find_intel_gna_dependencies) -@@ -455,6 +497,7 @@ set(_OV_ENABLE_OPENVINO_BUILD_SHARED "@BUILD_SHARED_LIBS@") - - if(NOT TARGET openvino) - set(_ov_as_external_package ON) -+ include("${CMAKE_CURRENT_LIST_DIR}/OpenVINOTargets.cmake") - endif() - - if(NOT _OV_ENABLE_OPENVINO_BUILD_SHARED) -@@ -487,8 +530,6 @@ set(_ov_imported_libs openvino::runtime openvino::runtime::c - openvino::frontend::pytorch openvino::frontend::tensorflow_lite) - - if(_ov_as_external_package) -- include("${CMAKE_CURRENT_LIST_DIR}/OpenVINOTargets.cmake") -- - foreach(target IN LISTS _ov_imported_libs) - if(TARGET ${target}) - get_target_property(imported_configs ${target} IMPORTED_CONFIGURATIONS) -diff --git a/src/cmake/openvino.cmake b/src/cmake/openvino.cmake -index eb9a54354e..1d2996482b 100644 ---- a/src/cmake/openvino.cmake -+++ b/src/cmake/openvino.cmake -@@ -157,9 +157,12 @@ if(ENABLE_INTEL_GNA) - list(APPEND PATH_VARS "GNA_PATH") - endif() - if(DNNL_USE_ACL) -- list(APPEND BUILD_PATH_VARS "FIND_ACL_PATH") -+ list(APPEND BUILD_PATH_VARS "FIND_ACL_PATH;CMAKE_ARCHIVE_OUTPUT_DIRECTORY") - set(FIND_ACL_PATH "${intel_cpu_thirdparty_SOURCE_DIR}") - endif() -+if(ENABLE_ONEDNN_FOR_GPU) -+ list(APPEND BUILD_PATH_VARS "ONEDNN_GPU_LIB_PATH") -+endif() - - set(PUBLIC_HEADERS_DIR "${OpenVINO_SOURCE_DIR}/src/inference/include") - set(IE_INCLUDE_DIR "${PUBLIC_HEADERS_DIR}/ie") -@@ -177,12 +180,10 @@ configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/OpenVINOCo - - # install tree - --if(DNNL_USE_ACL) -- list(APPEND INSTALL_PATH_VARS "ARM_COMPUTE_LIB_DIR") -- # remove generator expression at the end, because searching in Release / Debug will be -- # done by ACLConfig.cmake itself -- string(REPLACE "$" "" ARM_COMPUTE_LIB_DIR "${OV_CPACK_LIBRARYDIR}") --endif() -+list(APPEND INSTALL_PATH_VARS "OPENVINO_LIB_DIR") -+# remove generator expression at the end, because searching in Release / Debug -+# will be done by inside OpenVINOConfig.cmak / ACLConfig.cmake -+string(REPLACE "$" "" OPENVINO_LIB_DIR "${OV_CPACK_LIBRARYDIR}") - - set(IE_INCLUDE_DIR "${OV_CPACK_INCLUDEDIR}/ie") - set(IE_TBB_DIR "${IE_TBB_DIR_INSTALL}") -diff --git a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt -index 98935a0792..7e8325acef 100644 ---- a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt -+++ b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt -@@ -117,7 +117,7 @@ function(ov_add_onednn) - add_subdirectory(onednn EXCLUDE_FROM_ALL) - - # install static libraries -- ov_install_static_lib(dnnl cpu) -+ ov_install_static_lib(dnnl ${OV_CPACK_COMP_CORE}) - - if(DNNL_USE_ACL AND NOT BUILD_SHARED_LIBS) - # use ACLConfig.cmake in OpenVINOConfig.cmake in case of static build -@@ -125,16 +125,16 @@ function(ov_add_onednn) - # but for this we need to install library files - install(FILES $ - DESTINATION ${OV_CPACK_ARCHIVEDIR} -- COMPONENT cpu) -+ COMPONENT ${OV_CPACK_COMP_CORE}) - install(FILES "${intel_cpu_thirdparty_SOURCE_DIR}/ACLConfig.cmake" - DESTINATION ${OV_CPACK_OPENVINO_CMAKEDIR} -- COMPONENT core_dev) -+ COMPONENT ${OV_CPACK_COMP_CORE_DEV}) - endif() - endfunction() - - if(ENABLE_MLAS_FOR_CPU) - add_subdirectory(mlas) -- ov_install_static_lib(mlas cpu) -+ ov_install_static_lib(mlas ${OV_CPACK_COMP_CORE}) - endif() - - ov_add_onednn() -diff --git a/src/plugins/intel_gpu/CMakeLists.txt b/src/plugins/intel_gpu/CMakeLists.txt -index 1770b34b65..4e8a9d0e68 100644 ---- a/src/plugins/intel_gpu/CMakeLists.txt -+++ b/src/plugins/intel_gpu/CMakeLists.txt -@@ -35,6 +35,7 @@ set(MAIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}") - set(INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include") - - add_subdirectory(thirdparty) -+include(thirdparty/cmake/rapidjson.cmake) - - if(CMAKE_COMPILER_IS_GNUCXX) - ie_add_compiler_flags(-Werror) -diff --git a/src/plugins/intel_gpu/src/graph/CMakeLists.txt b/src/plugins/intel_gpu/src/graph/CMakeLists.txt -index 0b2093d2a0..fac58ec0fa 100644 ---- a/src/plugins/intel_gpu/src/graph/CMakeLists.txt -+++ b/src/plugins/intel_gpu/src/graph/CMakeLists.txt -@@ -58,7 +58,7 @@ elseif((NOT ANDROID) AND (UNIX)) - target_link_libraries(${TARGET_NAME} PRIVATE pthread) - endif() - --ov_install_static_lib(${TARGET_NAME} gpu) -+ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE}) - - if(ENABLE_SSE42) - ie_sse42_optimization_flags(sse4_2_flags) -diff --git a/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt b/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt -index b76d8ee732..99ebf5331a 100644 ---- a/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt -+++ b/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt -@@ -61,7 +61,8 @@ endif() - target_include_directories(${TARGET_NAME} PUBLIC $ - $ - $ -- $) -+ $ -+ PRIVATE $) - - target_compile_options(${TARGET_NAME} PRIVATE - $<$:$,/Os,-Os>>) -@@ -70,7 +71,7 @@ if(COMMAND add_cpplint_target) - add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME}) - endif() - --target_link_libraries(${TARGET_NAME} PUBLIC OpenCL::OpenCL rapidjson inference_engine_plugin_api) -+target_link_libraries(${TARGET_NAME} PUBLIC OpenCL::OpenCL inference_engine_plugin_api) - - set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO}) - -@@ -90,8 +91,16 @@ add_custom_command( - TARGET ${TARGET_NAME} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/cache/cache.json ${TUNING_CACHE_PATH}/cache.json) - -+if(BUILD_SHARED_LIBS) -+ set(CACHE_JSON_INSTALL_DIR ${OV_CPACK_PLUGINSDIR}) -+ set(CACHE_JSON_COMPONENT gpu) -+else() -+ set(CACHE_JSON_INSTALL_DIR ${OV_CPACK_ARCHIVEDIR}) -+ set(CACHE_JSON_COMPONENT ${OV_CPACK_COMP_CORE}) -+endif() -+ - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cache/cache.json -- DESTINATION ${OV_CPACK_PLUGINSDIR} -- COMPONENT gpu) -+ DESTINATION ${CACHE_JSON_INSTALL_DIR} -+ COMPONENT ${CACHE_JSON_COMPONENT}) - --ov_install_static_lib(${TARGET_NAME} gpu) -+ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE}) -diff --git a/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.cpp b/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.cpp -index cfac486cdf..a5d0711f61 100644 ---- a/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.cpp -+++ b/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.cpp -@@ -3,18 +3,21 @@ - // - - #include "auto_tuner.h" -+ - #include - #include - #include - #include - #include --#include "istreamwrapper.h" --#include "stringbuffer.h" --#include "prettywriter.h" - #include - #include - #include - -+#include "rapidjson/istreamwrapper.h" -+#include "rapidjson/stringbuffer.h" -+#include "rapidjson/prettywriter.h" -+#include "rapidjson/document.h" -+ - #ifdef _WIN32 - #ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN -@@ -35,32 +38,37 @@ - - namespace kernel_selector { - -+class TuningCache::Impl { -+public: -+ rapidjson::Document cache; -+}; -+ - TuningCache::TuningCache(const std::string& cacheFilePath) -- : cache() { -+ : impl(new Impl()) { - // Read cache file - std::ifstream tuningFile(cacheFilePath); - - if (tuningFile && tuningFile.good()) { - std::stringstream buffer; - buffer << tuningFile.rdbuf(); -- cache.Parse(buffer.str().c_str()); -+ impl->cache.Parse(buffer.str().c_str()); - } else { - throw std::runtime_error("Tuning file: " + cacheFilePath + " could not be read! Must provide a valid cache file in USE_CACHE mode."); - } - -- if (cache.IsNull()) { -- cache.SetObject(); -- } else if (!cache.IsObject()) { -+ if (impl->cache.IsNull()) { -+ impl->cache.SetObject(); -+ } else if (!impl->cache.IsObject()) { - throw std::runtime_error("Tuning file: " + cacheFilePath + " has incorrect format."); - } - -- auto cacheObj = cache.GetObject(); -+ auto cacheObj = impl->cache.GetObject(); - - // Update to new format with version markers - if (!cacheObj.HasMember(version2Marker)) { -- auto newName = rapidjson::Value(version2Marker, cache.GetAllocator()); -+ auto newName = rapidjson::Value(version2Marker, impl->cache.GetAllocator()); - auto newObj = rapidjson::Value(rapidjson::Type::kObjectType); -- cacheObj.AddMember(newName, newObj, cache.GetAllocator()); -+ cacheObj.AddMember(newName, newObj, impl->cache.GetAllocator()); - } - - bool needsV1 = false; -@@ -73,9 +81,9 @@ TuningCache::TuningCache(const std::string& cacheFilePath) - - if (needsV1) { - if (!cacheObj.HasMember(version1Marker)) { -- auto newName = rapidjson::Value(version1Marker, cache.GetAllocator()); -+ auto newName = rapidjson::Value(version1Marker, impl->cache.GetAllocator()); - auto newObj = rapidjson::Value(rapidjson::Type::kObjectType); -- cacheObj.AddMember(newName, newObj, cache.GetAllocator()); -+ cacheObj.AddMember(newName, newObj, impl->cache.GetAllocator()); - } - - for (auto it = cacheObj.begin(); it != cacheObj.end();) { -@@ -86,7 +94,7 @@ TuningCache::TuningCache(const std::string& cacheFilePath) - auto newValue = rapidjson::Value(rapidjson::Type::kObjectType); - newName.Swap(member.name); - newValue.Swap(member.value); -- cache[version1Marker].AddMember(newName, newValue, cache.GetAllocator()); -+ impl->cache[version1Marker].AddMember(newName, newValue, impl->cache.GetAllocator()); - it = cacheObj.EraseMember(it); - } else { - it++; -@@ -96,11 +104,11 @@ TuningCache::TuningCache(const std::string& cacheFilePath) - } - - TuningCache::TuningCache() -- : cache() { -- cache.SetObject(); -- auto v2Name = rapidjson::Value(version2Marker, cache.GetAllocator()); -+ : impl(new Impl()) { -+ impl->cache.SetObject(); -+ auto v2Name = rapidjson::Value(version2Marker, impl->cache.GetAllocator()); - auto v2Obj = rapidjson::Value(rapidjson::Type::kObjectType); -- cache.AddMember(v2Name, v2Obj, cache.GetAllocator()); -+ impl->cache.AddMember(v2Name, v2Obj, impl->cache.GetAllocator()); - } - - TuningCache::Entry TuningCache::LoadKernel(const Params& params) { -@@ -129,8 +137,8 @@ TuningCache::Entry TuningCache::LoadKernel_v1(const Params& params, uint32_t com - auto hashStr = std::to_string(create_hash(params.to_string())); - auto computeUnitsStr = std::to_string(computeUnitsCount); - -- auto v1It = cache.FindMember(version1Marker); -- if (v1It == cache.MemberEnd()) -+ auto v1It = impl->cache.FindMember(version1Marker); -+ if (v1It == impl->cache.MemberEnd()) - return result; - - auto computeUnitsIt = v1It->value.FindMember(computeUnitsStr.c_str()); -@@ -152,8 +160,8 @@ TuningCache::Entry TuningCache::LoadKernel_v2(const Params& params, uint32_t com - auto paramStr = params.to_cache_string_v2(); - auto computeUnitsStr = std::to_string(computeUnitsCount); - -- auto v2It = cache.FindMember(version2Marker); -- if (v2It == cache.MemberEnd()) -+ auto v2It = impl->cache.FindMember(version2Marker); -+ if (v2It == impl->cache.MemberEnd()) - return result; - - auto computeUnitsIt = v2It->value.FindMember(computeUnitsStr.c_str()); -diff --git a/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.h b/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.h -index 1a875b7d4d..8a9da81354 100644 ---- a/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.h -+++ b/src/plugins/intel_gpu/src/kernel_selector/auto_tuner.h -@@ -8,12 +8,12 @@ - #include - #include - #include --#include "kernel_selector_common.h" --#include "kernel_selector_params.h" --#include "document.h" - #include - #include - -+#include "kernel_selector_common.h" -+#include "kernel_selector_params.h" -+ - namespace kernel_selector { - - class TuningCache { -@@ -42,7 +42,8 @@ private: - Entry LoadKernel_v1(const Params& params, uint32_t computeUnitsCount); - Entry LoadKernel_v2(const Params& params, uint32_t computeUnitsCount); - -- rapidjson::Document cache; -+ class Impl; -+ std::shared_ptr impl; - - static constexpr const char* version1Marker = "version_1"; - static constexpr const char* version2Marker = "version_2"; -diff --git a/src/plugins/intel_gpu/src/kernel_selector/jitter.cpp b/src/plugins/intel_gpu/src/kernel_selector/jitter.cpp -index fe6ffe8008..106560f5f1 100644 ---- a/src/plugins/intel_gpu/src/kernel_selector/jitter.cpp -+++ b/src/plugins/intel_gpu/src/kernel_selector/jitter.cpp -@@ -1540,11 +1540,11 @@ JitConstants MakeActivationJitConstants(std::vector(SCHAR_MIN))); -- nl_n = toCodeString(std::min(params[i].n, static_cast(SCHAR_MAX))); -+ nl_m = toCodeString(std::max(params[i].m, std::numeric_limits::min())); -+ nl_n = toCodeString(std::min(params[i].n, std::numeric_limits::max())); - } else if (out_dt == Datatype::UINT8) { - nl_m = toCodeString(std::max(params[i].m, 0.0f)); -- nl_n = toCodeString(std::min(params[i].n, static_cast(UCHAR_MAX))); -+ nl_n = toCodeString(std::min(params[i].n, std::numeric_limits::max())); - } - } - auto jitConstants = JitConstants{MakeJitConstant("NL_M" + activation_suffix, nl_m), -@@ -1949,11 +1949,11 @@ JitConstants FusedOpsCodeGenerator::MakeOpJitConstants(const FusedOpsConfigurati - - if (activation_p.function == ActivationFunction::CLAMP) { - if (out_type == Datatype::INT8) { -- nl_m = toCodeString(std::max(activation_p.m, static_cast(SCHAR_MIN))); -- nl_n = toCodeString(std::min(activation_p.n, static_cast(SCHAR_MAX))); -+ nl_m = toCodeString(std::max(activation_p.m, std::numeric_limits::min())); -+ nl_n = toCodeString(std::min(activation_p.n, std::numeric_limits::max())); - } else if (out_type == Datatype::UINT8) { - nl_m = toCodeString(std::max(activation_p.m, 0.0f)); -- nl_n = toCodeString(std::min(activation_p.n, static_cast(UCHAR_MAX))); -+ nl_n = toCodeString(std::min(activation_p.n, std::numeric_limits::max())); - } - } - -diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernel_selector_params.h b/src/plugins/intel_gpu/src/kernel_selector/kernel_selector_params.h -index 5c71c907b7..76e84e558b 100644 ---- a/src/plugins/intel_gpu/src/kernel_selector/kernel_selector_params.h -+++ b/src/plugins/intel_gpu/src/kernel_selector/kernel_selector_params.h -@@ -10,7 +10,6 @@ - #include - #include "common_types.h" - #include "tensor_type.h" --#include "document.h" - #include - #include - #include -diff --git a/src/plugins/intel_gpu/src/runtime/CMakeLists.txt b/src/plugins/intel_gpu/src/runtime/CMakeLists.txt -index c442f65575..321fc2f1b2 100644 ---- a/src/plugins/intel_gpu/src/runtime/CMakeLists.txt -+++ b/src/plugins/intel_gpu/src/runtime/CMakeLists.txt -@@ -64,4 +64,4 @@ elseif((NOT ANDROID) AND (UNIX)) - target_link_libraries(${TARGET_NAME} PRIVATE pthread) - endif() - --ov_install_static_lib(${TARGET_NAME} gpu) -+ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE}) -diff --git a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt -index c7c616d0df..b7cc810a75 100644 ---- a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt -+++ b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt -@@ -2,14 +2,6 @@ - # SPDX-License-Identifier: Apache-2.0 - # - --add_library(rapidjson INTERFACE) -- --set_target_properties(rapidjson PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES $ --) -- --ov_install_static_lib(rapidjson gpu) -- - # - # oneDNN for GPU plugin - # -@@ -17,11 +9,12 @@ ov_install_static_lib(rapidjson gpu) - if(ENABLE_ONEDNN_FOR_GPU) - function(build_onednn_gpu) - include(ExternalProject) -- set(ONEDNN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_build/") -- set(ONEDNN_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_install/") -+ set(ONEDNN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_build") -+ set(ONEDNN_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_install" CACHE PATH "Installation path for oneDNN GPU library") - set(ONEDNN_PREFIX_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_root") - set(ONEDNN_ENABLED_PRIMITIVES "CONCAT;CONVOLUTION;DECONVOLUTION;INNER_PRODUCT;MATMUL;REORDER;POOLING;REDUCTION") - set(ONEDNN_ENABLED_ISA "XEHP;XEHPG;XEHPC") -+ set(DNNL_GPU_LIBRARY_NAME "openvino_onednn_gpu" CACHE STRING "Name of oneDNN library for Intel GPU Plugin") - - if(X86_64) - set(ONEDNN_TARGET_ARCH "X64" CACHE STRING "" FORCE) -@@ -87,18 +80,16 @@ if(ENABLE_ONEDNN_FOR_GPU) - list(APPEND cmake_extra_args "-DOpenCL_INCLUDE_DIR=${OpenCL_INCLUDE_DIR}") - endif() - -+ set(onednn_gpu_lib "${CMAKE_STATIC_LIBRARY_PREFIX}${DNNL_GPU_LIBRARY_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") -+ set(ONEDNN_GPU_LIB_PATH ${ONEDNN_INSTALL_DIR}/lib/${onednn_gpu_lib} CACHE FILEPATH "Path to oneDNN GPU library") -+ - ExternalProject_Add(onednn_gpu_build -+ # Directory Options: -+ PREFIX "${ONEDNN_PREFIX_DIR}" - SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/onednn_gpu" - BINARY_DIR "${ONEDNN_BUILD_DIR}" - INSTALL_DIR "${ONEDNN_INSTALL_DIR}" -- PREFIX "${ONEDNN_PREFIX_DIR}" -- EXCLUDE_FROM_ALL ON -- CMAKE_CACHE_ARGS -- # The arguments below requires list to be passed as argument -- # which doesn't work properly when passed to CMAKE_ARGS. -- # Thus we pass it via CMAKE_CACHE_ARGS -- "-DDNNL_ENABLE_PRIMITIVE:STRING=${ONEDNN_ENABLED_PRIMITIVES}" -- "-DDNNL_ENABLE_PRIMITIVE_GPU_ISA:STRING=${ONEDNN_ENABLED_ISA}" -+ # Configure Step Options: - CMAKE_ARGS - ${cmake_extra_args} - "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" -@@ -112,9 +103,8 @@ if(ENABLE_ONEDNN_FOR_GPU) - "-DDNNL_TARGET_ARCH=${ONEDNN_TARGET_ARCH}" - "-DDNNL_CPU_RUNTIME=NONE" - "-DDNNL_GPU_RUNTIME=OCL" -- "-DDNNL_LIBRARY_NAME=openvino_onednn_gpu" -+ "-DDNNL_LIBRARY_NAME=${DNNL_GPU_LIBRARY_NAME}" - "-DCMAKE_INSTALL_PREFIX=${ONEDNN_INSTALL_DIR}" -- "-DCMAKE_INSTALL_LIBDIR=lib/$" - "-DDNNL_ENABLE_CONCURRENT_EXEC=ON" - "-DDNNL_ENABLE_PRIMITIVE_CACHE=OFF" - "-DDNNL_ENABLE_WORKLOAD=INFERENCE" -@@ -129,16 +119,38 @@ if(ENABLE_ONEDNN_FOR_GPU) - # specifically for Conan, because it overrides CMAKE_PREFIX_PATH and oneDNN's FindOpenCL.cmake is ignored - # Conan's FindOpenCL.cmake module does not set OpenCL_INCLUDE_DIRS, so we need to set it manually - "-DOpenCL_INCLUDE_DIRS=$" -+ # Conan calls cmake with default value for CMP0091, so we have to bypass it to oneDNN build -+ # because we bypass conan_toolchain.cmake via CMAKE_TOOLCHAIN_FILE -+ "-DCMAKE_POLICY_DEFAULT_CMP0091=NEW" -+ CMAKE_CACHE_ARGS -+ # The arguments below requires list to be passed as argument -+ # which doesn't work properly when passed to CMAKE_ARGS. -+ # Thus we pass it via CMAKE_CACHE_ARGS -+ "-DDNNL_ENABLE_PRIMITIVE:STRING=${ONEDNN_ENABLED_PRIMITIVES}" -+ "-DDNNL_ENABLE_PRIMITIVE_GPU_ISA:STRING=${ONEDNN_ENABLED_ISA}" -+ # Build Step Options: -+ BUILD_BYPRODUCTS ${ONEDNN_GPU_LIB_PATH} -+ # Target Options: -+ EXCLUDE_FROM_ALL ON - ) -+ - add_library(onednn_gpu_tgt INTERFACE) - set_target_properties(onednn_gpu_tgt PROPERTIES -- INTERFACE_LINK_DIRECTORIES "${ONEDNN_INSTALL_DIR}/lib/$" -- INTERFACE_LINK_LIBRARIES "openvino_onednn_gpu" -- INTERFACE_INCLUDE_DIRECTORIES "${ONEDNN_INSTALL_DIR}/include" -+ INTERFACE_LINK_LIBRARIES $ -+ INTERFACE_INCLUDE_DIRECTORIES $ - INTERFACE_COMPILE_DEFINITIONS ENABLE_ONEDNN_FOR_GPU - ) - add_dependencies(onednn_gpu_tgt onednn_gpu_build) -- # TODO: install onednn_gpu in static builds -+ -+ if(NOT BUILD_SHARED_LIBS) -+ ov_install_static_lib(onednn_gpu_tgt ${OV_CPACK_COMP_CORE}) -+ -+ # we need to install library explicitly and set_target_properties in OpenVINOConfig.cmake for 'onednn_gpu_tgt' -+ # to point to installation location of this file -+ install(FILES "${ONEDNN_GPU_LIB_PATH}" -+ DESTINATION ${OV_CPACK_ARCHIVEDIR} -+ COMPONENT ${OV_CPACK_COMP_CORE}) -+ endif() - endfunction() - build_onednn_gpu() - endif() -diff --git a/src/plugins/intel_gpu/thirdparty/cmake/rapidjson.cmake b/src/plugins/intel_gpu/thirdparty/cmake/rapidjson.cmake -new file mode 100644 -index 0000000000..655224dbc1 ---- /dev/null -+++ b/src/plugins/intel_gpu/thirdparty/cmake/rapidjson.cmake -@@ -0,0 +1,22 @@ -+# Copyright (C) 2018-2023 Intel Corporation -+# SPDX-License-Identifier: Apache-2.0 -+# -+ -+find_package(RapidJSON QUIET) -+ -+if(NOT TARGET rapidjson) -+ # sometimes RapidJSONConfig.cmake defines only RAPIDJSON_INCLUDE_DIRS -+ add_library(rapidjson INTERFACE) -+ -+ if(RapidJSON_FOUND) -+ if(TARGET RapidJSON) -+ target_link_libraries(rapidjson INTERFACE RapidJSON) -+ elseif(DEFINED RAPIDJSON_INCLUDE_DIRS) -+ target_include_directories(rapidjson INTERFACE $) -+ else() -+ message(FATAL_ERROR "RapidJSON does not define RAPIDJSON_INCLUDE_DIRS nor RapidJSON / rapidjson targets") -+ endif() -+ else() -+ target_include_directories(rapidjson INTERFACE $) -+ endif() -+endif() -diff --git a/src/plugins/template/backend/CMakeLists.txt b/src/plugins/template/backend/CMakeLists.txt -index 7530dd1688..a451fea900 100644 ---- a/src/plugins/template/backend/CMakeLists.txt -+++ b/src/plugins/template/backend/CMakeLists.txt -@@ -52,4 +52,4 @@ openvino_developer_export_targets(COMPONENT core TARGETS interpreter_backend) - - # install - --ov_install_static_lib(interpreter_backend template) -+ov_install_static_lib(interpreter_backend ${OV_CPACK_COMP_CORE}) -diff --git a/src/plugins/template/src/CMakeLists.txt b/src/plugins/template/src/CMakeLists.txt -index 2409bb10e0..f382f90d11 100644 ---- a/src/plugins/template/src/CMakeLists.txt -+++ b/src/plugins/template/src/CMakeLists.txt -@@ -28,7 +28,7 @@ target_include_directories(${TARGET_NAME} PRIVATE - "${CMAKE_CURRENT_SOURCE_DIR}" - "${TEMPLATE_PLUGIN_SOURCE_DIR}/include") - --# link common Inference Engine libraries -+# link common OpenVINO Runtime libraries - target_link_libraries(${TARGET_NAME} PRIVATE - openvino::interpreter_backend - openvino::reference) -@@ -42,4 +42,4 @@ endif() - # [cmake:plugin] - - install(TARGETS ${TARGET_NAME} -- LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) -+ LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) -diff --git a/thirdparty/ocl/CMakeLists.txt b/thirdparty/ocl/CMakeLists.txt -index f31519467f..0ebe3fd6d1 100644 ---- a/thirdparty/ocl/CMakeLists.txt -+++ b/thirdparty/ocl/CMakeLists.txt -@@ -58,4 +58,4 @@ set(opencl_root_hints "${OpenCL_INCLUDE_DIR}" PARENT_SCOPE) - - # installation - --ov_install_static_lib(OpenCL gpu) -+ov_install_static_lib(OpenCL ${OV_CPACK_COMP_CORE}) diff --git a/recipes/openvino/all/patches/2023.1.0/0004-fixed-gpu-plugin-with-clang.patch b/recipes/openvino/all/patches/2023.1.0/0004-fixed-gpu-plugin-with-clang.patch deleted file mode 100644 index 7659f10e22501..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0004-fixed-gpu-plugin-with-clang.patch +++ /dev/null @@ -1,2836 +0,0 @@ -diff --git a/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/binary_buffer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/binary_buffer.hpp -index 9386e52400..05972d7a97 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/binary_buffer.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/binary_buffer.hpp -@@ -104,12 +104,10 @@ public: - - #define ASSIGN_TYPE_NAME(cls_name) \ - namespace cldnn { \ -- const std::string cls_name::type_for_serialization = #cls_name; \ - } - - #define BIND_BINARY_BUFFER_WITH_TYPE(cls_name) \ - namespace cldnn { \ -- const std::string cls_name::type_for_serialization = #cls_name; \ - BIND_TO_BUFFER(BinaryOutputBuffer, cls_name) \ - BIND_TO_BUFFER(BinaryInputBuffer, cls_name) \ - } -diff --git a/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/bind.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/bind.hpp -index 85ed3fa803..e2a673f0ba 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/bind.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/bind.hpp -@@ -11,9 +11,12 @@ - #include "buffer.hpp" - #include "static_instance.hpp" - --#define DECLARE_OBJECT_TYPE_SERIALIZATION \ -- static const std::string type_for_serialization; \ -- std::string get_type() const override { return type_for_serialization; } -+#define DECLARE_OBJECT_TYPE_SERIALIZATION(cls_name) \ -+ static const std::string& get_type_info_s() { \ -+ static const std::string type_name = #cls_name; \ -+ return type_name; \ -+ } \ -+ const std::string& get_type_info() const override { return get_type_info_s(); } - - #define BIND_TO_BUFFER(buffer, type) \ - template <> \ -@@ -101,7 +104,7 @@ public: - - private: - buffer_binder() { -- saver_storage::instance().set_save_function({T::type_for_serialization, save}); -+ saver_storage::instance().set_save_function({T::get_type_info_s(), save}); - } - - buffer_binder(const buffer_binder&) = delete; -@@ -130,7 +133,7 @@ public: - private: - buffer_binder() { - def::instance().set_load_function( -- {T::type_for_serialization, [](BufferType& buffer, std::unique_ptr>& result_ptr) { -+ {T::get_type_info_s(), [](BufferType& buffer, std::unique_ptr>& result_ptr) { - std::unique_ptr derived_ptr = std::unique_ptr(new T()); - derived_ptr->load(buffer); - result_ptr.reset(derived_ptr.release()); -@@ -153,7 +156,7 @@ public: - private: - buffer_binder() { - dif::instance().set_load_function( -- {T::type_for_serialization, [](BufferType& buffer, std::unique_ptr>& result_ptr, engine& engine) { -+ {T::get_type_info_s(), [](BufferType& buffer, std::unique_ptr>& result_ptr, engine& engine) { - std::unique_ptr derived_ptr = std::unique_ptr(new T(engine)); - derived_ptr->load(buffer); - result_ptr.reset(derived_ptr.release()); -diff --git a/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/polymorphic_serializer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/polymorphic_serializer.hpp -index 023045b9bd..1792f5489c 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/polymorphic_serializer.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/polymorphic_serializer.hpp -@@ -18,7 +18,7 @@ template - class Serializer, typename std::enable_if, BufferType>::value>::type> { - public: - static void save(BufferType& buffer, const std::unique_ptr& ptr) { -- const auto& type = ptr->get_type(); -+ const auto& type = ptr->get_type_info(); - buffer << type; - const auto save_func = saver_storage::instance().get_save_function(type); - save_func(buffer, ptr.get()); -@@ -51,7 +51,7 @@ template - class Serializer, typename std::enable_if, BufferType>::value>::type> { - public: - static void save(BufferType& buffer, const std::shared_ptr& ptr) { -- const std::string& type = ptr->get_type(); -+ const std::string& type = ptr->get_type_info(); - buffer << type; - if (type.compare("NONE") != 0) { - const auto save_func = saver_storage::instance().get_save_function(type); -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/activation.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/activation.hpp -index 09a3f96a98..771f1b9191 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/activation.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/activation.hpp -@@ -82,8 +82,6 @@ struct activation : public primitive_base { - activation_function(activation_func::none), - additional_params({0.f, 0.f}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs Relu primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/adaptive_pooling.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/adaptive_pooling.hpp -index e54b055312..f80d7b3c62 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/adaptive_pooling.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/adaptive_pooling.hpp -@@ -20,8 +20,6 @@ struct adaptive_pooling : public primitive_base { - mode{adaptive_pooling_mode::average}, - output_size{} {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs AdaptiveAvgPooling primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/arg_max_min.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/arg_max_min.hpp -index 16ca38e746..418f8df90d 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/arg_max_min.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/arg_max_min.hpp -@@ -27,8 +27,6 @@ struct arg_max_min : public primitive_base { - values_first(false), - stable(false) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs arg_max_min primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/assign.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/assign.hpp -index 1c4021a77d..4134614504 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/assign.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/assign.hpp -@@ -17,8 +17,6 @@ struct assign : public primitive_base { - - assign() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs Assign primitive. - /// @param id This primitive id - /// @param inputs Input parameters ids -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/batch_to_space.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/batch_to_space.hpp -index fab49940fb..246853a5f3 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/batch_to_space.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/batch_to_space.hpp -@@ -42,8 +42,6 @@ struct batch_to_space : public primitive_base { - - batch_to_space() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs batch_to_space primitive. - /// @param id This primitive id. - /// @param input Input data primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/binary_convolution.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/binary_convolution.hpp -index 268f78e73a..5ba028bda7 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/binary_convolution.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/binary_convolution.hpp -@@ -16,8 +16,6 @@ struct binary_convolution : public primitive_base { - - binary_convolution() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs binary_convolution primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/border.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/border.hpp -index def9b956ff..81ad97a196 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/border.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/border.hpp -@@ -26,8 +26,6 @@ struct border : public primitive_base { - - border() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief whether the input is const or not - enum PAD_NON_CONST_INPUT { - BEGIN = 0x1, -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/broadcast.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/broadcast.hpp -index 3b210c7b94..d3b17919a4 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/broadcast.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/broadcast.hpp -@@ -56,8 +56,6 @@ struct broadcast : public primitive_base { - - broadcast() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs broadcast primitive / layer. - /// - /// @param id An identifier of new primitive. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/bucketize.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/bucketize.hpp -index 11e7f8752e..dd5b8f3d93 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/bucketize.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/bucketize.hpp -@@ -13,8 +13,6 @@ struct bucketize : primitive_base { - - bucketize() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs bucketize primitive. - /// @param id This primitive id. - /// @param inputs Input primitives ids. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/concatenation.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/concatenation.hpp -index 184dbf9ceb..5f187c7422 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/concatenation.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/concatenation.hpp -@@ -35,8 +35,6 @@ struct concatenation : public primitive_base { - - concatenation() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @li Constructs concatenation primitive. - /// @param id This primitive id. - /// @param input Vector of input primitives ids. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/convert_color.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/convert_color.hpp -index f1cd6e1934..f71e73310a 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/convert_color.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/convert_color.hpp -@@ -14,8 +14,6 @@ struct convert_color : public primitive_base { - - convert_color() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - enum color_format : uint32_t { - RGB, ///< RGB color format - BGR, ///< BGR color format, default in OpenVINO -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/convolution.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/convolution.hpp -index 01291816b1..0a15e6a146 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/convolution.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/convolution.hpp -@@ -15,8 +15,6 @@ struct convolution : public primitive_base { - - convolution() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs convolution primitive - /// @param id This primitive id. - /// @param input Input primitive id. -@@ -313,8 +311,6 @@ struct deformable_interp : public primitive_base { - - deformable_interp() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - deformable_interp(const primitive_id& id, - const std::vector& inputs, - uint32_t groups, -@@ -430,8 +426,6 @@ struct deformable_conv : public primitive_base { - - deformable_conv() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - deformable_conv(const primitive_id& id, - const input_info& input, - const std::vector& weights, -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/crop.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/crop.hpp -index 5c944b75d1..b8935695b2 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/crop.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/crop.hpp -@@ -46,8 +46,6 @@ struct crop : public primitive_base { - - crop() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs crop primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_greedy_decoder.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_greedy_decoder.hpp -index 9c911243d5..2cf19ca58c 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_greedy_decoder.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_greedy_decoder.hpp -@@ -13,8 +13,6 @@ struct ctc_greedy_decoder : public primitive_base { - - ctc_greedy_decoder() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs ctc_greedy_decoder primitive. - /// @param id This primitive id. - /// @param input Input primitive id (input, sequence_indicators, second_output(optional)). -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_loss.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_loss.hpp -index 0d63027cf7..55cc934195 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_loss.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/ctc_loss.hpp -@@ -15,8 +15,6 @@ struct ctc_loss : primitive_base { - - ctc_loss() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs ctc_loss primitive. - /// @param id This primitive id. - /// @param inputs Input primitives ids. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/cum_sum.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/cum_sum.hpp -index 4a038714d7..11bd653d4c 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/cum_sum.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/cum_sum.hpp -@@ -6,15 +6,11 @@ - #include "primitive.hpp" - - namespace cldnn { -- -- - struct cum_sum : public primitive_base { - CLDNN_DECLARE_PRIMITIVE(cum_sum) - - cum_sum() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs cum_sum primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/custom_gpu_primitive.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/custom_gpu_primitive.hpp -index a938e2c0ff..62dafc4ce4 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/custom_gpu_primitive.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/custom_gpu_primitive.hpp -@@ -18,8 +18,6 @@ struct custom_gpu_primitive : public primitive_base { - - custom_gpu_primitive() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Custom primitive kernel argument type - enum arg_type { - arg_input, -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/data.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/data.hpp -index 8a89005102..177fbf99b7 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/data.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/data.hpp -@@ -17,8 +17,6 @@ struct data : public primitive_base { - - data() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs data primitive. - /// @param id This primitive id. - /// @param mem @ref memory object which contains data. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/deconvolution.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/deconvolution.hpp -index b149539bb6..5c507a2360 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/deconvolution.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/deconvolution.hpp -@@ -20,8 +20,6 @@ struct deconvolution : public primitive_base { - - deconvolution() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs deconvolution primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/depth_to_space.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/depth_to_space.hpp -index 6d1c430d91..577be63765 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/depth_to_space.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/depth_to_space.hpp -@@ -22,8 +22,6 @@ struct depth_to_space : public primitive_base { - - depth_to_space() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs depth_to_space primitive. - /// @param id This primitive id. - /// @param input Input dictionary primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/detection_output.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/detection_output.hpp -index 7437106428..3c39a83963 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/detection_output.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/detection_output.hpp -@@ -42,8 +42,6 @@ struct detection_output : public primitive_base { - clip_after_nms(false), - objectness_score(0.0f) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs detection output primitive. - /// @param id This primitive id. - /// @param inputs Inputs for primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/dft.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/dft.hpp -index 45042ad94b..329794e088 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/dft.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/dft.hpp -@@ -29,8 +29,6 @@ struct dft : public primitive_base { - - dft() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs DFT primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/eltwise.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/eltwise.hpp -index de1e4138c3..b4b9e8932d 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/eltwise.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/eltwise.hpp -@@ -71,8 +71,6 @@ struct eltwise : public primitive_base { - - eltwise() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs eltwise primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/embedding_bag.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/embedding_bag.hpp -index c749c3b5e2..29b3259b50 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/embedding_bag.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/embedding_bag.hpp -@@ -14,8 +14,6 @@ struct embedding_bag : public primitive_base { - - embedding_bag() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Select type of embedding_bag operation - enum embedding_bag_type { - packed_sum, -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_detection_output.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_detection_output.hpp -index cb47ec86f5..f87b161e48 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_detection_output.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_detection_output.hpp -@@ -16,8 +16,6 @@ struct experimental_detectron_detection_output : public primitive_base { -@@ -17,8 +15,6 @@ struct experimental_detectron_prior_grid_generator - - experimental_detectron_prior_grid_generator() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - experimental_detectron_prior_grid_generator(const primitive_id& id, - const std::vector& inputs, - bool flatten, -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_roi_feature_extractor.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_roi_feature_extractor.hpp -index a9b27fd16f..3a1e229171 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_roi_feature_extractor.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/experimental_detectron_roi_feature_extractor.hpp -@@ -14,8 +14,6 @@ struct experimental_detectron_roi_feature_extractor : public primitive_base { -@@ -19,8 +17,6 @@ struct experimental_detectron_topk_rois : public primitive_base { - - extract_image_patches() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs select primitive. - /// @param id This primitive id. - /// @param input Input primitive id containing input 4-D tensor. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/eye.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/eye.hpp -index 4137aaa2ec..9cc2c9e083 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/eye.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/eye.hpp -@@ -14,8 +14,6 @@ struct eye : public primitive_base { - - eye() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs eye primitive. - /// @param id This primitive id. - /// @param inputs List of primitive ids. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/fully_connected.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/fully_connected.hpp -index d71afd76f1..ba05829539 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/fully_connected.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/fully_connected.hpp -@@ -35,8 +35,6 @@ struct fully_connected : public primitive_base { - - fully_connected() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs fully connected layer. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather.hpp -index f754d47667..2a7dad7fe4 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather.hpp -@@ -16,8 +16,6 @@ struct gather : public primitive_base { - - gather() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs gather primitive. - /// @param id This primitive id. - /// @param dict Input dictionary primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_elements.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_elements.hpp -index 0287a76877..455a40a9ea 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_elements.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_elements.hpp -@@ -14,8 +14,6 @@ struct gather_elements : public primitive_base { - - gather_elements() : primitive_base("", {}), output_format({}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs gather_elements primitive. - /// @param id This primitive id. - /// @param data Input data primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_nd.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_nd.hpp -index 932fe0b167..a2c26b0545 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_nd.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_nd.hpp -@@ -14,8 +14,6 @@ struct gather_nd : public primitive_base { - - gather_nd() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs gather_nd primitive. - /// - /// @param id This primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_tree.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_tree.hpp -index 5ec3339801..082b4113ab 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_tree.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/gather_tree.hpp -@@ -15,8 +15,6 @@ struct gather_tree : public primitive_base { - - gather_tree() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs gather tree primitive / layer. - /// - /// @param id An identifier of new primitive. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/gemm.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/gemm.hpp -index 104b92571c..cef11bbb0b 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/gemm.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/gemm.hpp -@@ -27,8 +27,6 @@ struct gemm : public primitive_base { - - gemm() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs gemm layer. - /// @brief Primitive id containing first matrix - /// @brief Primitive id containing second matrix -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/generate_proposals.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/generate_proposals.hpp -index ab57e07d0d..3524c104fd 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/generate_proposals.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/generate_proposals.hpp -@@ -15,8 +15,6 @@ struct generate_proposals - - generate_proposals() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs generate_proposals primitive - /// @param id This primitive id - /// @param input_im_info image size info -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/grid_sample.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/grid_sample.hpp -index 700140c9d2..20e308e4aa 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/grid_sample.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/grid_sample.hpp -@@ -10,8 +10,6 @@ - #include "primitive.hpp" - - namespace cldnn { -- -- - using GridSampleOp = ov::op::v9::GridSample; - - /// @brief GridSample-9 primitive. -@@ -20,8 +18,6 @@ struct grid_sample : primitive_base { - - grid_sample() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs grid_sample primitive. - /// @param id This primitive id. - /// @param inputs Input primitives ids. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/grn.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/grn.hpp -index cda1ebe160..3b629bad91 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/grn.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/grn.hpp -@@ -13,8 +13,6 @@ struct grn : public primitive_base { - - grn() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs grn primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/input_layout.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/input_layout.hpp -index c13e89a3a5..5cbba06ca4 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/input_layout.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/input_layout.hpp -@@ -20,8 +20,6 @@ struct input_layout : public primitive_base { - - input_layout() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs input layout primitive. - /// @param id This primitive id. - /// @param layout Defines layout for the data will be passed to network. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/loop.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/loop.hpp -index 49af132862..c27a88e197 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/loop.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/loop.hpp -@@ -55,8 +55,6 @@ struct loop : public primitive_base { - loop() : primitive_base("", {}), - max_iteration(0) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - struct io_primitive_map { - /// @brief Constructs a mapping from external input/output primitive to input/output primitive in body topology - /// -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/lrn.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/lrn.hpp -index 28bcf69147..f8cc1672e7 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/lrn.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/lrn.hpp -@@ -6,8 +6,6 @@ - #include "primitive.hpp" - - namespace cldnn { -- -- - typedef enum { /*:int32_t*/ - lrn_norm_region_across_channel, - lrn_norm_region_within_channel -@@ -29,8 +27,6 @@ struct lrn : public primitive_base { - - lrn() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs LRN primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm.hpp -index 7c601158d8..71922acd21 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm.hpp -@@ -53,8 +53,6 @@ struct lstm : public primitive_base { - - lstm() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs lstm layer. - /// @param id This primitive id. - /// @param input Vector of primitive id. -@@ -230,8 +228,6 @@ struct lstm_gemm : public primitive_base { - lstm_gemm() : primitive_base("", {}), - direction(0) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs lstm layer. - /// @param id This primitive id. - /// @param input input primitive id. -@@ -319,8 +315,6 @@ struct lstm_elt : public primitive_base { - - lstm_elt() : primitive_base("", {}), clip(0), input_forget(0), offset_order(lstm_weights_order::iofz), direction(0) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - using vec_activation = std::vector; - using vec_activation_param = std::vector; - -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic.hpp -index fd7e7c4a26..d459754ebc 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic.hpp -@@ -22,8 +22,6 @@ struct lstm_dynamic : public primitive_base { - - lstm_dynamic() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs lstm_dynamic layer. - /// @param id This primitive id. - /// @param input Primitive id of input layer. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_input.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_input.hpp -index bf0ddb2d43..6a8e90d9a4 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_input.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_input.hpp -@@ -22,8 +22,6 @@ struct lstm_dynamic_input : public primitive_base { - - lstm_dynamic_input() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs lstm_dynamic layer. - /// @param id This primitive id. - /// @param input Primitive id of input layer. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_timeloop.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_timeloop.hpp -index e5b5ea7661..ef184707f9 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_timeloop.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/lstm_dynamic_timeloop.hpp -@@ -23,8 +23,6 @@ struct lstm_dynamic_timeloop - - lstm_dynamic_timeloop() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs lstm_dynamic layer. - /// @param id This primitive id. - /// @param input Primitive id of input layer. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/matrix_nms.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/matrix_nms.hpp -index 72c95cae70..d4efea1d59 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/matrix_nms.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/matrix_nms.hpp -@@ -16,8 +16,6 @@ struct matrix_nms : public primitive_base { - - matrix_nms() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - enum decay_function { gaussian, linear }; - - enum sort_result_type { -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/multiclass_nms.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/multiclass_nms.hpp -index 5218488f1b..92ea0d371b 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/multiclass_nms.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/multiclass_nms.hpp -@@ -18,8 +18,6 @@ struct multiclass_nms : public primitive_base { - - multiclass_nms() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - enum class sort_result_type : int32_t { - classid, // sort selected boxes by class id (ascending) in each batch element - score, // sort selected boxes by score (descending) in each batch element -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/mutable_data.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/mutable_data.hpp -index 54c46bf785..105711b58d 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/mutable_data.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/mutable_data.hpp -@@ -18,8 +18,6 @@ struct mutable_data : public primitive_base { - - mutable_data() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Enum type to specify function for data filling. - enum filler_type { no_fill, zero, one, xavier }; - -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/mvn.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/mvn.hpp -index 72daa005b6..72e5cd67d9 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/mvn.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/mvn.hpp -@@ -14,8 +14,6 @@ struct mvn : public primitive_base { - - mvn() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs mvn primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/non_max_suppression.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/non_max_suppression.hpp -index b7aafffb55..b9614cd472 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/non_max_suppression.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/non_max_suppression.hpp -@@ -22,8 +22,6 @@ struct non_max_suppression : public primitive_base { - center_point_box(false), - sort_result_descending(false) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Creates non max suppression primitive. - /// @param id This primitive id. - /// @param boxes_positions Id of primitive with bounding boxes. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/non_zero.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/non_zero.hpp -index d243058bad..0fa4b35ff7 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/non_zero.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/non_zero.hpp -@@ -13,8 +13,6 @@ struct count_nonzero : public primitive_base { - - count_nonzero() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs count_nonzero primitive. - /// @param id This primitive id. - /// @param data Input data primitive id. -@@ -33,8 +31,6 @@ struct gather_nonzero : public primitive_base { - - gather_nonzero() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs gather_nonzero primitive. - /// @param id This primitive id. - /// @param data Input data primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/normalize.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/normalize.hpp -index b17c659d76..0f25272bce 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/normalize.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/normalize.hpp -@@ -29,8 +29,6 @@ struct normalize : public primitive_base { - - normalize() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs normalize primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/one_hot.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/one_hot.hpp -index 3a2958a0fb..b94e069fc2 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/one_hot.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/one_hot.hpp -@@ -35,8 +35,6 @@ struct one_hot : public primitive_base { - - one_hot() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs one-hot primitive layer. - /// @param id An identifier of new primitive. - /// @param input An identifier of primitive which is an input for newly created one-hot primitive. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/permute.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/permute.hpp -index 587427e6a8..91bc12df87 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/permute.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/permute.hpp -@@ -21,8 +21,6 @@ struct permute : public primitive_base { - - permute() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs permute primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/pooling.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/pooling.hpp -index 0db15d2278..df49ba46a9 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/pooling.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/pooling.hpp -@@ -34,8 +34,6 @@ struct pooling : public primitive_base { - - pooling() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs pooling primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp -index f68aa5f6c3..0bbf589b0d 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp -@@ -203,7 +203,7 @@ public: - - size_t num_outputs; - -- virtual std::string get_type() const { return "NONE"; } -+ virtual const std::string& get_type_info() const = 0; - virtual void save(BinaryOutputBuffer& ob) const { - ob << type_string(); - ob << id; -@@ -313,6 +313,7 @@ struct primitive_info { - } - - #define CLDNN_DECLARE_PRIMITIVE(PType) \ -+ DECLARE_OBJECT_TYPE_SERIALIZATION(PType) \ - CLDNN_DEFINE_TYPE_ID(PType) \ - CLDNN_DEFINE_TYPE_STRING(PType) - -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/prior_box.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/prior_box.hpp -index 959e6b14f0..3f78605f49 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/prior_box.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/prior_box.hpp -@@ -23,8 +23,6 @@ struct prior_box : public primitive_base { - - prior_box() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - using PriorBoxV0Op = ov::op::v0::PriorBox; - using PriorBoxV8Op = ov::op::v8::PriorBox; - using PriorBoxClusteredOp = ov::op::v0::PriorBoxClustered; -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/proposal.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/proposal.hpp -index 1278d4ff6f..a1e6768276 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/proposal.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/proposal.hpp -@@ -10,8 +10,6 @@ - #include "intel_gpu/graph/serialization/vector_serializer.hpp" - - namespace cldnn { -- -- - #define CLDNN_ROI_VECTOR_SIZE 5 - - struct proposal : public primitive_base { -@@ -37,8 +35,6 @@ struct proposal : public primitive_base { - shift_anchors(false), - normalize(false) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - proposal(const primitive_id& id, - const input_info& cls_scores, - const input_info& bbox_pred, -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/pyramid_roi_align.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/pyramid_roi_align.hpp -index 6d9842227a..123faf83f2 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/pyramid_roi_align.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/pyramid_roi_align.hpp -@@ -26,8 +26,6 @@ struct pyramid_roi_align : public primitive_base { - - pyramid_roi_align() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @param id This primitive id. - /// @param rois Input RoI boxes as tuple [x1, y1, x2, y2] describing two opposite corners of the region. - /// @param P2 First level of the image pyramid. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/quantize.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/quantize.hpp -index bb5de80742..a2bb5ae3cf 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/quantize.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/quantize.hpp -@@ -38,8 +38,6 @@ struct quantize : public primitive_base { - - quantize() : primitive_base("", {}), levels(0) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief levels The number of quantization levels. - int levels; - -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/random_uniform.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/random_uniform.hpp -index 02c86cb80d..598d8171b5 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/random_uniform.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/random_uniform.hpp -@@ -10,8 +10,6 @@ - - namespace cldnn { - -- -- - /// @brief RandomUniform-8 primitive - /// @details - struct random_uniform : public primitive_base { -@@ -22,8 +20,6 @@ struct random_uniform : public primitive_base { - op_seed(0), - output_shape{} {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /** - * Construct Random Uniform privitive. - * @param id primitive id -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/range.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/range.hpp -index 005d74a6c8..3d68fd2815 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/range.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/range.hpp -@@ -12,8 +12,6 @@ struct range: public primitive_base { - - range() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs range primitive. - /// @param id This primitive id. - /// @param inputs Input primitive id vector. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/read_value.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/read_value.hpp -index 9523b416cd..095c845d07 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/read_value.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/read_value.hpp -@@ -17,8 +17,6 @@ struct read_value : public primitive_base { - - read_value() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs ReadValue primitive. - /// @param id This primitive id - /// @param inputs Input parameters ids -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/reduce.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/reduce.hpp -index 7af0ad1dd9..c1f687e48a 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/reduce.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/reduce.hpp -@@ -44,8 +44,6 @@ struct reduce : public primitive_base { - - reduce() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs reduce primitive - /// @param id This primitive id - /// @param input Input primitive id -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/region_yolo.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/region_yolo.hpp -index 7efddc3fb4..d9040d1dc2 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/region_yolo.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/region_yolo.hpp -@@ -16,8 +16,6 @@ struct region_yolo : public primitive_base { - - region_yolo() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs region_yolo primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/reorder.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/reorder.hpp -index 1c59eebe65..7b2ada5d77 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/reorder.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/reorder.hpp -@@ -69,8 +69,6 @@ struct reorder : public primitive_base { - output_format(format::any), - mean_mode(reorder_mean_mode::subtract) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief reorder memory types - enum class memory_type { - buffer, -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/reorg_yolo.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/reorg_yolo.hpp -index b5d76e9353..96eff0012e 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/reorg_yolo.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/reorg_yolo.hpp -@@ -16,8 +16,6 @@ struct reorg_yolo : public primitive_base { - - reorg_yolo() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs region_yolo primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/resample.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/resample.hpp -index b95ce3c5e0..59f58c986b 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/resample.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/resample.hpp -@@ -17,8 +17,6 @@ struct resample : public primitive_base { - - resample() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - using InterpolateOp = ov::op::util::InterpolateBase; - - /// @brief Constructs Resample primitive. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/reshape.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/reshape.hpp -index 0f9869a2f7..00e8d9a093 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/reshape.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/reshape.hpp -@@ -17,8 +17,6 @@ struct reshape : public primitive_base { - - reshape() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - enum reshape_mode : uint32_t { - base, - squeeze, -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse.hpp -index 0ecb598550..70864a9f1e 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse.hpp -@@ -15,8 +15,6 @@ struct reverse : public primitive_base { - - reverse() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs reverse primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse_sequence.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse_sequence.hpp -index 8058bd3a45..714e0f4a49 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse_sequence.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/reverse_sequence.hpp -@@ -15,8 +15,6 @@ struct reverse_sequence : public primitive_base { - - reverse_sequence() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs reverse_sequence primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_align.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_align.hpp -index 14b031d87f..0813c960f0 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_align.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_align.hpp -@@ -15,8 +15,6 @@ struct roi_align : public primitive_base { - - roi_align() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Pooling mode for the @ref roi_align - enum PoolingMode { max, avg }; - -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_pooling.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_pooling.hpp -index ef7fc25664..2dd22e52d3 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_pooling.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/roi_pooling.hpp -@@ -8,8 +8,6 @@ - #include - - namespace cldnn { -- -- - struct roi_pooling : public primitive_base { - CLDNN_DECLARE_PRIMITIVE(roi_pooling) - -@@ -27,8 +25,6 @@ struct roi_pooling : public primitive_base { - spatial_bins_x(1), - spatial_bins_y(1) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - roi_pooling(const primitive_id& id, - const input_info& input_data, - const input_info& input_rois, -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/roll.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/roll.hpp -index 3ae8fc634e..3db154bf47 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/roll.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/roll.hpp -@@ -15,8 +15,6 @@ struct roll : primitive_base { - - roll() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs roll primitive. - /// @param id This primitive id. - /// @param input Input primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_elements_update.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_elements_update.hpp -index fa2cd6e07b..4b823a165c 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_elements_update.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_elements_update.hpp -@@ -14,8 +14,6 @@ struct scatter_elements_update : public primitive_base - - scatter_elements_update() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs scatter_elements_update primitive. - /// @param id This primitive id. - /// @param dict Input data primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_nd_update.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_nd_update.hpp -index f21691c3c7..1cc8746e9e 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_nd_update.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_nd_update.hpp -@@ -14,8 +14,6 @@ struct scatter_nd_update : public primitive_base { - - scatter_nd_update() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - /// @brief Constructs scatter_nd_update primitive. - /// @param id This primitive id. - /// @param dict Input data primitive id. -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_update.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_update.hpp -index 9563fe079e..17c09a8d8e 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_update.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/scatter_update.hpp -@@ -14,8 +14,6 @@ struct scatter_update : public primitive_base { - - scatter_update() : primitive_base("", {}) {} - -- DECLARE_OBJECT_TYPE_SERIALIZATION -- - enum scatter_update_axis { - along_b, - along_f, -diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/select.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/select.hpp -index 310c5ff2cb..0959fa2709 100644 ---- a/src/plugins/intel_gpu/include/intel_gpu/primitives/select.hpp -+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/select.hpp -@@ -22,8 +22,6 @@ struct select : public primitive_base { - using kernel_selector_t = kernel_selector::select_kernel_selector; - using kernel_params_t = std::pair; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::select_impl) - - std::unique_ptr clone() const override { - return make_unique(*this); -diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/shape_of.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/shape_of.cpp -index 02efeee00f..b2efd25f67 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/ocl/shape_of.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/ocl/shape_of.cpp -@@ -17,7 +17,7 @@ struct shape_of_impl : typed_primitive_impl_ocl { - using kernel_selector_t = kernel_selector::shape_of_kernel_selector; - using kernel_params_t = std::pair; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::shape_of_impl) - - std::unique_ptr clone() const override { - return make_unique(*this); -diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/shuffle_channels.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/shuffle_channels.cpp -index 57ac2437f4..e40b1b99b8 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/ocl/shuffle_channels.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/ocl/shuffle_channels.cpp -@@ -17,7 +17,7 @@ struct shuffle_channels_impl : typed_primitive_impl_ocl { - using kernel_selector_t = kernel_selector::shuffle_channels_kernel_selector; - using kernel_params_t = std::pair; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::shuffle_channels_impl) - - std::unique_ptr clone() const override { - return make_unique(*this); -diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/slice.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/slice.cpp -index 07ea912d06..d7f7f9ba74 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/ocl/slice.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/ocl/slice.cpp -@@ -72,7 +72,7 @@ struct slice_impl : typed_primitive_impl_ocl { - kInputsNum - }; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::slice_impl) - - std::unique_ptr clone() const override { - return make_unique(*this); -diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/softmax.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/softmax.cpp -index b4029ac3b3..6ad4e1d087 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/ocl/softmax.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/ocl/softmax.cpp -@@ -39,7 +39,7 @@ struct softmax_impl : typed_primitive_impl_ocl { - using kernel_selector_t = kernel_selector::softmax_kernel_selector; - using kernel_params_t = std::pair; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::softmax_impl) - - std::unique_ptr clone() const override { - return make_unique(*this); -diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_batch.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_batch.cpp -index 141116e04b..c9db851175 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_batch.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_batch.cpp -@@ -16,7 +16,7 @@ struct space_to_batch_impl : typed_primitive_impl_ocl { - using kernel_selector_t = kernel_selector::space_to_batch_kernel_selector; - using kernel_params_t = std::pair; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::space_to_batch_impl) - - std::unique_ptr clone() const override { - return make_unique(*this); -diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_depth.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_depth.cpp -index ec87100f89..5b72a5572c 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_depth.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_depth.cpp -@@ -16,7 +16,7 @@ struct space_to_depth_impl : typed_primitive_impl_ocl { - using kernel_selector_t = kernel_selector::space_to_depth_kernel_selector; - using kernel_params_t = std::pair; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::space_to_depth_impl) - - std::unique_ptr clone() const override { - return make_unique(*this); -diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp -index f06ae1b72d..e64498f73f 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp -@@ -46,7 +46,7 @@ struct strided_slice_impl : typed_primitive_impl_ocl { - using kernel_selector_t = kernel_selector::strided_slice_kernel_selector; - using kernel_params_t = std::pair; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::strided_slice_impl) - - std::unique_ptr clone() const override { - return make_unique(*this); -diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/tile.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/tile.cpp -index 16d2dd91cb..bc95a18f54 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/ocl/tile.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/ocl/tile.cpp -@@ -17,7 +17,7 @@ struct tile_impl : typed_primitive_impl_ocl { - using kernel_selector_t = kernel_selector::tile_kernel_selector; - using kernel_params_t = std::pair; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::tile_impl) - - std::unique_ptr clone() const override { - return make_unique(*this); -diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/unique.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/unique.cpp -index 7018ae66a2..604619c30b 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/ocl/unique.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/ocl/unique.cpp -@@ -17,7 +17,7 @@ struct unique_count_impl : typed_primitive_impl_ocl { - using kernel_params_t = - std::pair; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::unique_count_impl) - - std::unique_ptr clone() const override { - return make_unique(*this); -@@ -88,7 +88,7 @@ struct unique_gather_impl : typed_primitive_impl_ocl { - using kernel_params_t = - std::pair; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::unique_gather) - - std::unique_ptr clone() const override { - return make_unique(*this); -diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/concatenation_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/concatenation_onednn.cpp -index ed5565504f..325afd5f3c 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/onednn/concatenation_onednn.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/onednn/concatenation_onednn.cpp -@@ -21,7 +21,7 @@ struct concatenation_onednn : typed_primitive_onednn_impl; - using parent::parent; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::concatenation_onednn) - - protected: - std::unique_ptr clone() const override { -diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/convolution_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/convolution_onednn.cpp -index 1a27f3ae29..f1d1ab0a6c 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/onednn/convolution_onednn.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/onednn/convolution_onednn.cpp -@@ -26,7 +26,7 @@ struct convolution_onednn : typed_primitive_onednn_impl { - using parent = typed_primitive_onednn_impl; - using parent::parent; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::convolution_onednn) - - protected: - std::unique_ptr clone() const override { -diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/deconvolution_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/deconvolution_onednn.cpp -index 439b74feff..1702738598 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/onednn/deconvolution_onednn.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/onednn/deconvolution_onednn.cpp -@@ -22,7 +22,7 @@ struct deconvolution_onednn : typed_primitive_onednn_impl { - using parent = typed_primitive_onednn_impl; - using parent::parent; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::deconvolution_onednn) - - protected: - std::unique_ptr clone() const override { -diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/fully_connected_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/fully_connected_onednn.cpp -index 4aacb2ebd5..8ee6979dec 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/onednn/fully_connected_onednn.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/onednn/fully_connected_onednn.cpp -@@ -19,7 +19,7 @@ struct fully_connected_onednn : typed_primitive_onednn_impl { - using parent = typed_primitive_onednn_impl; - using parent::parent; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::fully_connected_onednn) - - private: - static std::vector reshape_to_2d(const ov::PartialShape& shape, int64_t feature) { -diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/gemm_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/gemm_onednn.cpp -index 7410f79961..87e7decb34 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/onednn/gemm_onednn.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/onednn/gemm_onednn.cpp -@@ -19,7 +19,7 @@ struct gemm_onednn : typed_primitive_onednn_impl { - using parent = typed_primitive_onednn_impl; - using parent::parent; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::gemm_onednn) - - protected: - std::unique_ptr clone() const override { -diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/pooling_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/pooling_onednn.cpp -index 52f0edc797..1dc686331b 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/onednn/pooling_onednn.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/onednn/pooling_onednn.cpp -@@ -19,7 +19,7 @@ struct pooling_onednn : typed_primitive_onednn_impl { - using parent = typed_primitive_onednn_impl; - using parent::parent; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::pooling_onednn) - - protected: - std::unique_ptr clone() const override { -diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/reduction_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/reduction_onednn.cpp -index 581c37c015..635d465fc5 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/onednn/reduction_onednn.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/onednn/reduction_onednn.cpp -@@ -41,7 +41,7 @@ struct reduction_onednn : typed_primitive_onednn_impl { - using parent = typed_primitive_onednn_impl; - using parent::parent; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::reduction_onednn) - - protected: - std::unique_ptr clone() const override { -diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp -index 284dd8b166..433e043067 100644 ---- a/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp -+++ b/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp -@@ -19,7 +19,7 @@ struct reorder_onednn : typed_primitive_onednn_impl; - using parent::parent; - -- DECLARE_OBJECT_TYPE_SERIALIZATION -+ DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::onednn::reorder_onednn) - - protected: - std::unique_ptr clone() const override { -diff --git a/src/plugins/intel_gpu/src/graph/include/primitive_inst.h b/src/plugins/intel_gpu/src/graph/include/primitive_inst.h -index 3244ad20b4..454c92ac97 100644 ---- a/src/plugins/intel_gpu/src/graph/include/primitive_inst.h -+++ b/src/plugins/intel_gpu/src/graph/include/primitive_inst.h -@@ -54,7 +54,7 @@ struct primitive_impl { - - virtual std::vector get_internal_buffer_layouts() const = 0; - virtual void set_node_params(const program_node&) {} -- virtual std::string get_type() const = 0; -+ virtual const std::string& get_type_info() const = 0; - virtual void set_arguments(primitive_inst& instance) = 0; - virtual void set_arguments(primitive_inst& instance, kernel_arguments_data& args) = 0; - virtual kernel_arguments_data get_arguments(const primitive_inst& instance) const = 0; diff --git a/recipes/openvino/all/patches/2023.1.0/0005-dynamic-protobuf.patch b/recipes/openvino/all/patches/2023.1.0/0005-dynamic-protobuf.patch deleted file mode 100644 index 50b087b4268b4..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0005-dynamic-protobuf.patch +++ /dev/null @@ -1,218 +0,0 @@ -diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake -index df3586474b..8e50b25ea3 100644 ---- a/cmake/developer_package/frontends/frontends.cmake -+++ b/cmake/developer_package/frontends/frontends.cmake -@@ -130,6 +130,10 @@ macro(ov_add_frontend) - foreach(INFILE IN LISTS proto_files) - get_filename_component(FILE_DIR ${INFILE} DIRECTORY) - get_filename_component(FILE_WE ${INFILE} NAME_WE) -+ if(FILE_WE MATCHES "^(any|wrappers)$") -+ # we need to skip standard protobuf files -+ continue() -+ endif() - set(OUTPUT_PB_SRC ${CMAKE_CURRENT_BINARY_DIR}/${FILE_WE}.pb.cc) - set(OUTPUT_PB_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${FILE_WE}.pb.h) - set(GENERATED_PROTO ${INFILE}) -diff --git a/src/frontends/common/src/manager.cpp b/src/frontends/common/src/manager.cpp -index 2fa59398b1..6194fca758 100644 ---- a/src/frontends/common/src/manager.cpp -+++ b/src/frontends/common/src/manager.cpp -@@ -20,11 +20,6 @@ class FrontEndManager::Impl { - std::mutex m_loading_mutex; - std::vector m_plugins; - -- /// \brief map of shared object per frontend -- static std::unordered_map> m_shared_objects_map; -- /// \brief Mutex to guard access the shared object map -- static std::mutex m_shared_objects_map_mutex; -- - public: - Impl() { - search_all_plugins(); -@@ -36,10 +31,6 @@ public: - auto fe_obj = std::make_shared(); - fe_obj->m_shared_object = std::make_shared(plugin.get_so_pointer()); - fe_obj->m_actual = plugin.get_creator().m_creator(); -- -- std::lock_guard guard(m_shared_objects_map_mutex); -- m_shared_objects_map.emplace(plugin.get_creator().m_name, fe_obj->m_shared_object); -- - return fe_obj; - } - -@@ -49,6 +40,7 @@ public: - {"ir", "ir"}, - {"onnx", "onnx"}, - {"tf", "tensorflow"}, -+ {"tflite", "tensorflow_lite"}, - {"paddle", "paddle"}, - {"pytorch", "pytorch"}, - }; -@@ -127,8 +119,8 @@ public: - } - - static void shutdown() { -- std::lock_guard guard(m_shared_objects_map_mutex); -- m_shared_objects_map.clear(); -+ std::lock_guard guard(get_shared_objects_mutex()); -+ get_shared_objects_map().clear(); - } - - private: -@@ -153,6 +145,7 @@ private: - {".xml", {"ir", "ir"}}, - {".onnx", {"onnx", "onnx"}}, - {".pb", {"tf", "tensorflow"}}, -+ {".pbtxt", {"tf", "tensorflow"}}, - {".tflite", {"tflite", "tensorflow_lite"}}, - {".pdmodel", {"paddle", "paddle"}}, - // {".ts", {"pytorch", "pytorch"}}, -@@ -223,9 +216,6 @@ private: - } - }; - --std::unordered_map> FrontEndManager::Impl::m_shared_objects_map{}; --std::mutex FrontEndManager::Impl::m_shared_objects_map_mutex{}; -- - FrontEndManager::FrontEndManager() : m_impl(new Impl()) {} - - FrontEndManager::FrontEndManager(FrontEndManager&&) noexcept = default; -diff --git a/src/frontends/common/src/plugin_loader.cpp b/src/frontends/common/src/plugin_loader.cpp -index a044152d8d..a98eff766b 100644 ---- a/src/frontends/common/src/plugin_loader.cpp -+++ b/src/frontends/common/src/plugin_loader.cpp -@@ -16,17 +16,32 @@ - - #include - --#include - #include - #include - - #include "openvino/util/file_util.hpp" -+#include "openvino/util/log.hpp" - #include "openvino/util/shared_object.hpp" - #include "plugin_loader.hpp" - - using namespace ov; - using namespace ov::frontend; - -+// Note, static methods below are required to create an order of initialization of static variables -+// e.g. if users (not encouraged) created ov::Model globally, we need to ensure proper order of initialization -+ -+/// \return map of shared object per frontend -+std::unordered_map>& ov::frontend::get_shared_objects_map() { -+ static std::unordered_map> shared_objects_map; -+ return shared_objects_map; -+} -+ -+/// \return Mutex to guard access the shared object map -+std::mutex& ov::frontend::get_shared_objects_mutex() { -+ static std::mutex shared_objects_map_mutex; -+ return shared_objects_map_mutex; -+} -+ - #ifdef OPENVINO_STATIC_LIBRARY - - # include "ov_frontends.hpp" -@@ -131,6 +146,10 @@ bool PluginInfo::load() { - m_load_failed = true; - return false; - } -+ -+ std::lock_guard guard(get_shared_objects_mutex()); -+ get_shared_objects_map().emplace(get_creator().m_name, get_so_pointer()); -+ - return true; - } - -diff --git a/src/frontends/common/src/plugin_loader.hpp b/src/frontends/common/src/plugin_loader.hpp -index 93e6a5cc2e..dccf8ddf7a 100644 ---- a/src/frontends/common/src/plugin_loader.hpp -+++ b/src/frontends/common/src/plugin_loader.hpp -@@ -4,7 +4,12 @@ - - #pragma once - --#include -+#include -+#include -+#include -+#include -+ -+#include "openvino/frontend/manager.hpp" - - #ifdef _WIN32 - static const char PathSeparator[] = ";"; -@@ -15,6 +20,9 @@ static const char PathSeparator[] = ":"; - namespace ov { - namespace frontend { - -+std::unordered_map>& get_shared_objects_map(); -+std::mutex& get_shared_objects_mutex(); -+ - /// \brief Internal data structure holding by each frontend. Includes library handle and extensions. - class FrontEndSharedData { - friend inline void add_extension_to_shared_data(std::shared_ptr& obj, -diff --git a/src/frontends/tensorflow/src/proto/meta_graph.proto b/src/frontends/tensorflow/src/proto/meta_graph.proto -index b6918fa853..c59c0680af 100644 ---- a/src/frontends/tensorflow/src/proto/meta_graph.proto -+++ b/src/frontends/tensorflow/src/proto/meta_graph.proto -@@ -14,7 +14,7 @@ syntax = "proto3"; - - package tensorflow; - --import "any.proto"; -+import "google/protobuf/any.proto"; - import "graph.proto"; - import "op_def.proto"; - import "tensor_shape.proto"; -diff --git a/src/frontends/tensorflow/src/proto/saved_object_graph.proto b/src/frontends/tensorflow/src/proto/saved_object_graph.proto -index 671441075c..3918a4a8d1 100644 ---- a/src/frontends/tensorflow/src/proto/saved_object_graph.proto -+++ b/src/frontends/tensorflow/src/proto/saved_object_graph.proto -@@ -14,7 +14,7 @@ syntax = "proto3"; - - package tensorflow; - --import "any.proto"; -+import "google/protobuf/any.proto"; - import "tensor_shape.proto"; - import "types.proto"; - import "variable.proto"; -diff --git a/src/frontends/tensorflow/src/proto/trackable_object_graph.proto b/src/frontends/tensorflow/src/proto/trackable_object_graph.proto -index f4a8e4da34..f0a9617432 100644 ---- a/src/frontends/tensorflow/src/proto/trackable_object_graph.proto -+++ b/src/frontends/tensorflow/src/proto/trackable_object_graph.proto -@@ -14,7 +14,7 @@ syntax = "proto3"; - - package tensorflow; - --import "wrappers.proto"; -+import "google/protobuf/wrappers.proto"; - - option cc_enable_arenas = true; - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto"; -diff --git a/thirdparty/dependencies.cmake b/thirdparty/dependencies.cmake -index 43e0ed671a..10042641e4 100644 ---- a/thirdparty/dependencies.cmake -+++ b/thirdparty/dependencies.cmake -@@ -415,14 +415,14 @@ if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND - if(CMAKE_VERBOSE_MAKEFILE) - set(Protobuf_DEBUG ON) - endif() -- if(OV_VCPKG_BUILD) -- set(protobuf_config CONFIG) -- endif() - # try to find newer version first (major is changed) - # see https://protobuf.dev/support/version-support/ and - # https://github.com/protocolbuffers/protobuf/commit/d61f75ff6db36b4f9c0765f131f8edc2f86310fa -- find_package(Protobuf 4.22.0 QUIET ${protobuf_config}) -+ find_package(Protobuf 4.22.0 QUIET CONFIG) - if(NOT Protobuf_FOUND) -+ if(OV_VCPKG_BUILD) -+ set(protobuf_config CONFIG) -+ endif() - # otherwise, fallback to existing default - find_package(Protobuf 3.20.3 REQUIRED ${protobuf_config}) - endif() diff --git a/recipes/openvino/all/patches/2023.1.0/0006-macos-14.patch b/recipes/openvino/all/patches/2023.1.0/0006-macos-14.patch deleted file mode 100644 index 4184c1832cef3..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0006-macos-14.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/plugins/intel_cpu/src/nodes/mha.cpp b/src/plugins/intel_cpu/src/nodes/mha.cpp -index d4405be5d4..19cf63ac72 100644 ---- a/src/plugins/intel_cpu/src/nodes/mha.cpp -+++ b/src/plugins/intel_cpu/src/nodes/mha.cpp -@@ -16,6 +16,7 @@ - #include "common/cpu_convert.h" - #include "transformations/cpu_opset/x64/op/mha.hpp" - #include "dnnl_extension_utils.h" -+#include "utils/bfloat16.hpp" - #include - - using namespace InferenceEngine; diff --git a/recipes/openvino/all/patches/2023.1.0/0007-compilation-c++23.patch b/recipes/openvino/all/patches/2023.1.0/0007-compilation-c++23.patch deleted file mode 100644 index 552078a68bae7..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0007-compilation-c++23.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/src/core/src/type.cpp b/src/core/src/type.cpp -index 7d6aef2c46..c75d9a7476 100644 ---- a/src/core/src/type.cpp -+++ b/src/core/src/type.cpp -@@ -37,7 +37,7 @@ std::string DiscreteTypeInfo::get_version() const { - if (version_id) { - return std::string(version_id); - } -- return nullptr; -+ return {}; - } - - DiscreteTypeInfo::operator std::string() const { -diff --git a/src/frontends/onnx/frontend/src/ops_bridge.hpp b/src/frontends/onnx/frontend/src/ops_bridge.hpp -index bbd6bfd129..4e2d2edb2b 100644 ---- a/src/frontends/onnx/frontend/src/ops_bridge.hpp -+++ b/src/frontends/onnx/frontend/src/ops_bridge.hpp -@@ -5,6 +5,7 @@ - #pragma once - - #include -+#include - #include - #include - #include -diff --git a/src/inference/src/dev/make_tensor.cpp b/src/inference/src/dev/make_tensor.cpp -index 2e319c04c5..5e3fa241ea 100644 ---- a/src/inference/src/dev/make_tensor.cpp -+++ b/src/inference/src/dev/make_tensor.cpp -@@ -520,7 +520,7 @@ public: - } - - void allocate() noexcept override { -- if (ie::TBlob::buffer() != tensor->data()) { -+ if ((void*)ie::TBlob::buffer() != tensor->data()) { - ie::TBlob::_allocator = - ie::details::make_pre_allocator(static_cast(tensor->data()), tensor->get_byte_size()); - ie::TBlob::allocate(); diff --git a/recipes/openvino/all/patches/2024.1.0/0001-fix-cxxflags.patch b/recipes/openvino/all/patches/2024.1.0/0001-fix-cxxflags.patch new file mode 100644 index 0000000000000..ceabd157b9ce9 --- /dev/null +++ b/recipes/openvino/all/patches/2024.1.0/0001-fix-cxxflags.patch @@ -0,0 +1,25 @@ +diff --git a/cmake/developer_package/target_flags.cmake b/cmake/developer_package/target_flags.cmake +index d047a1aebd..7779b2fcf5 100644 +--- a/cmake/developer_package/target_flags.cmake ++++ b/cmake/developer_package/target_flags.cmake +@@ -118,8 +118,19 @@ function(ov_get_compiler_definition definition var) + message(FATAL_ERROR "Internal error: 'ov_get_definition' must be used only on Linux") + endif() + ++ get_directory_property(_user_defines COMPILE_DEFINITIONS) ++ foreach(_user_define IN LISTS _user_defines) ++ # older cmake versions keep -D at the beginning, trim it ++ string(REPLACE "-D" "" _user_define "${_user_define}") ++ list(APPEND _ov_user_flags "-D${_user_define}") ++ endforeach() ++ string(REPLACE " " ";" _user_cxx_flags "${CMAKE_CXX_FLAGS}") ++ foreach(_user_flag IN LISTS _user_cxx_flags) ++ list(APPEND _ov_user_flags ${_user_flag}) ++ endforeach() ++ + execute_process(COMMAND echo "#include " +- COMMAND "${CMAKE_CXX_COMPILER}" -x c++ - -E -dM ++ COMMAND "${CMAKE_CXX_COMPILER}" ${_ov_user_flags} -x c++ - -E -dM + COMMAND grep -E "^#define ${definition} " + OUTPUT_VARIABLE output_value + ERROR_VARIABLE error_message diff --git a/recipes/openvino/config.yml b/recipes/openvino/config.yml index c055e48da509b..511bd030e9af6 100644 --- a/recipes/openvino/config.yml +++ b/recipes/openvino/config.yml @@ -1,9 +1,9 @@ versions: + "2024.1.0": + folder: "all" "2024.0.0": folder: "all" "2023.3.0": folder: "all" "2023.2.0": folder: "all" - "2023.1.0": - folder: "all" diff --git a/recipes/opus/all/test_package/conanfile.py b/recipes/opus/all/test_package/conanfile.py index 642aa7eed877c..0a6bc68712d90 100644 --- a/recipes/opus/all/test_package/conanfile.py +++ b/recipes/opus/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - pcm_path = os.path.join(self.source_folder, "test.pcm") - self.run(f"{bin_path} {pcm_path} out.pcm", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/opus/all/test_package/test.pcm b/recipes/opus/all/test_package/test.pcm deleted file mode 100644 index f4d71f2770637..0000000000000 Binary files a/recipes/opus/all/test_package/test.pcm and /dev/null differ diff --git a/recipes/opus/all/test_package/test_package.c b/recipes/opus/all/test_package/test_package.c index a39ea4aacd883..3da6fd100efb6 100644 --- a/recipes/opus/all/test_package/test_package.c +++ b/recipes/opus/all/test_package/test_package.c @@ -1,159 +1,13 @@ -/* Copyright (c) 2013 Jean-Marc Valin */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* This is meant to be a simple example of encoding and decoding audio - using Opus. It should make it easy to understand how the Opus API - works. For more information, see the full API documentation at: - https://www.opus-codec.org/docs/ */ - -#include -#include -#include -#include #include +#include -/*The frame size is hardcoded for this sample code but it doesn't have to be*/ -#define FRAME_SIZE 960 -#define SAMPLE_RATE 48000 -#define CHANNELS 2 -#define APPLICATION OPUS_APPLICATION_AUDIO -#define BITRATE 64000 - -#define MAX_FRAME_SIZE 6*960 -#define MAX_PACKET_SIZE (3*1276) - -int main(int argc, char **argv) -{ - char *inFile; - FILE *fin; - char *outFile; - FILE *fout; - opus_int16 in[FRAME_SIZE*CHANNELS]; - opus_int16 out[MAX_FRAME_SIZE*CHANNELS]; - unsigned char cbits[MAX_PACKET_SIZE]; - int nbBytes; - /*Holds the state of the encoder and decoder */ - OpusEncoder *encoder; - OpusDecoder *decoder; - int err; - - if (argc != 3) - { - fprintf(stderr, "usage: trivial_example input.pcm output.pcm\n"); - fprintf(stderr, "input and output are 16-bit little-endian raw files\n"); - return EXIT_FAILURE; - } - - /*Create a new encoder state */ - encoder = opus_encoder_create(SAMPLE_RATE, CHANNELS, APPLICATION, &err); - if (err<0) - { - fprintf(stderr, "failed to create an encoder: %s\n", opus_strerror(err)); - return EXIT_FAILURE; - } - /* Set the desired bit-rate. You can also set other parameters if needed. - The Opus library is designed to have good defaults, so only set - parameters you know you need. Doing otherwise is likely to result - in worse quality, but better. */ - err = opus_encoder_ctl(encoder, OPUS_SET_BITRATE(BITRATE)); - if (err<0) - { - fprintf(stderr, "failed to set bitrate: %s\n", opus_strerror(err)); - return EXIT_FAILURE; - } - inFile = argv[1]; - fin = fopen(inFile, "r"); - if (fin==NULL) - { - fprintf(stderr, "failed to open input file: %s\n", strerror(errno)); - return EXIT_FAILURE; - } - - - /* Create a new decoder state. */ - decoder = opus_decoder_create(SAMPLE_RATE, CHANNELS, &err); - if (err<0) - { - fprintf(stderr, "failed to create decoder: %s\n", opus_strerror(err)); - return EXIT_FAILURE; - } - outFile = argv[2]; - fout = fopen(outFile, "w"); - if (fout==NULL) - { - fprintf(stderr, "failed to open output file: %s\n", strerror(errno)); - return EXIT_FAILURE; - } - - while (!feof(fin)) - { - int i; - unsigned char pcm_bytes[MAX_FRAME_SIZE*CHANNELS*2]; - int frame_size; - - /* Read a 16 bits/sample audio frame. */ - fread(pcm_bytes, sizeof(short)*CHANNELS, FRAME_SIZE, fin); - - /* Convert from little-endian ordering. */ - for (i=0;i>8)&0xFF; - } - /* Write the decoded audio to file. */ - fwrite(pcm_bytes, sizeof(short), frame_size*CHANNELS, fout); - } - /*Destroy the encoder state*/ - opus_encoder_destroy(encoder); - opus_decoder_destroy(decoder); - fclose(fin); - fclose(fout); - return EXIT_SUCCESS; + encoder = opus_encoder_create(rate, channels, application, &err); + opus_encoder_destroy(encoder); } diff --git a/recipes/opus/all/test_v1_package/conanfile.py b/recipes/opus/all/test_v1_package/conanfile.py index 9534054c99e3c..38f4483872d47 100644 --- a/recipes/opus/all/test_v1_package/conanfile.py +++ b/recipes/opus/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - pcm_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.pcm") - self.run(f"{bin_path} {pcm_path} out.pcm", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/orc/all/conandata.yml b/recipes/orc/all/conandata.yml index 52fa72322f304..93dd0aef42c8e 100644 --- a/recipes/orc/all/conandata.yml +++ b/recipes/orc/all/conandata.yml @@ -1,13 +1,19 @@ sources: "2.0.0": - url: "https://dlcdn.apache.org/orc/orc-2.0.0/orc-2.0.0.tar.gz" + url: "https://archive.apache.org/dist/orc/orc-2.0.0/orc-2.0.0.tar.gz" sha256: "9107730919c29eb39efaff1b9e36166634d1d4d9477e5fee76bfd6a8fec317df" + "1.9.3": + url: "https://archive.apache.org/dist/orc/orc-1.9.3/orc-1.9.3.tar.gz" + sha256: "f737d005d0c4deb65688ac3c0223ed530b0ba6258552555b2774dcdb77359b0f" "1.9.2": - url: "https://dlcdn.apache.org/orc/orc-1.9.2/orc-1.9.2.tar.gz" + url: "https://archive.apache.org/dist/orc/orc-1.9.2/orc-1.9.2.tar.gz" sha256: "7f46f2c184ecefd6791f1a53fb062286818bd8710c3f08b94dd3cac365e240ee" + "1.8.7": + url: "https://archive.apache.org/dist/orc/orc-1.8.7/orc-1.8.7.tar.gz" + sha256: "57c9d12bf74b2752b1ce1039c15035c3b6f6531d865df962a99b3e079b3dfdb7" "1.8.6": - url: "https://dlcdn.apache.org/orc/orc-1.8.6/orc-1.8.6.tar.gz" + url: "https://archive.apache.org/dist/orc/orc-1.8.6/orc-1.8.6.tar.gz" sha256: "5675b18118df4dd7f86cc6ba859ed75b425ea1b7ddff805e1d671a17fd57d7f7" "1.7.10": - url: "https://dlcdn.apache.org/orc/orc-1.7.10/orc-1.7.10.tar.gz" + url: "https://archive.apache.org/dist/orc/orc-1.7.10/orc-1.7.10.tar.gz" sha256: "85aef9368dc9bcdffaaf10010b66dfe053ce22f30b64854f63852248164686a3" diff --git a/recipes/orc/config.yml b/recipes/orc/config.yml index 956aa2a1d2506..ad011c33e6349 100644 --- a/recipes/orc/config.yml +++ b/recipes/orc/config.yml @@ -1,8 +1,12 @@ versions: "2.0.0": folder: all + "1.9.3": + folder: all "1.9.2": folder: all + "1.8.7": + folder: all "1.8.6": folder: all "1.7.10": diff --git a/recipes/ouster_sdk/all/conandata.yml b/recipes/ouster_sdk/all/conandata.yml new file mode 100644 index 0000000000000..42f0c9762b0b9 --- /dev/null +++ b/recipes/ouster_sdk/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + # The C++ library uses a separate versioning scheme from the overall releases + "0.11.0": + url: "https://github.com/ouster-lidar/ouster_example/archive/refs/tags/20240425.tar.gz" + sha256: "f4f38f6787021e697633f2c290c95b544af81d388a18cb9f790234d4f592caf0" + "0.10.0": + url: "https://github.com/ouster-lidar/ouster_example/archive/refs/tags/20231031.tar.gz" + sha256: "150482d28930308ef089233f3d4eb15d1330727a167aad3f9b2190078dcecfbf" +patches: + "0.11.0": + - patch_file: "patches/001-579-fix-cpp20-string-error.patch" + patch_type: "portability" + patch_description: "Fix non-const string issue with C++20" + patch_source: "https://github.com/ouster-lidar/ouster_example/pull/579" + "0.10.0": + - patch_file: "patches/001-579-fix-cpp20-string-error.patch" + patch_type: "portability" + patch_description: "Fix non-const string issue with C++20" + patch_source: "https://github.com/ouster-lidar/ouster_example/pull/579" diff --git a/recipes/ouster_sdk/all/conanfile.py b/recipes/ouster_sdk/all/conanfile.py new file mode 100644 index 0000000000000..2c133d0062741 --- /dev/null +++ b/recipes/ouster_sdk/all/conanfile.py @@ -0,0 +1,223 @@ +import os + +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import get, copy, rmdir, rm, save, replace_in_file, export_conandata_patches, apply_conandata_patches +from conan.tools.scm import Version + +required_conan_version = ">=1.60.0 <2.0 || >=2.0.6" + +class OusterSdkConan(ConanFile): + name = "ouster_sdk" + description = "Ouster SDK - tools for working with Ouster Lidars" + license = "BSD 3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ouster-lidar/ouster_example" + topics = ("ouster", "lidar", "driver", "hardware", "point cloud", "3d", "robotics", "automotive") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_osf": [True, False], + "build_pcap": [True, False], + "build_viz": [True, False], + "eigen_max_align_bytes": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_osf": True, + "build_pcap": True, + "build_viz": False, + "eigen_max_align_bytes": False, + } + options_description = { + "build_osf": "Build Ouster OSF library.", + "build_pcap": "Build pcap utils.", + "build_viz": "Build Ouster visualizer.", + "eigen_max_align_bytes": "Force maximum alignment of Eigen data to 32 bytes.", + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "5", + "apple-clang": "10", + "msvc": "191", + "Visual Studio": "15", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if conan_version.major == 1: + # Turning off by default due to perpetually missing libtins binaries on CCI + self.options.build_pcap = False + self.options.build_osf = False + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # Used in ouster/types.h + self.requires("eigen/3.4.0", transitive_headers=True) + # Used in ouster/sensor_http.h + self.requires("jsoncpp/1.9.5", transitive_headers=True, transitive_libs=True) + self.requires("spdlog/1.13.0") + self.requires("fmt/10.2.1") + self.requires("libcurl/[>=7.78 <9]") + # Replaces vendored optional-lite + self.requires("optional-lite/3.6.0", transitive_headers=True) + + if self.options.build_pcap: + self.requires("libtins/4.5") + + if self.options.build_osf: + # Used in fb_generated/*.h + self.requires("flatbuffers/24.3.7", transitive_headers=True) + self.requires("libpng/[>=1.6 <2]") + self.requires("zlib/[>=1.2.11 <2]", transitive_libs=True) + + if self.options.build_viz: + self.requires("glad/0.1.36") + self.requires("glfw/3.4") + if self.settings.os != "Windows": + self.requires("xorg/system") + + def validate(self): + if conan_version.major < 2 and self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows builds require Conan >= 2.0") + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler)) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if self.options.build_osf and not self.options.build_pcap: + raise ConanInvalidConfiguration("build_osf=True requires build_pcap=True") + + if self.options.shared and self.settings.os == "Windows": + raise ConanInvalidConfiguration("Shared builds are not supported on Windows") + + def build_requirements(self): + if self.options.build_osf: + self.tool_requires("flatbuffers/") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = CMakeToolchain(self) + tc.variables["BUILD_VIZ"] = self.options.build_viz + tc.variables["BUILD_PCAP"] = self.options.build_pcap + tc.variables["BUILD_OSF"] = self.options.build_osf + tc.variables["OUSTER_USE_EIGEN_MAX_ALIGN_BYTES_32"] = self.options.eigen_max_align_bytes + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.set_property("flatbuffers", "cmake_target_name", "flatbuffers::flatbuffers") + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + # Unvendor optional-lite + rmdir(self, os.path.join(self.source_folder, "ouster_client", "include", "optional-lite")) + replace_in_file(self, os.path.join(self.source_folder, "ouster_client", "CMakeLists.txt"), + " include/optional-lite", "") + save(self, os.path.join(self.source_folder, "ouster_client", "CMakeLists.txt"), + "find_package(optional-lite REQUIRED)\n" + "target_link_libraries(ouster_client PUBLIC nonstd::optional-lite)\n", + append=True) + + # Allow non-static ouster_osf for consistency with other components + replace_in_file(self, os.path.join(self.source_folder, "ouster_osf", "CMakeLists.txt"), + "add_library(ouster_osf STATIC", "add_library(ouster_osf") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "OusterSDK") + self.cpp_info.set_property("cmake_target_name", "OusterSDK::OusterSDK") + + self.cpp_info.components["ouster_client"].set_property("cmake_target_name", "OusterSDK::ouster_client") + self.cpp_info.components["ouster_client"].libs = ["ouster_client"] + self.cpp_info.components["ouster_client"].requires = [ + "eigen::eigen", + "jsoncpp::jsoncpp", + "spdlog::spdlog", + "fmt::fmt", + "libcurl::libcurl", + "optional-lite::optional-lite", + ] + + if self.options.build_osf: + self.cpp_info.components["ouster_osf"].set_property("cmake_target_name", "OusterSDK::ouster_osf") + self.cpp_info.components["ouster_osf"].libs = ["ouster_osf"] + self.cpp_info.components["ouster_osf"].includedirs.append(os.path.join("include", "fb_generated")) + self.cpp_info.components["ouster_osf"].requires = [ + "ouster_client", + "ouster_pcap", + "flatbuffers::flatbuffers", + "libpng::libpng", + "zlib::zlib", + ] + + if self.options.build_pcap: + self.cpp_info.components["ouster_pcap"].set_property("cmake_target_name", "OusterSDK::ouster_pcap") + self.cpp_info.components["ouster_pcap"].libs = ["ouster_pcap"] + self.cpp_info.components["ouster_pcap"].requires = [ + "ouster_client", + "libtins::libtins", + ] + + if self.options.build_viz: + self.cpp_info.components["ouster_viz"].set_property("cmake_target_name", "OusterSDK::ouster_viz") + self.cpp_info.components["ouster_viz"].libs = ["ouster_viz"] + self.cpp_info.components["ouster_viz"].requires = [ + "ouster_client", + "glad::glad", + "glfw::glfw", + ] + if self.settings.os != "Windows": + self.cpp_info.components["ouster_viz"].requires.append("xorg::xorg") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "OusterSDK" + self.cpp_info.filenames["cmake_find_package_multi"] = "OusterSDK" + self.cpp_info.names["cmake_find_package"] = "OusterSDK" + self.cpp_info.names["cmake_find_package_multi"] = "OusterSDK" + diff --git a/recipes/ouster_sdk/all/patches/001-579-fix-cpp20-string-error.patch b/recipes/ouster_sdk/all/patches/001-579-fix-cpp20-string-error.patch new file mode 100644 index 0000000000000..aa80f65d67d9c --- /dev/null +++ b/recipes/ouster_sdk/all/patches/001-579-fix-cpp20-string-error.patch @@ -0,0 +1,25 @@ +From b2896dee6f43733c832c3a60f09f362abe2c5e79 Mon Sep 17 00:00:00 2001 +From: Kevin Greene +Date: Fri, 23 Feb 2024 10:22:02 -0800 +Subject: [PATCH] Fix non-const string issue with C++20 + +--- + ouster_client/src/curl_client.h | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/ouster_client/src/curl_client.h b/ouster_client/src/curl_client.h +index ce3fb31d..62bcabc0 100644 +--- a/ouster_client/src/curl_client.h ++++ b/ouster_client/src/curl_client.h +@@ -89,9 +89,8 @@ class CurlClient : public ouster::util::HttpClient { + // HTTP 5XX means a server error, so we should re-attempt. + // log a warning and sleep before re-attempting + ouster::sensor::logger().warn( +- std::string("Re-attempting CurlClient::execute_get after " +- "failure for url: ") + +- "[{}] with the code: [{}] - and return: {}", ++ "Re-attempting CurlClient::execute_get after failure for " ++ "url: [{}] with the code: [{}] - and return: {}", + url, http_code, buffer); + std::this_thread::sleep_for( + std::chrono::milliseconds(retry_delay_ms)); diff --git a/recipes/ouster_sdk/all/test_package/CMakeLists.txt b/recipes/ouster_sdk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..498c697a4f010 --- /dev/null +++ b/recipes/ouster_sdk/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + project(test_package CXX) + +find_package(OusterSDK REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE OusterSDK::OusterSDK) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/ouster_sdk/all/test_package/conanfile.py b/recipes/ouster_sdk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..57c251706a8d6 --- /dev/null +++ b/recipes/ouster_sdk/all/test_package/conanfile.py @@ -0,0 +1,36 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + if self.dependencies["ouster_sdk"].options.build_osf: + tc.preprocessor_definitions["WITH_OSF"] = "1" + if self.dependencies["ouster_sdk"].options.build_pcap: + tc.preprocessor_definitions["WITH_PCAP"] = "1" + if self.dependencies["ouster_sdk"].options.build_viz: + tc.preprocessor_definitions["WITH_VIZ"] = "1" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ouster_sdk/all/test_package/test_package.cpp b/recipes/ouster_sdk/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3190406572ca4 --- /dev/null +++ b/recipes/ouster_sdk/all/test_package/test_package.cpp @@ -0,0 +1,38 @@ +#include "ouster/lidar_scan.h" + +#ifdef WITH_OSF +#include "ouster/osf/writer.h" +#endif +#ifdef WITH_PCAP +#include "ouster/os_pcap.h" +#endif +#ifdef WITH_VIZ +#include "ouster/point_viz.h" +#endif + +#include + +int main() { + size_t w = 100; + size_t h = 100; + using namespace ouster::sensor; + ouster::LidarScan scan(w, h, UDPProfileLidar::PROFILE_RNG19_RFL8_SIG16_NIR16_DUAL); + std::cout << "Successfully created a sensor::LidarScan object" << std::endl; + +#ifdef WITH_OSF + ouster::osf::Writer writer("tmp.osf"); + std::cout << "Successfully created a osf::Writer object" << std::endl; +#endif + +#ifdef WITH_PCAP + try { + ouster::sensor_utils::PcapReader pcap_reader("tmp.pcap"); + } catch (...) { } + std::cout << "Successfully created a sensor_utils::PcapReader object" << std::endl; +#endif + +#ifdef WITH_VIZ + ouster::viz::PointViz viz("Viz example"); + std::cout << "Successfully created a viz::PointViz object" << std::endl; +#endif +} diff --git a/recipes/ouster_sdk/config.yml b/recipes/ouster_sdk/config.yml new file mode 100644 index 0000000000000..9f9994bf80db1 --- /dev/null +++ b/recipes/ouster_sdk/config.yml @@ -0,0 +1,5 @@ +versions: + "0.11.0": + folder: all + "0.10.0": + folder: all diff --git a/recipes/outcome/all/conandata.yml b/recipes/outcome/all/conandata.yml index 62d76f92e8327..0b6baa08be3b1 100644 --- a/recipes/outcome/all/conandata.yml +++ b/recipes/outcome/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.9": + url: "https://github.com/ned14/outcome/archive/v2.2.9.tar.gz" + sha256: "2840e403b1d7a0d3a75ecc4df574ab0674284bb21d76ac5f817695f2b56905f2" "2.2.8": url: "https://github.com/ned14/outcome/archive/v2.2.8.tar.gz" sha256: "6ef322867aee454792bd71b61950703dd18608670a69a1780cab81be22f78a1e" diff --git a/recipes/outcome/all/conanfile.py b/recipes/outcome/all/conanfile.py index 910063cd4cd17..f1c9aa2601b2d 100644 --- a/recipes/outcome/all/conanfile.py +++ b/recipes/outcome/all/conanfile.py @@ -12,11 +12,11 @@ class OutcomeConan(ConanFile): name = "outcome" - homepage = "https://github.com/ned14/outcome" description = "Provides very lightweight outcome and result" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" - topics = ("result",) + homepage = "https://github.com/ned14/outcome" + topics = ("result", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/outcome/config.yml b/recipes/outcome/config.yml index 783025ec22c41..df84211e55ceb 100644 --- a/recipes/outcome/config.yml +++ b/recipes/outcome/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.9": + folder: all "2.2.8": folder: all "2.2.7": diff --git a/recipes/pagmo2/all/CMakeLists.txt b/recipes/pagmo2/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- a/recipes/pagmo2/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/pagmo2/all/conandata.yml b/recipes/pagmo2/all/conandata.yml index a610a9ffc5a7b..26d2bd85a3ccc 100644 --- a/recipes/pagmo2/all/conandata.yml +++ b/recipes/pagmo2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.19.0": + url: "https://github.com/esa/pagmo2/archive/refs/tags/v2.19.0.tar.gz" + sha256: "701ada528de7d454201e92a5d88903dd1c22ea64f43861d9694195ddfef82a70" "2.17.0": url: "https://github.com/esa/pagmo2/archive/refs/tags/v2.17.0.tar.gz" sha256: "1b95b036f75e6fa0b21082ab228dbd63cd18ca10d9622ac53629245e0f95c35c" diff --git a/recipes/pagmo2/all/conanfile.py b/recipes/pagmo2/all/conanfile.py index 08b268962bb1c..b0c859b99c54f 100644 --- a/recipes/pagmo2/all/conanfile.py +++ b/recipes/pagmo2/all/conanfile.py @@ -1,19 +1,25 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools 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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class Pagmo2Conan(ConanFile): name = "pagmo2" description = "pagmo is a C++ scientific library for massively parallel optimization." license = ("LGPL-3.0-or-later", "GPL-3.0-or-later") - topics = ("pagmo", "optimization", "parallel-computing", "genetic-algorithm", "metaheuristics") - homepage = "https://esa.github.io/pagmo2" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://esa.github.io/pagmo2" + topics = ("pagmo", "optimization", "parallel-computing", "genetic-algorithm", "metaheuristics") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,12 +36,15 @@ class Pagmo2Conan(ConanFile): "with_ipopt": False, } - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - @property - def _source_subfolder(self): - return "source_subfolder" + def _compilers_minimum_version(self): + return { + "Visual Studio": "15.7", + "msvc": "191", + "gcc": "7", + "clang": "5.0", + "apple-clang": "9", + } def config_options(self): if self.settings.os == "Windows": @@ -43,24 +52,18 @@ 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("onetbb/2020.3") + self.requires("boost/1.85.0", transitive_headers=True) + self.requires("onetbb/2021.12.0") if self.options.with_eigen: - self.requires("eigen/3.4.0") + self.requires("eigen/3.4.0", transitive_headers=True) if self.options.with_nlopt: - self.requires("nlopt/2.7.1") - - @property - def _compilers_minimum_version(self): - return { - "Visual Studio": "15.7", - "gcc": "7", - "clang": "5.0", - "apple-clang": "9.1" - } + self.requires("nlopt/2.7.1", transitive_headers=True, transitive_libs=True) @property def _required_boost_components(self): @@ -68,86 +71,95 @@ def _required_boost_components(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) - - 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] + check_min_cppstd(self, 17) 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.version)) - 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, self.version)) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.name} {self.version} requires C++17, which your compiler does not support." + ) # TODO: add ipopt support if self.options.with_ipopt: raise ConanInvalidConfiguration("ipopt recipe not available yet in CCI") - miss_boost_required_comp = any(getattr(self.options["boost"], "without_{}".format(boost_comp), True) for boost_comp in self._required_boost_components) - if self.options["boost"].header_only or miss_boost_required_comp: - raise ConanInvalidConfiguration("{0} requires non header-only boost with these components: {1}".format(self.name, ", ".join(self._required_boost_components))) + miss_boost_required_comp = any( + self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True) + for boost_comp in self._required_boost_components + ) + if self.dependencies["boost"].options.header_only or miss_boost_required_comp: + raise ConanInvalidConfiguration( + "{0} requires non header-only boost with these components: {1}".format( + self.name, ", ".join(self._required_boost_components) + ) + ) + + if is_msvc(self) and self.options.shared: + # test_package.obj : error LNK2019: unresolved external symbol "public: __cdecl boost::archive::codecvt_null::codecvt_null(unsigned __int64)" + # https://github.com/boostorg/serialization/issues/232 + # https://github.com/conda-forge/scipoptsuite-feedstock/pull/44 + raise ConanInvalidConfiguration("Shared builds are currently broken on MSVC") 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["PAGMO_BUILD_TESTS"] = False + tc.variables["PAGMO_BUILD_BENCHMARKS"] = False + tc.variables["PAGMO_BUILD_TUTORIALS"] = False + tc.variables["PAGMO_WITH_EIGEN3"] = self.options.with_eigen + tc.variables["PAGMO_WITH_NLOPT"] = self.options.with_nlopt + tc.variables["PAGMO_WITH_IPOPT"] = self.options.with_ipopt + tc.variables["PAGMO_ENABLE_IPO"] = False + tc.variables["PAGMO_BUILD_STATIC_LIBRARY"] = not self.options.shared + tc.generate() + tc = CMakeDeps(self) + tc.generate() def _patch_sources(self): # do not force MT runtime for static lib - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "if(YACMA_COMPILER_IS_MSVC AND PAGMO_BUILD_STATIC_LIBRARY)", - "if(0)") + if Version(self.version) < "2.18": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "if(YACMA_COMPILER_IS_MSVC AND PAGMO_BUILD_STATIC_LIBRARY)", "if(0)") # No warnings as errors - yacma_cmake = os.path.join(self._source_subfolder, "cmake_modules", "yacma", "YACMACompilerLinkerSettings.cmake") - tools.replace_in_file(yacma_cmake, "list(APPEND _YACMA_CXX_FLAGS_DEBUG \"-Werror\")", "") - tools.replace_in_file(yacma_cmake, "_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/W4)", "") - tools.replace_in_file(yacma_cmake, "_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/WX)", "") - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["PAGMO_BUILD_TESTS"] = False - cmake.definitions["PAGMO_BUILD_BENCHMARKS"] = False - cmake.definitions["PAGMO_BUILD_TUTORIALS"] = False - cmake.definitions["PAGMO_WITH_EIGEN3"] = self.options.with_eigen - cmake.definitions["PAGMO_WITH_NLOPT"] = self.options.with_nlopt - cmake.definitions["PAGMO_WITH_IPOPT"] = self.options.with_ipopt - cmake.definitions["PAGMO_ENABLE_IPO"] = False - cmake.definitions["PAGMO_BUILD_STATIC_LIBRARY"] = not self.options.shared - cmake.configure() - return cmake + yacma_cmake = os.path.join(self.source_folder, "cmake_modules", "yacma", "YACMACompilerLinkerSettings.cmake") + replace_in_file(self, yacma_cmake, 'list(APPEND _YACMA_CXX_FLAGS_DEBUG "-Werror")', "") + replace_in_file(self, yacma_cmake, "_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/W4)", "") + replace_in_file(self, yacma_cmake, "_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/WX)", "") def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="COPYING.*", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "COPYING.*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "pagmo") + # https://esa.github.io/pagmo2/quickstart.html#using-pagmo-with-cmake + self.cpp_info.set_property("cmake_file_name", "Pagmo") self.cpp_info.set_property("cmake_target_name", "Pagmo::pagmo") - # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["_pagmo"].libs = ["pagmo"] - self.cpp_info.components["_pagmo"].requires = ["boost::headers", "boost::serialization", "onetbb::onetbb"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_pagmo"].system_libs.append("pthread") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["_pagmo"].requires = ["boost::boost", "onetbb::onetbb"] if self.options.with_eigen: self.cpp_info.components["_pagmo"].requires.append("eigen::eigen") if self.options.with_nlopt: self.cpp_info.components["_pagmo"].requires.append("nlopt::nlopt") - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["_pagmo"].system_libs.append("pthread") - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "pagmo" self.cpp_info.filenames["cmake_find_package_multi"] = "pagmo" self.cpp_info.names["cmake_find_package"] = "Pagmo" self.cpp_info.names["cmake_find_package_multi"] = "Pagmo" self.cpp_info.components["_pagmo"].names["cmake_find_package"] = "pagmo" self.cpp_info.components["_pagmo"].names["cmake_find_package_multi"] = "pagmo" - self.cpp_info.components["_pagmo"].set_property("cmake_target_name", "Pagmo::pagmo") diff --git a/recipes/pagmo2/all/test_package/CMakeLists.txt b/recipes/pagmo2/all/test_package/CMakeLists.txt index e512e2207b158..73aa85822f44b 100644 --- a/recipes/pagmo2/all/test_package/CMakeLists.txt +++ b/recipes/pagmo2/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.8) -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(pagmo REQUIRED CONFIG) +find_package(Pagmo REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} Pagmo::pagmo) diff --git a/recipes/pagmo2/all/test_package/conanfile.py b/recipes/pagmo2/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/pagmo2/all/test_package/conanfile.py +++ b/recipes/pagmo2/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/pagmo2/all/test_v1_package/CMakeLists.txt b/recipes/pagmo2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/pagmo2/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/polylabel/all/test_v1_package/conanfile.py b/recipes/pagmo2/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/polylabel/all/test_v1_package/conanfile.py rename to recipes/pagmo2/all/test_v1_package/conanfile.py diff --git a/recipes/pagmo2/config.yml b/recipes/pagmo2/config.yml index 0daf1d812658e..4d9124762cc74 100644 --- a/recipes/pagmo2/config.yml +++ b/recipes/pagmo2/config.yml @@ -1,4 +1,6 @@ versions: + "2.19.0": + folder: all "2.17.0": folder: all "2.10": diff --git a/recipes/pagmo2/pre_2.11/CMakeLists.txt b/recipes/pagmo2/pre_2.11/CMakeLists.txt deleted file mode 100644 index 361b35d4c17d9..0000000000000 --- a/recipes/pagmo2/pre_2.11/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) diff --git a/recipes/pagmo2/pre_2.11/conandata.yml b/recipes/pagmo2/pre_2.11/conandata.yml index fb48c3245b653..9bb70cc4e5a27 100644 --- a/recipes/pagmo2/pre_2.11/conandata.yml +++ b/recipes/pagmo2/pre_2.11/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "2.10": - patch_file: "patches/0001-fix-cmake-module-path-2-10.patch" - base_path: "source_subfolder" diff --git a/recipes/pagmo2/pre_2.11/conanfile.py b/recipes/pagmo2/pre_2.11/conanfile.py index eeacc0b3752d5..485b29614940a 100644 --- a/recipes/pagmo2/pre_2.11/conanfile.py +++ b/recipes/pagmo2/pre_2.11/conanfile.py @@ -1,18 +1,23 @@ -from conans import ConanFile, CMake, 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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir + +required_conan_version = ">=1.53.0" class Pagmo2Conan(ConanFile): name = "pagmo2" description = "pagmo is a C++ scientific library for massively parallel optimization." license = ("LGPL-3.0-or-later", "GPL-3.0-or-later") - topics = ("pagmo", "optimization", "parallel-computing", "genetic-algorithm", "metaheuristics") - homepage = "https://esa.github.io/pagmo2" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://esa.github.io/pagmo2" + topics = ("pagmo", "optimization", "parallel-computing", "genetic-algorithm", "metaheuristics", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "with_eigen": [True, False], @@ -25,25 +30,22 @@ class Pagmo2Conan(ConanFile): "with_ipopt": False, } - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.78.0") - self.requires("onetbb/2020.3") + self.requires("boost/1.83.0", transitive_headers=True) + self.requires("onetbb/2021.10.0") if self.options.with_eigen: - self.requires("eigen/3.4.0") + self.requires("eigen/3.4.0", transitive_headers=True) if self.options.with_nlopt: - self.requires("nlopt/2.7.1") + self.requires("nlopt/2.7.1", transitive_headers=True, transitive_libs=True) + + def package_id(self): + self.info.settings.clear() @property def _required_boost_components(self): @@ -51,61 +53,69 @@ def _required_boost_components(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) # TODO: add ipopt support if self.options.with_ipopt: raise ConanInvalidConfiguration("ipopt recipe not available yet in CCI") - miss_boost_required_comp = any(getattr(self.options["boost"], "without_{}".format(boost_comp), True) for boost_comp in self._required_boost_components) - if self.options["boost"].header_only or miss_boost_required_comp: - raise ConanInvalidConfiguration("{0} requires non header-only boost with these components: {1}".format(self.name, ", ".join(self._required_boost_components))) - - def package_id(self): - self.info.settings.clear() + miss_boost_required_comp = any( + self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True) + for boost_comp in self._required_boost_components + ) + if self.dependencies["boost"].options.header_only or miss_boost_required_comp: + raise ConanInvalidConfiguration( + "{0} requires non header-only boost with these components: {1}".format( + self.name, ", ".join(self._required_boost_components) + ) + ) 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["PAGMO_BUILD_TESTS"] = False - self._cmake.definitions["PAGMO_BUILD_TUTORIALS"] = False - self._cmake.definitions["PAGMO_WITH_EIGEN3"] = self.options.with_eigen - self._cmake.definitions["PAGMO_WITH_NLOPT"] = self.options.with_nlopt - self._cmake.definitions["PAGMO_WITH_IPOPT"] = self.options.with_ipopt - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PAGMO_BUILD_TESTS"] = False + tc.variables["PAGMO_BUILD_TUTORIALS"] = False + tc.variables["PAGMO_WITH_EIGEN3"] = self.options.with_eigen + tc.variables["PAGMO_WITH_NLOPT"] = self.options.with_nlopt + tc.variables["PAGMO_WITH_IPOPT"] = self.options.with_ipopt + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - self.copy(pattern="COPYING.*", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy( + self, + pattern="COPYING.*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder, + ) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "pagmo") self.cpp_info.set_property("cmake_target_name", "Pagmo::pagmo") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_pagmo"].system_libs.append("pthread") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["_pagmo"].requires = ["boost::headers", "boost::serialization", "onetbb::onetbb"] + self.cpp_info.components["_pagmo"].requires = ["boost::boost", "onetbb::onetbb"] if self.options.with_eigen: self.cpp_info.components["_pagmo"].requires.append("eigen::eigen") if self.options.with_nlopt: self.cpp_info.components["_pagmo"].requires.append("nlopt::nlopt") - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["_pagmo"].system_libs.append("pthread") - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "pagmo" self.cpp_info.filenames["cmake_find_package_multi"] = "pagmo" self.cpp_info.names["cmake_find_package"] = "Pagmo" self.cpp_info.names["cmake_find_package_multi"] = "Pagmo" self.cpp_info.components["_pagmo"].names["cmake_find_package"] = "pagmo" self.cpp_info.components["_pagmo"].names["cmake_find_package_multi"] = "pagmo" - self.cpp_info.components["_pagmo"].set_property("cmake_target_name", "Pagmo::pagmo") diff --git a/recipes/pagmo2/pre_2.11/test_package/CMakeLists.txt b/recipes/pagmo2/pre_2.11/test_package/CMakeLists.txt index 7439694a33876..de018735ec0b2 100644 --- a/recipes/pagmo2/pre_2.11/test_package/CMakeLists.txt +++ b/recipes/pagmo2/pre_2.11/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(pagmo REQUIRED CONFIG) diff --git a/recipes/pagmo2/pre_2.11/test_package/conanfile.py b/recipes/pagmo2/pre_2.11/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/pagmo2/pre_2.11/test_package/conanfile.py +++ b/recipes/pagmo2/pre_2.11/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/pagmo2/pre_2.11/test_v1_package/CMakeLists.txt b/recipes/pagmo2/pre_2.11/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/pagmo2/pre_2.11/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/pagmo2/pre_2.11/test_v1_package/conanfile.py b/recipes/pagmo2/pre_2.11/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pagmo2/pre_2.11/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/paho-mqtt-cpp/all/conandata.yml b/recipes/paho-mqtt-cpp/all/conandata.yml index 82fdb49cadc6c..33f16cd0bbad8 100644 --- a/recipes/paho-mqtt-cpp/all/conandata.yml +++ b/recipes/paho-mqtt-cpp/all/conandata.yml @@ -1,24 +1,23 @@ sources: + "1.4.0": + url: "https://github.com/eclipse/paho.mqtt.cpp/archive/v1.4.0.tar.gz" + sha256: "758c504b585402fbeb47822e52897239bbd53b4236ac3908cc040e09d2a8d8e1" + "1.3.2": + url: "https://github.com/eclipse/paho.mqtt.cpp/archive/v1.3.2.tar.gz" + sha256: "c271d521287f417102b447b3d1e8d17be0e0f6a3b0b653334ebcd2ccd20d1e46" "1.2.0": - sha256: 435e97e4d5b1da13daa26cadd3e83fe9d154930abaa78b8ff1b8c854b5345d8b - url: https://github.com/eclipse/paho.mqtt.cpp/archive/v1.2.0.tar.gz - "1.1": - sha256: cb0343349ed91ef51d0e76ae860d19435a730d3d355e57886bb090014cb70bbe - url: https://github.com/eclipse/paho.mqtt.cpp/archive/v1.1.tar.gz - "1.0.1": - sha256: e97386d159b811e534b98d21e3f6881ab2b43678ec026da7525d5c21ebc292ff - url: https://github.com/eclipse/paho.mqtt.cpp/archive/v1.0.1.tar.gz + url: "https://github.com/eclipse/paho.mqtt.cpp/archive/v1.2.0.tar.gz" + sha256: "435e97e4d5b1da13daa26cadd3e83fe9d154930abaa78b8ff1b8c854b5345d8b" patches: - "1.2.0": - - patch_file: "patches/1.2.0-0001-fix-cmake.patch" - patch_description: "CMake: Honor fPIC option and properly link paho-mqtt-c to object target" + "1.4.0": + - patch_file: "patches/1.4.0-0001-fix-cmake.patch" + patch_description: "CMake: Honor fPIC option" patch_type: "conan" - "1.1": - - patch_file: "patches/1.1-0001-fix-cmake.patch" + "1.3.2": + - patch_file: "patches/1.3.2-0001-fix-cmake.patch" patch_description: "CMake: Honor fPIC option and properly link paho-mqtt-c to object target" patch_type: "conan" - - patch_file: "patches/1.1-0002-deadlock_and_remlog-for-1-1.patch" - "1.0.1": - - patch_file: "patches/1.0.1-0001-fix-cmake.patch" - patch_description: "CMake: properly link paho-mqtt-c to object target" + "1.2.0": + - patch_file: "patches/1.2.0-0001-fix-cmake.patch" + patch_description: "CMake: Honor fPIC option and properly link paho-mqtt-c to object target" patch_type: "conan" diff --git a/recipes/paho-mqtt-cpp/all/conanfile.py b/recipes/paho-mqtt-cpp/all/conanfile.py index a2003509d5dc7..29c655cc42b87 100644 --- a/recipes/paho-mqtt-cpp/all/conanfile.py +++ b/recipes/paho-mqtt-cpp/all/conanfile.py @@ -21,12 +21,10 @@ class PahoMqttCppConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "ssl": [True, False, "deprecated"], # TODO: deprecated option, to remove in few months } default_options = { "shared": False, "fPIC": True, - "ssl": "deprecated", } @property @@ -47,25 +45,13 @@ def configure(self): suffix = "" if Version(conan_version).major < "2" else "/*" self.options[f"paho-mqtt-c{suffix}"].shared = self.options.shared - # TODO: deprecated option, to remove in few months - if self.options.ssl != "deprecated": - self.output.warning("ssl option is deprecated, do not use anymore") - def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if Version(self.version) >= "1.2.0": - # Headers are exposed https://github.com/conan-io/conan-center-index/pull/16760#issuecomment-1502420549 - # Symbols are exposed "_MQTTProperties_free", referenced from: mqtt::connect_options::~connect_options() in test_package.cpp.o - self.requires("paho-mqtt-c/1.3.9", transitive_headers=True, transitive_libs=True) - else: - # This is the "official tested" version https://github.com/eclipse/paho.mqtt.cpp/releases/tag/v1.1 - self.requires("paho-mqtt-c/1.3.1", transitive_headers=True, transitive_libs=True) - - def package_id(self): - # TODO: deprecated option, to remove in few months - del self.info.options.ssl + # Headers are exposed https://github.com/conan-io/conan-center-index/pull/16760#issuecomment-1502420549 + # Symbols are exposed "_MQTTProperties_free", referenced from: mqtt::connect_options::~connect_options() in test_package.cpp.o + self.requires("paho-mqtt-c/1.3.13", transitive_headers=True, transitive_libs=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -73,8 +59,6 @@ def validate(self): if self.dependencies["paho-mqtt-c"].options.shared != self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} requires paho-mqtt-c to have a matching 'shared' option.") - if Version(self.version) < "1.2.0" and Version(self.dependencies["paho-mqtt-c"].ref.version) >= "1.3.2": - raise ConanInvalidConfiguration(f"{self.ref} requires paho-mqtt-c =< 1.3.1") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -88,8 +72,9 @@ def generate(self): tc.variables["PAHO_WITH_SSL"] = self.dependencies["paho-mqtt-c"].options.ssl tc.generate() deps = CMakeDeps(self) - deps.set_property("paho-mqtt-c", "cmake_file_name", "PahoMqttC") - deps.set_property("paho-mqtt-c", "cmake_target_name", "PahoMqttC::PahoMqttC") + if Version(self.version) < "1.4.0": + deps.set_property("paho-mqtt-c", "cmake_file_name", "PahoMqttC") + deps.set_property("paho-mqtt-c", "cmake_target_name", "PahoMqttC::PahoMqttC") deps.generate() def build(self): diff --git a/recipes/paho-mqtt-cpp/all/patches/1.0.1-0001-fix-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.0.1-0001-fix-cmake.patch deleted file mode 100644 index e22c0033d4b91..0000000000000 --- a/recipes/paho-mqtt-cpp/all/patches/1.0.1-0001-fix-cmake.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -74,9 +74,9 @@ target_include_directories(paho-cpp-objs - $ - $ - PRIVATE -- ${PAHO_MQTT_C_INCLUDE_DIRS} - src - ) -+target_link_libraries(paho-cpp-objs PUBLIC PahoMqttC::PahoMqttC) - - - ## --- Build the shared library, if requested --- diff --git a/recipes/paho-mqtt-cpp/all/patches/1.1-0001-fix-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.1-0001-fix-cmake.patch deleted file mode 100644 index dbcbfa21fd7ce..0000000000000 --- a/recipes/paho-mqtt-cpp/all/patches/1.1-0001-fix-cmake.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -56,7 +56,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) - - # Generate position-independent code (-fPIC on UNIX) --set(CMAKE_POSITION_INDEPENDENT_CODE ON) - - # --- System Libraries --- - ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -72,9 +72,12 @@ target_include_directories(paho-cpp-objs - $ - $ - PRIVATE -- ${PAHO_MQTT_C_INCLUDE_DIRS} - src - ) -+target_link_libraries(paho-cpp-objs PUBLIC PahoMqttC::PahoMqttC) -+if(PAHO_BUILD_SHARED) -+ set_target_properties(paho-cpp-objs PROPERTIES POSITION_INDEPENDENT_CODE ON) -+endif() - - - ## --- Build the shared library, if requested --- diff --git a/recipes/paho-mqtt-cpp/all/patches/1.1-0002-deadlock_and_remlog-for-1-1.patch b/recipes/paho-mqtt-cpp/all/patches/1.1-0002-deadlock_and_remlog-for-1-1.patch deleted file mode 100644 index 4aec911f54ce3..0000000000000 --- a/recipes/paho-mqtt-cpp/all/patches/1.1-0002-deadlock_and_remlog-for-1-1.patch +++ /dev/null @@ -1,360 +0,0 @@ -diff --git a/src/async_client.cpp b/src/async_client.cpp -index c536b77..1a89662 100644 ---- a/src/async_client.cpp -+++ b/src/async_client.cpp -@@ -34,27 +34,6 @@ - #define MQTTAsync_createOptions_initializer5 { {'M', 'Q', 'C', 'O'}, 0, 0, 100, MQTTVERSION_5 } - #endif - --///////////////////////////////////////////////////////////////////////////// --// Paho C logger -- --enum LOG_LEVELS { -- INVALID_LEVEL = -1, -- TRACE_MAX = 1, -- TRACE_MED, -- TRACE_MIN, -- TRACE_PROTOCOL, -- LOG_PROTOCOL = TRACE_PROTOCOL, -- LOG_ERROR, -- LOG_SEVERE, -- LOG_FATAL, --}; -- --extern "C" { -- void Log(enum LOG_LEVELS, int, const char *, ...); --} -- --///////////////////////////////////////////////////////////////////////////// -- - namespace mqtt { - - ///////////////////////////////////////////////////////////////////////////// -@@ -150,8 +129,6 @@ async_client::~async_client() - // is notified of success on a normal connect with callbacks. - void async_client::on_connected(void* context, char* cause) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_connected"); -- - if (context) { - async_client* cli = static_cast(context); - callback* cb = cli->userCallback_; -@@ -172,8 +149,6 @@ void async_client::on_connected(void* context, char* cause) - // MQTTAsync_setCallbacks(). - void async_client::on_connection_lost(void *context, char *cause) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_connection lost"); -- - if (context) { - async_client* cli = static_cast(context); - callback* cb = cli->userCallback_; -@@ -193,6 +168,22 @@ void async_client::on_connection_lost(void *context, char *cause) - } - } - -+// Callback from the C lib for when a disconnect packet is received from -+// the server. -+void async_client::on_disconnected(void* context, MQTTProperties* cprops, -+ MQTTReasonCodes reasonCode) -+{ -+ if (context) { -+ async_client* cli = static_cast(context); -+ auto& disconnectedHandler = cli->disconnectedHandler_; -+ -+ if (disconnectedHandler) { -+ properties props(*cprops); -+ disconnectedHandler(props, ReasonCode(reasonCode)); -+ } -+ } -+} -+ - // Callback for when a subscribed message arrives. - // This is called from the MQTTAsync_messageArrived registered via - // MQTTAsync_setCallbacks(). -@@ -365,6 +356,13 @@ void async_client::set_connection_lost_handler(connection_handler cb) - &async_client::on_connection_lost)); - } - -+void async_client::set_disconnected_handler(disconnected_handler cb) -+{ -+ disconnectedHandler_ = cb; -+ check_ret(::MQTTAsync_setDisconnected(cli_, this, -+ &async_client::on_disconnected)); -+} -+ - void async_client::set_message_callback(message_handler cb) - { - msgHandler_ = cb; -diff --git a/src/mqtt/async_client.h b/src/mqtt/async_client.h -index 4323071..4bbd95c 100644 ---- a/src/mqtt/async_client.h -+++ b/src/mqtt/async_client.h -@@ -32,6 +32,7 @@ - #include "mqtt/delivery_token.h" - #include "mqtt/iclient_persistence.h" - #include "mqtt/iaction_listener.h" -+#include "mqtt/properties.h" - #include "mqtt/exception.h" - #include "mqtt/message.h" - #include "mqtt/callback.h" -@@ -84,6 +85,8 @@ public: - using message_handler = std::function; - /** Handler type for when a connecion is made or lost */ - using connection_handler = std::function; -+ /** Handler type for when a disconnect packet is received */ -+ using disconnected_handler = std::function; - - private: - /** Lock guard type for this class */ -@@ -105,10 +108,12 @@ private: - std::unique_ptr persist_; - /** Callback supplied by the user (if any) */ - callback* userCallback_; -- /** Connection handler */ -+ /** Connection handler */ - connection_handler connHandler_; -- /** Connection lost handler */ -+ /** Connection lost handler */ - connection_handler connLostHandler_; -+ /** Disconnected handler */ -+ disconnected_handler disconnectedHandler_; - /** Message handler (if any) */ - message_handler msgHandler_; - /** Copy of connect token (for re-connects) */ -@@ -120,9 +125,11 @@ private: - /** A queue of messages for consumer API */ - consumer_queue_type que_; - -- /** Callbacks from the C library */ -+ /** Callbacks from the C library */ - static void on_connected(void* context, char* cause); - static void on_connection_lost(void *context, char *cause); -+ static void on_disconnected(void* context, MQTTProperties* cprops, -+ MQTTReasonCodes reasonCode); - static int on_message_arrived(void* context, char* topicName, int topicLen, - MQTTAsync_message* msg); - static void on_delivery_complete(void* context, MQTTAsync_token tok); -@@ -234,6 +241,11 @@ public: - * @param cb Callback functor for when the connection is lost. - */ - void set_connection_lost_handler(connection_handler cb) /*override*/; -+ /** -+ * Callback for when a disconnect packet is received from the server. -+ * @param cb Callback for when the disconnect packet is received. -+ */ -+ void set_disconnected_handler(disconnected_handler cb) /*override*/; - /** - * Sets the callback for when a message arrives from the broker. - * Note that the application can only have one message handler which can -diff --git a/src/mqtt/thread_queue.h b/src/mqtt/thread_queue.h -index 94c3fea..5dafe6e 100644 ---- a/src/mqtt/thread_queue.h -+++ b/src/mqtt/thread_queue.h -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - - namespace mqtt { - -@@ -102,9 +103,9 @@ public: - /** - * Constructs a queue with the specified capacity. - * @param cap The maximum number of items that can be placed in the -- * queue. -+ * queue. The minimum capacity is 1. - */ -- explicit thread_queue(size_t cap) : cap_(cap) {} -+ explicit thread_queue(size_t cap) : cap_(std::max(cap, 1)) {} - /** - * Determine if the queue is empty. - * @return @em true if there are no elements in the queue, @em false if -@@ -148,11 +149,11 @@ public: - */ - void put(value_type val) { - unique_guard g(lock_); -- size_type n = que_.size(); -- if (n >= cap_) -+ if (que_.size() >= cap_) - notFullCond_.wait(g, [=]{return que_.size() < cap_;}); -+ bool wasEmpty = que_.empty(); - que_.emplace(std::move(val)); -- if (n == 0) { -+ if (wasEmpty) { - g.unlock(); - notEmptyCond_.notify_one(); - } -@@ -187,11 +188,11 @@ public: - template - bool try_put_for(value_type* val, const std::chrono::duration& relTime) { - unique_guard g(lock_); -- size_type n = que_.size(); -- if (n >= cap_ && !notFullCond_.wait_for(g, relTime, [=]{return que_.size() < cap_;})) -+ if (que_.size() >= cap_ && !notFullCond_.wait_for(g, relTime, [=]{return que_.size() < cap_;})) - return false; -+ bool wasEmpty = que_.empty(); - que_.emplace(std::move(val)); -- if (n == 0) { -+ if (wasEmpty) { - g.unlock(); - notEmptyCond_.notify_one(); - } -@@ -210,11 +211,11 @@ public: - template - bool try_put_until(value_type* val, const std::chrono::time_point& absTime) { - unique_guard g(lock_); -- size_type n = que_.size(); -- if (n >= cap_ && !notFullCond_.wait_until(g, absTime, [=]{return que_.size() < cap_;})) -+ if (que_.size() >= cap_ && !notFullCond_.wait_until(g, absTime, [=]{return que_.size() < cap_;})) - return false; -+ bool wasEmpty = que_.empty(); - que_.emplace(std::move(val)); -- if (n == 0) { -+ if (wasEmpty) { - g.unlock(); - notEmptyCond_.notify_one(); - } -@@ -228,12 +229,11 @@ public: - */ - void get(value_type* val) { - unique_guard g(lock_); -- auto n = que_.size(); -- if (n == 0) -+ if (que_.empty()) - notEmptyCond_.wait(g, [=]{return !que_.empty();}); - *val = std::move(que_.front()); - que_.pop(); -- if (n == cap_) { -+ if (que_.size() == cap_-1) { - g.unlock(); - notFullCond_.notify_one(); - } -@@ -246,12 +246,11 @@ public: - */ - value_type get() { - unique_guard g(lock_); -- auto n = que_.size(); -- if (n == 0) -+ if (que_.empty()) - notEmptyCond_.wait(g, [=]{return !que_.empty();}); - value_type val = std::move(que_.front()); - que_.pop(); -- if (n == cap_) { -+ if (que_.size() == cap_-1) { - g.unlock(); - notFullCond_.notify_one(); - } -@@ -267,12 +266,11 @@ public: - */ - bool try_get(value_type* val) { - unique_guard g(lock_); -- auto n = que_.size(); -- if (n == 0) -+ if (que_.empty()) - return false; - *val = std::move(que_.front()); - que_.pop(); -- if (n == cap_) { -+ if (que_.size() == cap_-1) { - g.unlock(); - notFullCond_.notify_one(); - } -@@ -291,12 +289,11 @@ public: - template - bool try_get_for(value_type* val, const std::chrono::duration& relTime) { - unique_guard g(lock_); -- auto n = que_.size(); -- if (n == 0 && !notEmptyCond_.wait_for(g, relTime, [=]{return !que_.empty();})) -+ if (que_.empty() && !notEmptyCond_.wait_for(g, relTime, [=]{return !que_.empty();})) - return false; - *val = std::move(que_.front()); - que_.pop(); -- if (n == cap_) { -+ if (que_.size() == cap_-1) { - g.unlock(); - notFullCond_.notify_one(); - } -@@ -315,12 +312,11 @@ public: - template - bool try_get_until(value_type* val, const std::chrono::time_point& absTime) { - unique_guard g(lock_); -- auto n = que_.size(); -- if (n == 0 && !notEmptyCond_.wait_until(g, absTime, [=]{return !que_.empty();})) -+ if (que_.empty() && !notEmptyCond_.wait_until(g, absTime, [=]{return !que_.empty();})) - return false; - *val = std::move(que_.front()); - que_.pop(); -- if (n == cap_) { -+ if (que_.size() == cap_-1) { - g.unlock(); - notFullCond_.notify_one(); - } -diff --git a/src/token.cpp b/src/token.cpp -index ffbf816..3853cf2 100644 ---- a/src/token.cpp -+++ b/src/token.cpp -@@ -23,27 +23,6 @@ - - #include - --///////////////////////////////////////////////////////////////////////////// --// Paho C logger -- --enum LOG_LEVELS { -- INVALID_LEVEL = -1, -- TRACE_MAX = 1, -- TRACE_MED, -- TRACE_MIN, -- TRACE_PROTOCOL, -- LOG_PROTOCOL = TRACE_PROTOCOL, -- LOG_ERROR, -- LOG_SEVERE, -- LOG_FATAL, --}; -- --extern "C" { -- void Log(enum LOG_LEVELS, int, const char *, ...); --} -- --///////////////////////////////////////////////////////////////////////////// -- - namespace mqtt { - - // -------------------------------------------------------------------------- -@@ -110,8 +89,6 @@ void token::on_failure5(void* context, MQTTAsync_failureData5* rsp) - // - void token::on_success(MQTTAsync_successData* rsp) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_success"); -- - unique_lock g(lock_); - iaction_listener* listener = listener_; - -@@ -154,8 +131,6 @@ void token::on_success(MQTTAsync_successData* rsp) - // - void token::on_success5(MQTTAsync_successData5* rsp) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_success5"); -- - unique_lock g(lock_); - iaction_listener* listener = listener_; - if (rsp) { -@@ -197,8 +172,6 @@ void token::on_success5(MQTTAsync_successData5* rsp) - // - void token::on_failure(MQTTAsync_failureData* rsp) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_failure"); -- - unique_lock g(lock_); - iaction_listener* listener = listener_; - if (rsp) { -@@ -230,8 +203,6 @@ void token::on_failure(MQTTAsync_failureData* rsp) - // - void token::on_failure5(MQTTAsync_failureData5* rsp) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_failure5"); -- - unique_lock g(lock_); - iaction_listener* listener = listener_; - if (rsp) { diff --git a/recipes/paho-mqtt-cpp/all/patches/1.3.2-0001-fix-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.3.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..f2fe425491b50 --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/patches/1.3.2-0001-fix-cmake.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,7 +58,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + + # Generate position-independent code (-fPIC on UNIX) +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # --- System Libraries --- + +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -82,9 +82,12 @@ target_include_directories(paho-cpp-objs + $ + $ + PRIVATE +- ${PAHO_MQTT_C_INCLUDE_DIRS} + src + ) ++target_link_libraries(paho-cpp-objs PUBLIC PahoMqttC::PahoMqttC) ++if(PAHO_BUILD_SHARED) ++ set_target_properties(paho-cpp-objs PROPERTIES POSITION_INDEPENDENT_CODE ON) ++endif() + + target_compile_definitions(paho-cpp-objs PRIVATE PAHO_MQTTPP_EXPORTS) + diff --git a/recipes/paho-mqtt-cpp/all/patches/1.4.0-0001-fix-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.4.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..3a9eac127ef96 --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/patches/1.4.0-0001-fix-cmake.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1155844..ace2e61 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -107,7 +107,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + + # Generate position-independent code (-fPIC on UNIX) +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++# set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # --- System Details --- + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index c8b213d..2898972 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -68,6 +68,7 @@ if(PAHO_BUILD_SHARED) + set_target_properties(paho-mqttpp3 PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} ++ POSITION_INDEPENDENT_CODE ON + ) + endif() + diff --git a/recipes/paho-mqtt-cpp/all/test_package/CMakeLists.txt b/recipes/paho-mqtt-cpp/all/test_package/CMakeLists.txt index 110f1d17cc392..ff0d0d7fdb39c 100644 --- a/recipes/paho-mqtt-cpp/all/test_package/CMakeLists.txt +++ b/recipes/paho-mqtt-cpp/all/test_package/CMakeLists.txt @@ -1,18 +1,11 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) -project(test_package C CXX) +project(test_package LANGUAGES CXX) find_package(PahoMqttCpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) - -if(TEST_SSL_OPTION) - target_compile_definitions(${PROJECT_NAME} PRIVATE TEST_SSL_OPTION) -endif() - -if(PAHO_MQTT_CPP_SHARED) - target_link_libraries(${PROJECT_NAME} PahoMqttCpp::paho-mqttpp3) -else() - target_link_libraries(${PROJECT_NAME} PahoMqttCpp::paho-mqttpp3-static) -endif() +target_link_libraries(${PROJECT_NAME} PRIVATE + $<$:PahoMqttCpp::paho-mqttpp3> + $<$>:PahoMqttCpp::paho-mqttpp3-static>) diff --git a/recipes/paho-mqtt-cpp/all/test_package/conanfile.py b/recipes/paho-mqtt-cpp/all/test_package/conanfile.py index 6b882c937645a..a3dc3d0a3dd9f 100644 --- a/recipes/paho-mqtt-cpp/all/test_package/conanfile.py +++ b/recipes/paho-mqtt-cpp/all/test_package/conanfile.py @@ -16,8 +16,6 @@ def layout(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["TEST_SSL_OPTION"] = self.dependencies[self.tested_reference_str].options.ssl - tc.variables["PAHO_MQTT_CPP_SHARED"] = self.dependencies[self.tested_reference_str].options.shared tc.generate() deps = CMakeDeps(self) deps.generate() diff --git a/recipes/paho-mqtt-cpp/all/test_package/test_package.cpp b/recipes/paho-mqtt-cpp/all/test_package/test_package.cpp index 79865e445a31c..59652bb6459ca 100644 --- a/recipes/paho-mqtt-cpp/all/test_package/test_package.cpp +++ b/recipes/paho-mqtt-cpp/all/test_package/test_package.cpp @@ -1,26 +1,10 @@ -#include -#include "mqtt/async_client.h" -#include "mqtt/client.h" +#include +#include "mqtt/message.h" -const std::string SERVER_ADDRESS { "tcp://localhost:1883" }; -const std::string CLIENT_ID { "consume" }; - -int main(int argc, char* argv[]) -{ - mqtt::connect_options connOpts; - connOpts.set_keep_alive_interval(20); - connOpts.set_clean_session(true); - - mqtt::async_client cli_async(SERVER_ADDRESS, CLIENT_ID); - mqtt::client cli(SERVER_ADDRESS, CLIENT_ID); - -#ifdef TEST_SSL_OPTION - // Build the connect options, including SSL and a LWT message. - // auto sslopts = mqtt::ssl_options_builder(); // This was added in v1.2.0 - auto sslopts = mqtt::ssl_options(); -#endif +int main() { + mqtt::message msg("hello", "Hello there", 11, 1, true); + std::cout << "MQTT topic: " << msg.get_topic() << std::endl; return 0; } - diff --git a/recipes/paho-mqtt-cpp/all/test_v1_package/CMakeLists.txt b/recipes/paho-mqtt-cpp/all/test_v1_package/CMakeLists.txt index 925ecbe19e448..91630d79f4abb 100644 --- a/recipes/paho-mqtt-cpp/all/test_v1_package/CMakeLists.txt +++ b/recipes/paho-mqtt-cpp/all/test_v1_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/paho-mqtt-cpp/all/test_v1_package/conanfile.py b/recipes/paho-mqtt-cpp/all/test_v1_package/conanfile.py index df31aee370d9b..5a05af3c2dfd2 100644 --- a/recipes/paho-mqtt-cpp/all/test_v1_package/conanfile.py +++ b/recipes/paho-mqtt-cpp/all/test_v1_package/conanfile.py @@ -3,15 +3,12 @@ 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.definitions["PAHO_MQTT_CPP_SHARED"] = self.options["paho-mqtt-cpp"].shared - cmake.definitions["TEST_SSL_OPTION"] = self.options["paho-mqtt-cpp"].ssl cmake.configure() cmake.build() diff --git a/recipes/paho-mqtt-cpp/config.yml b/recipes/paho-mqtt-cpp/config.yml index e1306dc2a1d9a..4866c5bc21cde 100644 --- a/recipes/paho-mqtt-cpp/config.yml +++ b/recipes/paho-mqtt-cpp/config.yml @@ -1,7 +1,7 @@ versions: - "1.2.0": + "1.4.0": folder: "all" - "1.1": + "1.3.2": folder: "all" - "1.0.1": + "1.2.0": folder: "all" diff --git a/recipes/pango/all/conanfile.py b/recipes/pango/all/conanfile.py index 95d2994e0044e..927f6200bed62 100644 --- a/recipes/pango/all/conanfile.py +++ b/recipes/pango/all/conanfile.py @@ -66,7 +66,7 @@ def requirements(self): self.requires("freetype/2.13.2") if self.options.with_fontconfig: - self.requires("fontconfig/2.14.2") + self.requires("fontconfig/2.15.0") if self.options.with_xft: self.requires("libxft/2.3.8") if ( @@ -78,7 +78,7 @@ def requirements(self): if self.options.with_cairo: # "pango/pangocairo.h" includes "cairo.h" self.requires("cairo/1.18.0", transitive_headers=True) - self.requires("glib/2.78.1", transitive_headers=True, transitive_libs=True) + self.requires("glib/2.78.3", transitive_headers=True, transitive_libs=True) self.requires("fribidi/1.0.13") # "pango/pango-coverage.h" includes "hb.h" self.requires("harfbuzz/8.3.0", transitive_headers=True) @@ -118,9 +118,9 @@ def validate(self): def build_requirements(self): self.tool_requires("glib/") - self.tool_requires("meson/1.3.0") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -223,6 +223,8 @@ def package_info(self): self.cpp_info.components["pangowin32"].set_property("pkg_config_name", "pangowin32") self.cpp_info.components["pangowin32"].requires = ["pango_"] self.cpp_info.components["pangowin32"].system_libs.append("gdi32") + if Version(self.version) >= "1.50.12": + self.cpp_info.components["pangowin32"].system_libs.append("dwrite") if self.options.with_cairo: self.cpp_info.components["pangocairo"].libs = ["pangocairo-1.0"] diff --git a/recipes/parallel-hashmap/all/conandata.yml b/recipes/parallel-hashmap/all/conandata.yml index 3e06bdb26e652..1b5444cf042f5 100644 --- a/recipes/parallel-hashmap/all/conandata.yml +++ b/recipes/parallel-hashmap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.12": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/v1.3.12.tar.gz" + sha256: "0cc203144321924cfbfcc401f42d8204c0dd24e2760c7a1c091baa16d9777c08" "1.3.11": url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/v1.3.11.tar.gz" sha256: "0515a681bfb24207013786a7737e9d8561302e656689d8a65ea480bbabab460f" diff --git a/recipes/parallel-hashmap/config.yml b/recipes/parallel-hashmap/config.yml index a1c1439981d11..3d6b3dc656593 100644 --- a/recipes/parallel-hashmap/config.yml +++ b/recipes/parallel-hashmap/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.12": + folder: all "1.3.11": folder: all "1.3.8": diff --git a/recipes/pbc/all/conandata.yml b/recipes/pbc/all/conandata.yml index af6c41c5d370b..3a82e91b4ea31 100644 --- a/recipes/pbc/all/conandata.yml +++ b/recipes/pbc/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "0.5.14": - patch_file: "patches/0.5.14-0001-fix-config-sub-ios.patch" - base_path: "" diff --git a/recipes/pbc/all/conanfile.py b/recipes/pbc/all/conanfile.py index cef849369307b..2de63fee00601 100644 --- a/recipes/pbc/all/conanfile.py +++ b/recipes/pbc/all/conanfile.py @@ -1,22 +1,40 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import XCRun, to_apple_arch, fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, chdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class PbcConan(ConanFile): name = "pbc" - topics = ("pbc", "crypto", "cryptography", "security", "pairings", "cryptographic") + description = ("The PBC (Pairing-Based Crypto) library is a C library providing " + "low-level routines for pairing-based cryptosystems.") + license = "LGPL-3.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://crypto.stanford.edu/pbc/" - license = "LGPL-3.0" - description = "The PBC (Pairing-Based Crypto) library is a C library providing low-level routines for pairing-based cryptosystems." + topics = ("crypto", "cryptography", "security", "pairings", "cryptographic") + package_type = "library" settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - _autotools = None - exports_sources = "patches/**" + 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": @@ -24,75 +42,68 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("gmp/6.2.1") + self.requires("gmp/6.3.0", transitive_headers=True, transitive_libs=True) - def build_requirements(self): - self.build_requires("bison/3.7.6") - self.build_requires("flex/2.6.4") + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("pbc is not compatible with MSVC due to use of GNU extensions") - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + def build_requirements(self): + self.tool_requires("flex/2.6.4") + self.tool_requires("bison/3.8.2") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment( - self, win_bash=tools.os_info.is_windows - ) - # Need to override environment or configure will fail despite that flex - # is actually available. - args = ["LEX=flex"] - if self.options.shared: - args.extend(["--disable-static", "--enable-shared"]) - else: - args.extend(["--disable-shared", "--enable-static"]) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - # No idea why this is necessary, but if you don't set CC this way, then - # configure complains that it can't find gmp. - if ( - tools.cross_building(self.settings) - and self.settings.compiler == "apple-clang" - ): + def generate(self): + env = VirtualBuildEnv(self) + env.generate() - xcr = tools.XCRun(self.settings) - target = tools.to_apple_arch(self.settings.arch) + "-apple-darwin" + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + tc.configure_args.append("LEX=flex") + # No idea why this is necessary, but if you don't set CC this way, then + # configure complains that it can't find gmp. + if cross_building(self) and self.settings.compiler == "apple-clang": + xcr = XCRun(self) + target = to_apple_arch(self) + "-apple-darwin" min_ios = "" if self.settings.os == "iOS": - min_ios = "-miphoneos-version-min={}".format(self.settings.os.version) - - args.append( - "CC={} -isysroot {} -target {} {}".format( - xcr.cc, xcr.sdk_path, target, min_ios - ) - ) + min_ios = f"-miphoneos-version-min={self.settings.os.version}" + tc.configure_args.append(f"CC={xcr.cc} -isysroot {xcr.sdk_path} -target {target} {min_ios}") + tc.generate() - self._autotools.configure(args=args) - return self._autotools + deps = AutotoolsDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - autotools = self._configure_autotools() - autotools.make() + apply_conandata_patches(self) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy(pattern="COPYING", dst="licenses") - autotools = self._configure_autotools() - autotools.install() - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.la", self.package_folder, recursive=True) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.libs = ["pbc"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] diff --git a/recipes/pbc/all/test_package/CMakeLists.txt b/recipes/pbc/all/test_package/CMakeLists.txt index c67cb318985e8..a724a29a8da1f 100644 --- a/recipes/pbc/all/test_package/CMakeLists.txt +++ b/recipes/pbc/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 C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(pbc CONFIG REQUIRED) +find_package(pbc REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} pbc::pbc) diff --git a/recipes/pbc/all/test_package/conanfile.py b/recipes/pbc/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/pbc/all/test_package/conanfile.py +++ b/recipes/pbc/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/pbc/all/test_v1_package/CMakeLists.txt b/recipes/pbc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/pbc/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/pbc/all/test_v1_package/conanfile.py b/recipes/pbc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/pbc/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/pciutils/all/conandata.yml b/recipes/pciutils/all/conandata.yml index de7711b0170fd..8cdf113d7ef73 100644 --- a/recipes/pciutils/all/conandata.yml +++ b/recipes/pciutils/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.12.0": + url: "https://github.com/pciutils/pciutils/archive/v3.12.0.tar.gz" + sha256: "3a76ca02581fed03d0470ba822e72ee06e492442a990062f9638dec90018505f" "3.10.0": url: "https://github.com/pciutils/pciutils/archive/v3.10.0.tar.gz" sha256: "e579d87f1afe2196db7db648857023f80adb500e8194c4488c8b47f9a238c1c6" diff --git a/recipes/pciutils/config.yml b/recipes/pciutils/config.yml index 6ece8b7922d9b..358eb13a104b8 100644 --- a/recipes/pciutils/config.yml +++ b/recipes/pciutils/config.yml @@ -1,4 +1,6 @@ versions: + "3.12.0": + folder: all "3.10.0": folder: all "3.7.0": diff --git a/recipes/pcl/all/conanfile.py b/recipes/pcl/all/conanfile.py index 2b324ce7e9270..f22cfe52d2e6c 100644 --- a/recipes/pcl/all/conanfile.py +++ b/recipes/pcl/all/conanfile.py @@ -91,6 +91,7 @@ class PclConan(ConanFile): "precompile_only_core_point_types": [True, False], # Whether to append a ''/d/rd/s postfix to executables on Windows depending on the build type "add_build_type_postfix": [True, False], + "use_sse": [True, False], } default_options = { "shared": False, @@ -151,6 +152,7 @@ class PclConan(ConanFile): # Enabled to avoid excessive memory usage during compilation in CCI "precompile_only_core_point_types": True, "add_build_type_postfix": False, + "use_sse": True, } short_paths = True @@ -333,6 +335,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if self.settings.arch not in ["x86", "x86_64"]: + del self.options.use_sse def configure(self): if self.options.shared: @@ -477,6 +481,8 @@ def generate(self): for comp in disabled: tc.cache_variables[f"BUILD_{comp}"] = False + tc.cache_variables["PCL_ENABLE_SSE"] = self.options.get_safe("use_sse", False) + tc.generate() deps = CMakeDeps(self) diff --git a/recipes/pcre2/all/conandata.yml b/recipes/pcre2/all/conandata.yml index 6dadb108df617..e8c76deba6361 100644 --- a/recipes/pcre2/all/conandata.yml +++ b/recipes/pcre2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "10.44": + url: "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.44/pcre2-10.44.tar.bz2" + sha256: "d34f02e113cf7193a1ebf2770d3ac527088d485d4e047ed10e5d217c6ef5de96" "10.43": url: "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.43/pcre2-10.43.tar.bz2" sha256: "e2a53984ff0b07dfdb5ae4486bbb9b21cca8e7df2434096cc9bf1b728c350bcb" diff --git a/recipes/pcre2/all/conanfile.py b/recipes/pcre2/all/conanfile.py index 5c51abac704ec..7f6022b6b9a83 100644 --- a/recipes/pcre2/all/conanfile.py +++ b/recipes/pcre2/all/conanfile.py @@ -29,6 +29,7 @@ class PCRE2Conan(ConanFile): "with_bzip2": [True, False], "support_jit": [True, False], "grep_support_callout_fork": [True, False], + "link_size": [2, 3, 4], } default_options = { "shared": False, @@ -41,6 +42,7 @@ class PCRE2Conan(ConanFile): "with_bzip2": True, "support_jit": False, "grep_support_callout_fork": True, + "link_size": 2, } def export_sources(self): @@ -96,6 +98,7 @@ def generate(self): tc.variables["PCRE2_BUILD_PCRE2_16"] = self.options.build_pcre2_16 tc.variables["PCRE2_BUILD_PCRE2_32"] = self.options.build_pcre2_32 tc.variables["PCRE2_SUPPORT_JIT"] = self.options.support_jit + tc.variables["PCRE2_LINK_SIZE"] = self.options.link_size tc.variables["PCRE2GREP_SUPPORT_CALLOUT_FORK"] = self.options.get_safe("grep_support_callout_fork", False) if Version(self.version) < "10.38": # relocatable shared libs on Macos @@ -118,6 +121,18 @@ def _patch_sources(self): replace_in_file(self, cmakelists, "RUNTIME DESTINATION bin", "RUNTIME DESTINATION bin BUNDLE DESTINATION bin") + # pcre2-config does not correctly include '-static' in static library names + if is_msvc(self): + replace = None + if Version(self.version) > "10.42": + replace = "configure_file(pcre2-config.in" + elif Version(self.version) >= "10.38": + replace = "CONFIGURE_FILE(pcre2-config.in" + postfix = "-static" if not self.options.shared else "" + if replace: + if self.settings.build_type == "Debug": + postfix += "d" + replace_in_file(self, cmakelists, replace, f'set(LIB_POSTFIX "{postfix}")\n{replace}') def build(self): self._patch_sources() @@ -169,7 +184,7 @@ def package_info(self): if self.options.build_pcre2grep: bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) # FIXME: This is a workaround to avoid ConanException. zlib and bzip2 # are optional requirements of pcre2grep executable, not of any pcre2 lib. diff --git a/recipes/pcre2/all/test_package/conanfile.py b/recipes/pcre2/all/test_package/conanfile.py index 0a6bc68712d90..fafba71d30d56 100644 --- a/recipes/pcre2/all/test_package/conanfile.py +++ b/recipes/pcre2/all/test_package/conanfile.py @@ -22,5 +22,5 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/pcre2/config.yml b/recipes/pcre2/config.yml index 946dbc4632734..7b719e00064be 100644 --- a/recipes/pcre2/config.yml +++ b/recipes/pcre2/config.yml @@ -1,4 +1,6 @@ versions: + "10.44": + folder: all "10.43": folder: all "10.42": diff --git a/recipes/pdf-writer/all/conandata.yml b/recipes/pdf-writer/all/conandata.yml index b1b2eb4b8f3ff..6325de8b17065 100644 --- a/recipes/pdf-writer/all/conandata.yml +++ b/recipes/pdf-writer/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "4.6.6": + url: "https://github.com/galkahana/PDF-Writer/archive/refs/tags/v4.6.6.tar.gz" + sha256: "8343820313e553052df68c75fe2bf35353da2719106e81eb2a8b026ff96c7d7c" + "4.6.4": + url: "https://github.com/galkahana/PDF-Writer/archive/refs/tags/v4.6.4.tar.gz" + sha256: "93b5f1dc88fd67fdebde409e927e828dfbae02efa44936e89728622411c6a047" "4.6.3": url: "https://github.com/galkahana/PDF-Writer/archive/refs/tags/v4.6.3.tar.gz" sha256: "3b5d9ba4b49d0380678e8172f27cdb8eda196ea448e7f1cdd79620066d082ab9" @@ -12,6 +18,14 @@ sources: url: "https://github.com/galkahana/PDF-Writer/archive/refs/tags/v4.5.12.tar.gz" sha256: "40fcbaa66fc46fcb588ceda119ba8839ff6d2c886191ac5e68ed702475c7336e" patches: + "4.6.6": + - patch_file: "patches/4.6.6-0001-fix-cmake.patch" + patch_description: "disable cpack" + patch_type: "conan" + "4.6.4": + - patch_file: "patches/4.6.2-0001-fix-cmake.patch" + patch_description: "disable cpack" + patch_type: "conan" "4.6.3": - patch_file: "patches/4.6.2-0001-fix-cmake.patch" patch_description: "disable cpack" diff --git a/recipes/pdf-writer/all/patches/4.6.6-0001-fix-cmake.patch b/recipes/pdf-writer/all/patches/4.6.6-0001-fix-cmake.patch new file mode 100644 index 0000000000000..0f818e64d81ab --- /dev/null +++ b/recipes/pdf-writer/all/patches/4.6.6-0001-fix-cmake.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 956c730..a7d809b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -165,13 +165,13 @@ if(PROJECT_IS_TOP_LEVEL AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/PDFWriterTesting) + ADD_SUBDIRECTORY(PDFWriterTesting) + endif() + +-include(InstallRequiredSystemLibraries) +-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") +-set(CPACK_PACKAGE_VERSION_MAJOR "${PDFHummus_VERSION_MAJOR}") +-set(CPACK_PACKAGE_VERSION_MINOR "${PDFHummus_VERSION_MINOR}") +-set(CPACK_SOURCE_GENERATOR "ZIP") +-set(CPACK_GENERATOR "ZIP") +-include(CPack) ++# include(InstallRequiredSystemLibraries) ++# set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") ++# set(CPACK_PACKAGE_VERSION_MAJOR "${PDFHummus_VERSION_MAJOR}") ++# set(CPACK_PACKAGE_VERSION_MINOR "${PDFHummus_VERSION_MINOR}") ++# set(CPACK_SOURCE_GENERATOR "ZIP") ++# set(CPACK_GENERATOR "ZIP") ++# include(CPack) + + install(EXPORT PDFHummusTargets + FILE PDFHummusTargets.cmake +@@ -200,4 +200,4 @@ install(FILES + export(EXPORT PDFHummusTargets + FILE "${CMAKE_CURRENT_BINARY_DIR}/PDFHummusTargets.cmake" + NAMESPACE PDFHummus:: +-) +\ No newline at end of file ++) diff --git a/recipes/pdf-writer/config.yml b/recipes/pdf-writer/config.yml index 44bc3d66897b6..422e112234c81 100644 --- a/recipes/pdf-writer/config.yml +++ b/recipes/pdf-writer/config.yml @@ -1,4 +1,8 @@ versions: + "4.6.6": + folder: all + "4.6.4": + folder: all "4.6.3": folder: all "4.6.2": diff --git a/recipes/perfetto/all/conandata.yml b/recipes/perfetto/all/conandata.yml index 7ea6229bf24ad..e5a1529e55186 100644 --- a/recipes/perfetto/all/conandata.yml +++ b/recipes/perfetto/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "45.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v45.0.tar.gz" + sha256: "dcb815fb54370fa20a657552288016cb66e7a98237c1a1d47e7645a4325ac75e" + "44.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v44.0.tar.gz" + sha256: "db4162ee6495b1fcc13ba7aca77d67f9fd1766d184743137a04af8b1e3906b9d" "43.1": url: "https://github.com/google/perfetto/archive/refs/tags/v43.1.tar.gz" sha256: "0f23ba39520c9ec629c48dc36a3a4bb92ed9653ac6694445be22985205a3f4ce" diff --git a/recipes/perfetto/all/conanfile.py b/recipes/perfetto/all/conanfile.py index 6c9cecd7c62ef..53a602bd0b160 100644 --- a/recipes/perfetto/all/conanfile.py +++ b/recipes/perfetto/all/conanfile.py @@ -101,7 +101,7 @@ def package(self): def package_info(self): self.cpp_info.libs = ["perfetto"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.extend(["pthread", "m"]) if self.settings.os == "Windows": self.cpp_info.system_libs.append("ws2_32") if is_msvc(self): diff --git a/recipes/perfetto/config.yml b/recipes/perfetto/config.yml index e704c3a7bc879..fd321949678ec 100644 --- a/recipes/perfetto/config.yml +++ b/recipes/perfetto/config.yml @@ -1,4 +1,8 @@ versions: + "45.0": + folder: all + "44.0": + folder: all "43.1": folder: all "42.0": diff --git a/recipes/physfs/all/conandata.yml b/recipes/physfs/all/conandata.yml index 5504750a8f897..a392b6a19517f 100644 --- a/recipes/physfs/all/conandata.yml +++ b/recipes/physfs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.0": + url: "https://github.com/icculus/physfs/archive/refs/tags/release-3.2.0.tar.gz" + sha256: "1991500eaeb8d5325e3a8361847ff3bf8e03ec89252b7915e1f25b3f8ab5d560" "3.0.2": url: "https://icculus.org/physfs/downloads/physfs-3.0.2.tar.bz2" sha256: "304df76206d633df5360e738b138c94e82ccf086e50ba84f456d3f8432f9f863" diff --git a/recipes/physfs/all/conanfile.py b/recipes/physfs/all/conanfile.py index 995258a27fa05..7f695f2305b04 100644 --- a/recipes/physfs/all/conanfile.py +++ b/recipes/physfs/all/conanfile.py @@ -99,6 +99,7 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake", "PhysFS")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( diff --git a/recipes/physfs/config.yml b/recipes/physfs/config.yml index 12c582e98f963..1531809cbbd7b 100644 --- a/recipes/physfs/config.yml +++ b/recipes/physfs/config.yml @@ -1,3 +1,5 @@ versions: + "3.2.0": + folder: all "3.0.2": folder: all diff --git a/recipes/pixman/all/conandata.yml b/recipes/pixman/all/conandata.yml index f712201caaef3..dc1f3f424ea14 100644 --- a/recipes/pixman/all/conandata.yml +++ b/recipes/pixman/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "0.43.4": + url: + - "https://www.cairographics.org/releases/pixman-0.43.4.tar.gz" + - "https://www.x.org/releases/individual/lib/pixman-0.43.4.tar.gz" + sha256: "a0624db90180c7ddb79fc7a9151093dc37c646d8c38d3f232f767cf64b85a226" "0.43.0": url: - "https://www.cairographics.org/releases/pixman-0.43.0.tar.gz" @@ -9,33 +14,9 @@ sources: - "https://www.cairographics.org/releases/pixman-0.42.2.tar.gz" - "https://www.x.org/releases/individual/lib/pixman-0.42.2.tar.gz" sha256: "ea1480efada2fd948bc75366f7c349e1c96d3297d09a3fe62626e38e234a625e" - "0.40.0": - url: - - "https://www.cairographics.org/releases/pixman-0.40.0.tar.gz" - - "https://www.x.org/releases/individual/lib/pixman-0.40.0.tar.gz" - sha256: "6d200dec3740d9ec4ec8d1180e25779c00bc749f94278c8b9021f5534db223fc" - "0.38.4": - url: - - "https://www.cairographics.org/releases/pixman-0.38.4.tar.gz" - - "https://www.x.org/releases/individual/lib/pixman-0.38.4.tar.gz" - sha256: "da66d6fd6e40aee70f7bd02e4f8f76fc3f006ec879d346bae6a723025cfbdde7" patches: "0.42.2": - patch_file: "patches/0.42.2-0001-pixman-arma64-Adjustments-to-build-with-llvm-integra.patch" patch_description: "Adjustments to build for arm64 with LLVM's assembler" patch_type: "portability" patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/71" - "0.40.0": - - patch_file: "patches/0001-incompatible-pointer-types.patch" - patch_description: "backport fix for clang build" - patch_type: "portability" - patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/48" - - patch_file: "patches/0003-meson-static-build.patch" - patch_description: "backport fix for msvc static build" - patch_type: "bugfix" - patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/commit/48d5df1f3772a08a929dcb3b2fe4d7b1853223c9.patch" - "0.38.4": - - patch_file: "patches/0002-meson-build.patch" - patch_description: "backport meson build files from 0.40.0 to fix windows build" - patch_type: "portability" - patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/tree/pixman-0.40.0" diff --git a/recipes/pixman/all/conanfile.py b/recipes/pixman/all/conanfile.py index 8d655189662cb..d2d66d83f8c74 100644 --- a/recipes/pixman/all/conanfile.py +++ b/recipes/pixman/all/conanfile.py @@ -1,7 +1,6 @@ import os from conan import ConanFile -from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name from conan.tools.env import VirtualBuildEnv from conan.tools.files import ( @@ -11,7 +10,6 @@ from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain from conan.tools.microsoft import is_msvc -from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -22,7 +20,7 @@ class PixmanConan(ConanFile): topics = ("graphics", "compositing", "rasterization") url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.freedesktop.org/pixman/pixman" - license = ("LGPL-2.1-only", "MPL-1.1") + license = ("MIT") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -50,12 +48,8 @@ def configure(self): def layout(self): basic_layout(self, src_folder="src") - def validate(self): - if self.settings.os == "Windows" and self.options.shared and Version(self.version) < "0.40.0": - raise ConanInvalidConfiguration(f"pixman/{self.version} can only be built as a static library on Windows") - def build_requirements(self): - self.tool_requires("meson/1.2.3") + self.tool_requires("meson/1.4.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -68,6 +62,13 @@ def generate(self): "libpng": "disabled", "gtk": "disabled" }) + + # Android armv7 build of Pixman makes use of cpu-features functionality, provided in the NDK + if self.settings.os == "Android": + android_ndk_home = self.conf.get("tools.android:ndk_path").replace("\\", "/") + cpu_features_path = os.path.join(android_ndk_home, "sources", "android", "cpufeatures") + tc.project_options.update({'cpu-features-path' : cpu_features_path}) + tc.generate() def _patch_sources(self): diff --git a/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch b/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch deleted file mode 100644 index ee95a8b091433..0000000000000 --- a/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c -index 4cfabe3..3832e2b 100644 ---- a/pixman/pixman-bits-image.c -+++ b/pixman/pixman-bits-image.c -@@ -1051,14 +1051,14 @@ dest_write_back_narrow (pixman_iter_t *iter) - iter->y++; - } - --static const float -+static float - dither_factor_blue_noise_64 (int x, int y) - { - float m = dither_blue_noise_64x64[((y & 0x3f) << 6) | (x & 0x3f)]; - return m * (1. / 4096.f) + (1. / 8192.f); - } - --static const float -+static float - dither_factor_bayer_8 (int x, int y) - { - uint32_t m; diff --git a/recipes/pixman/all/patches/0002-meson-build.patch b/recipes/pixman/all/patches/0002-meson-build.patch deleted file mode 100644 index 6063b377301a8..0000000000000 --- a/recipes/pixman/all/patches/0002-meson-build.patch +++ /dev/null @@ -1,253 +0,0 @@ -diff --git a/meson.build b/meson.build -index fad22ee..519441b 100644 ---- a/meson.build -+++ b/meson.build -@@ -23,7 +23,7 @@ project( - ['c'], - version : '0.38.4', - license : 'MIT', -- meson_version : '>= 0.47.2', -+ meson_version : '>= 0.50.0', - default_options : ['buildtype=debugoptimized'], - ) - -@@ -36,6 +36,7 @@ add_project_arguments( - '-Wdeclaration-after-statement', - '-fno-strict-aliasing', - '-fvisibility=hidden', -+ '-Wundef', - ]), - language : ['c'] - ) -@@ -50,7 +51,7 @@ endforeach - - use_loongson_mmi = get_option('loongson-mmi') - have_loongson_mmi = false --loongson_mmi_flags = ['-march=loongson2f'] -+loongson_mmi_flags = ['-mloongson-mmi'] - if not use_loongson_mmi.disabled() - if host_machine.cpu_family() == 'mips64' and cc.compiles(''' - #ifndef __mips_loongson_vector_rev -@@ -84,9 +85,17 @@ endif - - use_mmx = get_option('mmx') - have_mmx = false --mmx_flags = ['-mmmx', '-Winline'] -+mmx_flags = [] -+ -+if cc.get_id() == 'msvc' -+ mmx_flags = ['/w14710', '/w14714', '/wd4244'] -+elif cc.get_id() == 'sun' -+ mmx_flags = ['-xarch=sse'] -+else -+ mmx_flags = ['-mmmx', '-Winline'] -+endif - if not use_mmx.disabled() -- if host_machine.cpu_family() == 'x86_64' -+ if host_machine.cpu_family() == 'x86_64' or cc.get_id() == 'msvc' - have_mmx = true - elif host_machine.cpu_family() == 'x86' and cc.compiles(''' - #include -@@ -127,14 +136,23 @@ if not use_mmx.disabled() - endif - - if have_mmx -- config.set10('USE_X86_MMX', true) -+ # Inline assembly do not work on X64 MSVC, so we use -+ # compatibility intrinsics there -+ if cc.get_id() != 'msvc' or host_machine.cpu_family() != 'x86_64' -+ config.set10('USE_X86_MMX', true) -+ endif - elif use_mmx.enabled() - error('MMX Support unavailable, but required') - endif - - use_sse2 = get_option('sse2') - have_sse2 = false --sse2_flags = ['-msse2', '-Winline'] -+sse2_flags = [] -+if cc.get_id() == 'sun' -+ sse2_flags = ['-xarch=sse2'] -+elif cc.get_id() != 'msvc' -+ sse2_flags = ['-msse2', '-Winline'] -+endif - if not use_sse2.disabled() - if host_machine.cpu_family() == 'x86' - if cc.compiles(''' -@@ -169,8 +187,13 @@ endif - - use_ssse3 = get_option('ssse3') - have_ssse3 = false --ssse3_flags =['-mssse3', '-Winline'] --if not use_ssse3.disabled() -+ssse3_flags = [] -+if cc.get_id() != 'msvc' -+ ssse3_flags = ['-mssse3', '-Winline'] -+endif -+ -+# x64 pre-2010 MSVC compilers crashes when building the ssse3 code -+if not use_ssse3.disabled() and not (cc.get_id() == 'msvc' and cc.version().version_compare('<16') and host_machine.cpu_family() == 'x86_64') - if host_machine.cpu_family().startswith('x86') - if cc.compiles(''' - #include -@@ -349,14 +372,21 @@ if get_option('gnuplot') - config.set('PIXMAN_GNUPLOT', 1) - endif - --dep_openmp = dependency('openmp', required : get_option('openmp')) --if dep_openmp.found() -- config.set10('USE_OPENMP', true) --elif meson.version().version_compare('<0.51.0') --# In versions of meson before 0.51 the openmp dependency can still --# inject arguments in the the auto case when it is not found, the --# detection does work correctly in that case however, so we just --# replace dep_openmp with null_dep to work around this. -+if cc.get_id() != 'msvc' -+ dep_openmp = dependency('openmp', required : get_option('openmp')) -+ if dep_openmp.found() -+ config.set10('USE_OPENMP', true) -+ elif meson.version().version_compare('<0.51.0') -+ # In versions of meson before 0.51 the openmp dependency can still -+ # inject arguments in the the auto case when it is not found, the -+ # detection does work correctly in that case however, so we just -+ # replace dep_openmp with null_dep to work around this. -+ dep_openmp = null_dep -+ endif -+else -+ # the MSVC implementation of openmp is not compliant enough for our -+ # uses here, so we disable it here. -+ # Please see: https://stackoverflow.com/questions/12560243/using-threadprivate-directive-in-visual-studio - dep_openmp = null_dep - endif - -@@ -364,17 +394,56 @@ dep_gtk = dependency('gtk+-2.0', version : '>= 2.16', required : get_option('gtk - dep_glib = dependency('glib-2.0', required : get_option('gtk')) - dep_pixman = dependency('pixman-1', required : get_option('gtk'), - version : '>= ' + meson.project_version()) --dep_png = dependency('libpng', required : get_option('libpng')) -+ -+dep_png = null_dep -+if not get_option('libpng').disabled() -+ dep_png = dependency('libpng', required : false) -+ -+ # We need to look for the right library to link to for libpng, -+ # when looking for libpng manually -+ foreach png_ver : [ '16', '15', '14', '13', '12', '10' ] -+ if not dep_png.found() -+ dep_png = cc.find_library('libpng@0@'.format(png_ver), has_headers : ['png.h'], required : false) -+ endif -+ endforeach -+ -+ if get_option('libpng').enabled() and not dep_png.found() -+ error('libpng support requested but libpng library not found') -+ endif -+endif -+ - if dep_png.found() - config.set('HAVE_LIBPNG', 1) - endif - dep_m = cc.find_library('m', required : false) - dep_threads = dependency('threads') --if dep_threads.found() -+ -+# MSVC-style compilers do not come with pthreads, so we must link -+# to it explicitly, currently pthreads-win32 is supported -+pthreads_found = false -+ -+if dep_threads.found() and cc.has_header('pthread.h') -+ if cc.get_argument_syntax() == 'msvc' -+ pthread_lib = null_dep -+ foreach pthread_type : ['VC3', 'VSE3', 'VCE3', 'VC2', 'VSE2', 'VCE2'] -+ if not pthread_lib.found() -+ pthread_lib = cc.find_library('pthread@0@'.format(pthread_type), required : false) -+ endif -+ endforeach -+ if pthread_lib.found() -+ pthreads_found = true -+ dep_threads = pthread_lib -+ endif -+ else -+ pthreads_found = true -+ endif -+endif -+ -+if pthreads_found - config.set('HAVE_PTHREADS', 1) - endif - --funcs = ['sigaction', 'alarm', 'mprotect', 'getpagesize', 'mmap'] -+funcs = ['sigaction', 'alarm', 'mprotect', 'getpagesize', 'mmap', 'getisax', 'gettimeofday'] - # mingw claimes to have posix_memalign, but it doesn't - if host_machine.system() != 'windows' - funcs += 'posix_memalign' -@@ -386,10 +455,6 @@ foreach f : funcs - endif - endforeach - --if cc.has_function('gettimeofday') -- config.set('HAVE_GETTIMEOFDAY', 1) --endif -- - # This is only used in one test, that defines _GNU_SOURCE - if cc.has_function('feenableexcept', - prefix : '#define _GNU_SOURCE\n#include ', -@@ -407,8 +472,12 @@ foreach h : ['sys/mman.h', 'fenv.h', 'unistd.h'] - endif - endforeach - -+# gcc on Windows only warns that __declspec(thread) isn't supported, -+# passing -Werror=attributes makes it fail. - if (host_machine.system() == 'windows' and -- cc.compiles('int __declspec(thread) foo;', name : 'TLS via __declspec(thread)')) -+ cc.compiles('int __declspec(thread) foo;', -+ args : cc.get_supported_arguments(['-Werror=attributes']), -+ name : 'TLS via __declspec(thread)')) - config.set('TLS', '__declspec(thread)') - elif cc.compiles('int __thread foo;', name : 'TLS via __thread') - config.set('TLS', '__thread') -@@ -445,6 +514,8 @@ if host_machine.endian() == 'big' - config.set('WORDS_BIGENDIAN', 1) - endif - -+config.set('SIZEOF_LONG', cc.sizeof('long')) -+ - # Required to make pixman-private.h - config.set('PACKAGE', 'foo') - -diff --git a/pixman/meson.build b/pixman/meson.build -index 6ce87e7..f48357f 100644 ---- a/pixman/meson.build -+++ b/pixman/meson.build -@@ -30,6 +30,11 @@ version_h = configure_file( - install_dir : join_paths(get_option('prefix'), get_option('includedir'), 'pixman-1') - ) - -+libpixman_extra_cargs = [] -+if cc.has_function_attribute('dllexport') -+ libpixman_extra_cargs = ['-DPIXMAN_API=__declspec(dllexport)'] -+endif -+ - pixman_simd_libs = [] - simds = [ - # the mmx library can be compiled with mmx on x86/x86_64, iwmmxt on -@@ -97,10 +102,18 @@ pixman_files = files( - 'pixman-utils.c', - ) - --libpixman = shared_library( -+# We cannot use 'link_with' or 'link_whole' because meson wont do the right -+# thing for static archives. -+_obs = [] -+foreach l : pixman_simd_libs -+ _obs += l.extract_all_objects() -+endforeach -+ -+libpixman = library( - 'pixman-1', - [pixman_files, config_h, version_h], -- link_with : [pixman_simd_libs], -+ objects : _obs, -+ c_args : libpixman_extra_cargs, - dependencies : [dep_m, dep_threads], - version : meson.project_version(), - install : true, diff --git a/recipes/pixman/all/patches/0003-meson-static-build.patch b/recipes/pixman/all/patches/0003-meson-static-build.patch deleted file mode 100644 index 6283ba2680054..0000000000000 --- a/recipes/pixman/all/patches/0003-meson-static-build.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 48d5df1f3772a08a929dcb3b2fe4d7b1853223c9 Mon Sep 17 00:00:00 2001 -From: Benjamin Gilbert -Date: Thu, 5 Jan 2023 20:29:00 -0500 -Subject: [PATCH] meson: don't dllexport when built as static library - -If a static Pixman is linked with a dynamic library, Pixman shouldn't -export its own symbols into the latter's ABI. ---- - pixman/meson.build | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/pixman/meson.build b/pixman/meson.build -index 5dce870..62ec66b 100644 ---- a/pixman/meson.build -+++ b/pixman/meson.build -@@ -31,7 +31,8 @@ version_h = configure_file( - ) - - libpixman_extra_cargs = [] --if cc.has_function_attribute('dllexport') -+default_library = get_option('default_library') -+if default_library != 'static' and cc.has_function_attribute('dllexport') - libpixman_extra_cargs = ['-DPIXMAN_API=__declspec(dllexport)'] - endif - --- -GitLab - diff --git a/recipes/pixman/config.yml b/recipes/pixman/config.yml index 1daaad4889538..c3e710db89855 100644 --- a/recipes/pixman/config.yml +++ b/recipes/pixman/config.yml @@ -1,9 +1,7 @@ versions: + "0.43.4": + folder: "all" "0.43.0": folder: "all" "0.42.2": folder: "all" - "0.40.0": - folder: "all" - "0.38.4": - folder: "all" diff --git a/recipes/pkgconf/all/conandata.yml b/recipes/pkgconf/all/conandata.yml index 413c62bff29ba..33c2bc45652a3 100644 --- a/recipes/pkgconf/all/conandata.yml +++ b/recipes/pkgconf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.0": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-2.2.0.tar.xz" + sha256: "b06ff63a83536aa8c2f6422fa80ad45e4833f590266feb14eaddfe1d4c853c69" "2.1.0": url: "https://distfiles.ariadne.space/pkgconf/pkgconf-2.1.0.tar.xz" sha256: "266d5861ee51c52bc710293a1d36622ae16d048d71ec56034a02eb9cf9677761" @@ -21,6 +24,8 @@ sources: url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.7.3.tar.xz" sha256: "b846aea51cf696c3392a0ae58bef93e2e72f8e7073ca6ad1ed8b01c85871f9c0" patches: + "2.2.0": + - patch_file: "patches/2.2.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" "2.1.0": - patch_file: "patches/2.1.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" "2.0.3": diff --git a/recipes/pkgconf/all/patches/2.2.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch b/recipes/pkgconf/all/patches/2.2.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch new file mode 100644 index 0000000000000..344efd99da6e2 --- /dev/null +++ b/recipes/pkgconf/all/patches/2.2.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch @@ -0,0 +1,11 @@ +--- libpkgconf/path.c ++++ libpkgconf/path.c +@@ -170,7 +170,7 @@ + return 0; + + iter = workbuf = strdup(text); +- while ((p = strtok(iter, PKG_CONFIG_PATH_SEP_S)) != NULL) ++ while ((p = strtok(iter, ";:")) != NULL) + { + pkgconf_path_add(p, dirlist, filter); + diff --git a/recipes/pkgconf/all/test_package/conanfile.py b/recipes/pkgconf/all/test_package/conanfile.py index bf269283d5b1b..b2de624f38ef9 100644 --- a/recipes/pkgconf/all/test_package/conanfile.py +++ b/recipes/pkgconf/all/test_package/conanfile.py @@ -15,38 +15,24 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" test_type = "explicit" - win_bash = True @property def _settings_build(self): return getattr(self, "settings_build", self.settings) def requirements(self): - self.requires(self.tested_reference_str) # for the library - - def build_requirements(self): - self.tool_requires(self.tested_reference_str) # for the executable - self.tool_requires("automake/1.16.5") - if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", check_type=str): - self.tool_requires("msys2/cci.latest") + self.requires(self.tested_reference_str, run=True) def layout(self): cmake_layout(self, src_folder="src") def generate(self): - # Autotools project to test integration pkgconfig works - # during an Autotools configure run - at = AutotoolsToolchain(self) - at.generate() # Expose `PKG_CONFIG_PATH` to be able to find libexample1.pc env = Environment() - self.output.warning(f"Source folder: {self.source_folder}") + self.output.info(f"Source folder: {self.source_folder}") env.prepend_path("PKG_CONFIG_PATH", self.source_folder) - env.vars(self, scope="build").save_script("pkgconf-config-path") - - buildenv = VirtualBuildEnv(self) - buildenv.generate() + env.vars(self, scope="run").save_script("pkgconf-config-path") # CMake project to test that we can link against the library, # when the library is built @@ -56,6 +42,14 @@ def generate(self): deps = CMakeDeps(self) deps.generate() + # Check build environment postconditions + buildenv = VirtualBuildEnv(self) + env = buildenv.vars(scope='build') + assert 'PKG_CONFIG' in env.keys() + assert 'ACLOCAL_PATH' in env.keys() + assert 'AUTOMAKE_CONAN_INCLUDES' in env.keys() + buildenv.generate() + @property def _testing_library(self): # Workaround, in Conan >=2.0 we should be able to remove this in favour of: @@ -64,12 +58,6 @@ def _testing_library(self): return has_toolchain def build(self): - # Test that configure doesn't fail, we are not building the - # autotools project - autotools = Autotools(self) - autotools.autoreconf() - autotools.configure() - if self._testing_library: cmake = CMake(self) cmake.configure() @@ -78,14 +66,17 @@ def build(self): def test(self): # Check that we can find pkgconf in build environment # and that it is the expected version - output = StringIO() - self.run("pkgconf --about", output, env="conanbuild") - # TODO: When recipe is Conan 2+ only, this can be simplified - # to: self.dependencies['pkgconf'].ref.version - tokens = re.split('[@#]', self.tested_reference_str) - pkgconf_expected_version = tokens[0].split("/", 1)[1] - assert f"pkgconf {pkgconf_expected_version}" in output.getvalue() - + if can_run(self): + output = StringIO() + self.run("pkgconf --about", output, env="conanrun") + # TODO: When recipe is Conan 2+ only, this can be simplified + # to: self.dependencies['pkgconf'].ref.version + tokens = re.split('[@#]', self.tested_reference_str) + pkgconf_expected_version = tokens[0].split("/", 1)[1] + assert f"pkgconf {pkgconf_expected_version}" in output.getvalue() + + self.run("pkgconf libexample1 -cflags", env="conanrun") + # Test that executable linked against library runs as expected if can_run(self) and self._testing_library: test_executable = unix_path(self, os.path.join(self.cpp.build.bindirs[0], "test_package")) diff --git a/recipes/pkgconf/all/test_package/src/configure.ac b/recipes/pkgconf/all/test_package/src/configure.ac deleted file mode 100644 index 9b58503d96f4d..0000000000000 --- a/recipes/pkgconf/all/test_package/src/configure.ac +++ /dev/null @@ -1,9 +0,0 @@ -AC_INIT([test_package_pkgconf],[1.0]) -AC_PREREQ([2.69]) - -PKG_PREREQ([0.29]) -PKG_PROG_PKG_CONFIG -[echo pkg-config executable found at $PKG_CONFIG!] -PKG_CHECK_EXISTS([libexample1], - [echo "found libexample1 :D"], - [echo "libexample1 not found :("]) diff --git a/recipes/pkgconf/all/test_v1_package/CMakeLists.txt b/recipes/pkgconf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index f8b971e2db377..0000000000000 --- a/recipes/pkgconf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/pkgconf/all/test_v1_package/conanfile.py b/recipes/pkgconf/all/test_v1_package/conanfile.py deleted file mode 100644 index b2a27f28edf88..0000000000000 --- a/recipes/pkgconf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,56 +0,0 @@ -from conans import AutoToolsBuildEnvironment, CMake, ConanFile, tools, RunEnvironment -from conans.errors import ConanException -import os -import shutil - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake" - test_type = "explicit" - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - self.build_requires(self.tested_reference_str) - self.build_requires("automake/1.16.3") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - - def build(self): - # Test pkg.m4 integration into automake - shutil.copy(os.path.join(self.source_folder, "configure.ac"), - os.path.join(self.build_folder, "configure.ac")) - 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) - with tools.environment_append(RunEnvironment(self).vars): - autotools.configure() - - if self.options["pkgconf"].enable_lib: - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - if self.options["pkgconf"].enable_lib: - self.run(os.path.join("bin", "test_package"), run_environment=True) - - pkg_config = tools.get_env("PKG_CONFIG") - self.output.info("Read environment variable PKG_CONFIG='{}'".format(pkg_config)) - if not pkg_config or not pkg_config.startswith(self.deps_cpp_info["pkgconf"].rootpath.replace("\\", "/")): - raise ConanException("PKG_CONFIG variable incorrect") - - pkgconf_path = tools.which("pkgconf").replace("\\", "/") - self.output.info("Found pkgconf at '{}'".format(pkgconf_path)) - if not pkgconf_path or not pkgconf_path.startswith(self.deps_cpp_info["pkgconf"].rootpath.replace("\\", "/")): - raise ConanException("pkgconf executable not found") - - with tools.environment_append({"PKG_CONFIG_PATH": self.source_folder}): - self.run("{} libexample1 --libs".format(os.environ["PKG_CONFIG"]), run_environment=True) - self.run("{} libexample1 --cflags".format(os.environ["PKG_CONFIG"]), run_environment=True) diff --git a/recipes/pkgconf/all/test_v1_package/configure.ac b/recipes/pkgconf/all/test_v1_package/configure.ac deleted file mode 100644 index f9bf1936b8123..0000000000000 --- a/recipes/pkgconf/all/test_v1_package/configure.ac +++ /dev/null @@ -1,9 +0,0 @@ -AC_INIT([test_package_pkgconf],[1.0]) -AC_PREREQ([2.69]) - -PKG_PREREQ([0.29]) -PKG_PROG_PKG_CONFIG -[echo pkg-config executable found at $PKG_CONFIG!] -PKG_CHECK_EXISTS([sdl2], - [echo "found SDL2 :D"], - [echo "SDL2 not found :("]) diff --git a/recipes/pkgconf/all/test_v1_package/libexample1.pc b/recipes/pkgconf/all/test_v1_package/libexample1.pc deleted file mode 100644 index 5fc1beac53aac..0000000000000 --- a/recipes/pkgconf/all/test_v1_package/libexample1.pc +++ /dev/null @@ -1,6 +0,0 @@ -Name: libexample1 -Description: This is a description of libexample1. -Requires: -Version: 0.42 -Libs: -L/usr/lib -lexample1 -Cflags: -I/usr/include/libexample1 -I/usr/include -DEXAMPLE1_STATIC diff --git a/recipes/pkgconf/all/test_v1_package/test_package.c b/recipes/pkgconf/all/test_v1_package/test_package.c deleted file mode 100644 index f8fd8ee550059..0000000000000 --- a/recipes/pkgconf/all/test_v1_package/test_package.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "libpkgconf/libpkgconf.h" - -#include -#include -#include - -bool error_callback(const char *msg, const pkgconf_client_t *client, const void *data) { - printf("error callback: %s\n", msg); - fflush(stdout); - return 1; // 1/true means message handled -} - -int main() { - pkgconf_client_t client; - memset(&client, 0, sizeof(client)); - - pkgconf_client_init(&client, error_callback, NULL, pkgconf_cross_personality_default()); - - pkgconf_error(&client, "%s:%d %s: %s", __FILE__, __LINE__, __FUNCTION__, "test error"); - - pkgconf_client_deinit(&client); - - return 0; -} diff --git a/recipes/pkgconf/config.yml b/recipes/pkgconf/config.yml index f64bc13961492..369e560764ca3 100644 --- a/recipes/pkgconf/config.yml +++ b/recipes/pkgconf/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.0": + folder: "all" "2.1.0": folder: "all" "2.0.3": diff --git a/recipes/platformfolders/all/conandata.yml b/recipes/platformfolders/all/conandata.yml new file mode 100644 index 0000000000000..be79160f2c84f --- /dev/null +++ b/recipes/platformfolders/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.2.0": + url: "https://github.com/sago007/PlatformFolders/archive/refs/tags/4.2.0.tar.gz" + sha256: "31bb0f64a27315aec8994f226332aaafe9888d00bb69a2ff2dff9912e2f4ccf4" diff --git a/recipes/platformfolders/all/conanfile.py b/recipes/platformfolders/all/conanfile.py new file mode 100644 index 0000000000000..e9a661cbf1d78 --- /dev/null +++ b/recipes/platformfolders/all/conanfile.py @@ -0,0 +1,82 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + + +class PlatformFoldersConan(ConanFile): + name = "platformfolders" + license = "MIT" + homepage = "https://github.com/sago007/PlatformFolders" + url = "https://github.com/conan-io/conan-center-index" + description = "A C++ library to look for special directories like My Documents and APPDATA so that you do not need to write Linux, Windows or Mac OS X specific code" + topics = ("multi-platform", "xdg", "standardpaths", "special-folders") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _minimum_cpp_standard(self): + return 11 + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if is_msvc(self): + self.package_type = "static-library" + del self.options.shared + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PLATFORMFOLDERS_BUILD_TESTING"] = False + tc.variables["PLATFORMFOLDERS_BUILD_SHARED_LIBS"] = self.options.get_safe("shared", default=False) + tc.variables["PLATFORMFOLDERS_ENABLE_INSTALL"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["platform_folders"] + self.cpp_info.set_property("cmake_file_name", "platform_folders") + self.cpp_info.set_property("cmake_target_name", "sago::platform_folders") + self.cpp_info.set_property("cmake_target_aliases", ["platform_folders"]) + + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs.append("m") diff --git a/recipes/platformfolders/all/test_package/CMakeLists.txt b/recipes/platformfolders/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c75dde66e6a67 --- /dev/null +++ b/recipes/platformfolders/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(platform_folders REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sago::platform_folders) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/platformfolders/all/test_package/conanfile.py b/recipes/platformfolders/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b8c7713c1ed31 --- /dev/null +++ b/recipes/platformfolders/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +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): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/platformfolders/all/test_package/test_package.cpp b/recipes/platformfolders/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4570e8f5de608 --- /dev/null +++ b/recipes/platformfolders/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include + +#include + +int main() { + std::cout << "Config: " << sago::getConfigHome() << "\n"; + std::cout << "Data: " << sago::getDataHome() << "\n"; + std::cout << "State: " << sago::getStateDir() << "\n"; + std::cout << "Cache: " << sago::getCacheDir() << "\n"; + std::cout << "Documents: " << sago::getDocumentsFolder() << "\n"; + std::cout << "Desktop: " << sago::getDesktopFolder() << "\n"; + std::cout << "Pictures: " << sago::getPicturesFolder() << "\n"; + std::cout << "Music: " << sago::getMusicFolder() << "\n"; + std::cout << "Video: " << sago::getVideoFolder() << "\n"; + std::cout << "Download: " << sago::getDownloadFolder() << "\n"; + std::cout << "Save Games 1: " << sago::getSaveGamesFolder1() << "\n"; + std::cout << "Save Games 2: " << sago::getSaveGamesFolder2() << "\n"; + return 0; +} diff --git a/recipes/platformfolders/config.yml b/recipes/platformfolders/config.yml new file mode 100644 index 0000000000000..1b309b8e878d8 --- /dev/null +++ b/recipes/platformfolders/config.yml @@ -0,0 +1,3 @@ +versions: + "4.2.0": + folder: "all" diff --git a/recipes/poco/all/conandata.yml b/recipes/poco/all/conandata.yml index 9080050916ffa..c680025307662 100644 --- a/recipes/poco/all/conandata.yml +++ b/recipes/poco/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.13.3": + url: "https://github.com/pocoproject/poco/archive/poco-1.13.3-release.tar.gz" + sha256: "9f074d230daf30f550c5bde5528037bdab6aa83b2a06c81a25e89dd3bcb7e419" "1.13.2": url: "https://github.com/pocoproject/poco/archive/poco-1.13.2-release.tar.gz" sha256: "c01221870aa9bccedf1de39890279699207848fe61a0cfb6aeec7c5942c4627f" @@ -33,6 +36,13 @@ sources: url: "https://github.com/pocoproject/poco/archive/poco-1.11.3-release.tar.gz" sha256: "fb5e8e70c7dbc8f3b59ec8560140a267b4eaf06ee519dc21f312d0eb195cba37" patches: + "1.13.3": + - patch_file: patches/1.13.0.patch + patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" + patch_type: "conan" + - patch_file: patches/1.13.0-0002-mysql-include.patch + patch_description: "include mysql.h instead of mysql/mysql.h" + patch_type: "portability" "1.13.2": - patch_file: patches/1.13.0.patch patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" diff --git a/recipes/poco/all/conanfile.py b/recipes/poco/all/conanfile.py index b2d6762eae55d..8223c242f01e0 100644 --- a/recipes/poco/all/conanfile.py +++ b/recipes/poco/all/conanfile.py @@ -157,7 +157,7 @@ def requirements(self): self.requires("pcre2/10.42") self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True) if self.options.enable_xml: - self.requires("expat/2.5.0", transitive_headers=True) + self.requires("expat/[>=2.6.2 <3]", transitive_headers=True) if self.options.enable_data_sqlite: self.requires("sqlite3/3.45.0") if self.options.enable_apacheconnector: diff --git a/recipes/poco/config.yml b/recipes/poco/config.yml index e7879c451d919..a477d906ba0c3 100644 --- a/recipes/poco/config.yml +++ b/recipes/poco/config.yml @@ -1,4 +1,6 @@ versions: + "1.13.3": + folder: all "1.13.2": folder: all "1.13.1": diff --git a/recipes/polylabel/all/conandata.yml b/recipes/polylabel/all/conandata.yml index efb6a522362e3..0857fe72ca3c7 100644 --- a/recipes/polylabel/all/conandata.yml +++ b/recipes/polylabel/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.0": + url: "https://github.com/mapbox/polylabel/archive/refs/tags/v2.0.0.tar.gz" + sha256: "9aba4320c6cb5a8e9a8d44feb0d68b79b3127bdcb759a26aca92ac637668d7b9" "1.1.0": url: "https://github.com/mapbox/polylabel/archive/refs/tags/v1.1.0.tar.gz" sha256: "3694a3127954fab760686c825e2e585684934c768b5f9d542b8701e54147f1a8" diff --git a/recipes/polylabel/all/conanfile.py b/recipes/polylabel/all/conanfile.py index 402d5fbafc219..2e5e1eaff3562 100644 --- a/recipes/polylabel/all/conanfile.py +++ b/recipes/polylabel/all/conanfile.py @@ -1,7 +1,9 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.files import copy, get from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os required_conan_version = ">=1.52.0" @@ -10,13 +12,28 @@ class PolylabelConan(ConanFile): name = "polylabel" description = "A fast algorithm for finding the pole of inaccessibility of a polygon." - topics = ("polygon", "pole-of-inaccessibility") license = "ISC" - homepage = "https://github.com/mapbox/polylabel" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mapbox/polylabel" + topics = ("polygon", "pole-of-inaccessibility", "header-only") + 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 { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + def layout(self): basic_layout(self, src_folder="src") @@ -28,14 +45,15 @@ def package_id(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - 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): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) - - def build(self): - pass + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) diff --git a/recipes/polylabel/all/test_v1_package/CMakeLists.txt b/recipes/polylabel/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0c0d215f97b42..0000000000000 --- a/recipes/polylabel/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(polylabel REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE polylabel::polylabel) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/polylabel/config.yml b/recipes/polylabel/config.yml index b5c0d3cb2d409..2973f3b50e9e6 100644 --- a/recipes/polylabel/config.yml +++ b/recipes/polylabel/config.yml @@ -1,3 +1,5 @@ versions: + "2.0.0": + folder: all "1.1.0": folder: all diff --git a/recipes/popl/all/conandata.yml b/recipes/popl/all/conandata.yml new file mode 100644 index 0000000000000..ecb4877cc3587 --- /dev/null +++ b/recipes/popl/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3.0": + url: "https://github.com/badaix/popl/archive/refs/tags/v1.3.0.tar.gz" + sha256: "7c59554371da3c6c093bd79c2f403f921c1938bd523f1a48682352e0d92883a6" diff --git a/recipes/popl/all/conanfile.py b/recipes/popl/all/conanfile.py new file mode 100644 index 0000000000000..2d3d23c30b405 --- /dev/null +++ b/recipes/popl/all/conanfile.py @@ -0,0 +1,41 @@ +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 PoplConan(ConanFile): + name = "popl" + description = "Header-only C++ command line arguments parser that supports the same set of options as GNU's getopt." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/badaix/popl" + topics = ("cli", "command-line-arguments", "getopt", "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 validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "popl.hpp", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/popl/all/test_package/CMakeLists.txt b/recipes/popl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7fec26ab44c8e --- /dev/null +++ b/recipes/popl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(popl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE popl::popl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/popl/all/test_package/conanfile.py b/recipes/popl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/popl/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/popl/all/test_package/test_package.cpp b/recipes/popl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3e0ed006d49d2 --- /dev/null +++ b/recipes/popl/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include + +using namespace popl; + +int main(int argc, char **argv) { + OptionParser op("Allowed options"); + auto help_option = op.add("h", "help", "produce help message"); + op.parse(argc, argv); + std::cout << op << "\n"; +} diff --git a/recipes/popl/config.yml b/recipes/popl/config.yml new file mode 100644 index 0000000000000..426a0e4c79e9b --- /dev/null +++ b/recipes/popl/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.0": + folder: all diff --git a/recipes/primesieve/all/conandata.yml b/recipes/primesieve/all/conandata.yml index f4f2c000a99cc..c600acb0c9606 100644 --- a/recipes/primesieve/all/conandata.yml +++ b/recipes/primesieve/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "12.1": + url: "https://github.com/kimwalisch/primesieve/archive/refs/tags/v12.1.tar.gz" + sha256: "64e7f5d3ce680262b865c7aec1381ffb13d13f75dd985b964ce33806e1bbf386" "11.2": url: "https://github.com/kimwalisch/primesieve/archive/refs/tags/v11.2.tar.gz" sha256: "86c31bae9c378340b19669eafef8c5e45849adf7b9c92af1d212a2a2bfa0a5db" diff --git a/recipes/primesieve/all/conanfile.py b/recipes/primesieve/all/conanfile.py index c8e88390ec7a5..b2629bd8f8081 100644 --- a/recipes/primesieve/all/conanfile.py +++ b/recipes/primesieve/all/conanfile.py @@ -17,6 +17,7 @@ class PrimesieveConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/kimwalisch/primesieve" topics = ("math", "prime-numbers", "sieve-of-eratosthenes") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,7 +31,6 @@ class PrimesieveConan(ConanFile): "with_multiarch": True, "with_msvc_crt_static": False, } - package_type = "library" @property def _min_cppstd(self): @@ -50,9 +50,9 @@ def layout(self): def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) - + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) <= "5": - raise ConanInvalidConfiguration("GCC<=5 is currently not supported. Contributions with fixes are welcome.") + raise ConanInvalidConfiguration(f"{self.ref} doesn't support GCC<=5 currently. Contributions with fixes are welcome.") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/primesieve/all/test_package/CMakeLists.txt b/recipes/primesieve/all/test_package/CMakeLists.txt index ee808a6efb8b5..457aa08f2e6d7 100644 --- a/recipes/primesieve/all/test_package/CMakeLists.txt +++ b/recipes/primesieve/all/test_package/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) # if the project uses c++ +project(test_package LANGUAGES CXX) find_package(primesieve REQUIRED CONFIG) diff --git a/recipes/primesieve/config.yml b/recipes/primesieve/config.yml index 3b46283d96d88..c488150c0dff2 100644 --- a/recipes/primesieve/config.yml +++ b/recipes/primesieve/config.yml @@ -1,3 +1,5 @@ versions: + "12.1": + folder: all "11.2": folder: all diff --git a/recipes/pro-mdnsd/all/CMakeLists.txt b/recipes/pro-mdnsd/all/CMakeLists.txt deleted file mode 100644 index 361b35d4c17d9..0000000000000 --- a/recipes/pro-mdnsd/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) diff --git a/recipes/pro-mdnsd/all/conandata.yml b/recipes/pro-mdnsd/all/conandata.yml index f4bf0e41133c5..3ab03deb075b4 100644 --- a/recipes/pro-mdnsd/all/conandata.yml +++ b/recipes/pro-mdnsd/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "0.8.4": - patch_file: "patches/0001-cmake-install-bundle.patch" - base_path: "source_subfolder" diff --git a/recipes/pro-mdnsd/all/conanfile.py b/recipes/pro-mdnsd/all/conanfile.py index 8d1745ad0e35c..feeeec6738fe1 100644 --- a/recipes/pro-mdnsd/all/conanfile.py +++ b/recipes/pro-mdnsd/all/conanfile.py @@ -1,41 +1,37 @@ -from conans import ConanFile, CMake, tools import os import textwrap -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save, rename + +required_conan_version = ">=1.53.0" class mdnsdConan(ConanFile): name = "pro-mdnsd" + description = "Improved version of Jeremie Miller's MDNS-SD implementation" license = "BSD-3-Clause" - homepage = "https://github.com/Pro/mdnsd" url = "https://github.com/conan-io/conan-center-index" - description = "Improved version of Jeremie Miller's MDNS-SD implementation" + homepage = "https://github.com/Pro/mdnsd" topics = ("dns", "daemon", "multicast", "embedded", "c") - settings = "os", "compiler", "build_type", "arch" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { - "fPIC": [True, False], "shared": [True, False], + "fPIC": [True, False], "compile_as_cpp": [True, False], } default_options = { - "fPIC": True, "shared": False, + "fPIC": True, "compile_as_cpp": False, } - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -43,36 +39,38 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if not self.options.compile_as_cpp: - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") 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["MDNSD_ENABLE_SANITIZERS"] = False - self._cmake.definitions["MDNSD_COMPILE_AS_CXX"] = self.options.compile_as_cpp - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MDNSD_ENABLE_SANITIZERS"] = False + tc.variables["MDNSD_COMPILE_AS_CXX"] = self.options.compile_as_cpp + 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): - 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, "share")) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( @@ -80,28 +78,28 @@ def package(self): {"libmdnsd": "mdnsd::mdnsd"} ) - @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) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + 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", "mdnsd") - self.cpp_info.set_property("cmake_target_name", "libmdnsd") + self.cpp_info.set_property("cmake_target_name", "libmdnsd") + self.cpp_info.set_property("cmake_target_aliases", ["mdnsd::mdnsd"]) self.cpp_info.libs = ["mdnsd"] if self.settings.os == "Windows": - self.cpp_info.system_libs.append("ws2_32") + self.cpp_info.system_libs = ["ws2_32", "wsock32"] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "mdnsd" diff --git a/recipes/pro-mdnsd/all/test_package/CMakeLists.txt b/recipes/pro-mdnsd/all/test_package/CMakeLists.txt index ff7f7e8ca3d71..5a773c9696280 100644 --- a/recipes/pro-mdnsd/all/test_package/CMakeLists.txt +++ b/recipes/pro-mdnsd/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(mdnsd REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} libmdnsd) +target_link_libraries(${PROJECT_NAME} mdnsd::mdnsd) diff --git a/recipes/pro-mdnsd/all/test_package/conanfile.py b/recipes/pro-mdnsd/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/pro-mdnsd/all/test_package/conanfile.py +++ b/recipes/pro-mdnsd/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/pro-mdnsd/all/test_v1_package/CMakeLists.txt b/recipes/pro-mdnsd/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/pro-mdnsd/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/pro-mdnsd/all/test_v1_package/conanfile.py b/recipes/pro-mdnsd/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/pro-mdnsd/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/proj/all/conandata.yml b/recipes/proj/all/conandata.yml index 95a7cf689dd27..4dfa942ea7d40 100644 --- a/recipes/proj/all/conandata.yml +++ b/recipes/proj/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "9.4.1": + url: "https://github.com/OSGeo/PROJ/releases/download/9.4.1/proj-9.4.1.tar.gz" + sha256: "ffe20170ee2b952207adf8a195e2141eab12cda181e49fdeb54425d98c7171d7" "9.3.1": url: "https://github.com/OSGeo/PROJ/releases/download/9.3.1/proj-9.3.1.tar.gz" sha256: "b0f919cb9e1f42f803a3e616c2b63a78e4d81ecfaed80978d570d3a5e29d10bc" @@ -8,18 +11,6 @@ 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" - "9.1.0": - url: "https://github.com/OSGeo/PROJ/releases/download/9.1.0/proj-9.1.0.tar.gz" - sha256: "81b2239b94cad0886222cde4f53cb49d34905aad2a1317244a0c30a553db2315" - "9.0.1": - url: "https://github.com/OSGeo/PROJ/releases/download/9.0.1/proj-9.0.1.tar.gz" - sha256: "737eaacbe7906d0d6ff43f0d9ebedc5c734cccc9e6b8d7beefdec3ab22d9a6a3" - "9.0.0": - url: "https://github.com/OSGeo/PROJ/releases/download/9.0.0/proj-9.0.0.tar.gz" - sha256: "0620aa01b812de00b54d6c23e7c5cc843ae2cd129b24fabe411800302172b989" "8.2.1": url: "https://github.com/OSGeo/PROJ/releases/download/8.2.1/proj-8.2.1.tar.gz" sha256: "76ed3d0c3a348a6693dfae535e5658bbfd47f71cb7ff7eb96d9f12f7e068b1cf" @@ -42,26 +33,6 @@ patches: - 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" - patch_description: "Use cmake targets" - "9.1.0": - - patch_file: "patches/0001-use-cmake-targets-9.1.0.patch" - patch_type: "conan" - patch_description: "Use cmake targets" - "9.0.1": - - patch_file: "patches/0001-use-cmake-targets-9.0.1.patch" - patch_type: "conan" - patch_description: "Use cmake targets" - "9.0.0": - - patch_file: "patches/0001-use-cmake-targets-9.0.0.patch" - patch_type: "conan" - patch_description: "Use cmake targets" - - patch_file: "patches/0002-cmake-configure-proj-pc.patch" - patch_type: "portability" - patch_description: "cmake configure proj pc" - patch_source: "https://github.com/OSGeo/PROJ/pull/3087" "8.2.1": - patch_file: "patches/0001-use-cmake-targets-8.2.0.patch" patch_type: "conan" diff --git a/recipes/proj/all/conanfile.py b/recipes/proj/all/conanfile.py index cc5091962196d..d687913f6a248 100644 --- a/recipes/proj/all/conanfile.py +++ b/recipes/proj/all/conanfile.py @@ -8,7 +8,6 @@ from conan.tools.scm import Version import os - required_conan_version = ">=1.60.0 <2 || >=2.0.5" @@ -68,6 +67,8 @@ def requirements(self): self.requires("libcurl/[>=7.78.0 <9]") def build_requirements(self): + if Version(self.version) >= "9.4.0": + self.tool_requires("cmake/[>=3.16 <4]") if not self._is_legacy_one_profile: self.tool_requires("sqlite3/") @@ -109,6 +110,7 @@ def generate(self): # Workaround for: https://github.com/conan-io/conan/issues/13560 libdirs_host = [l for dependency in self.dependencies.host.values() for l in dependency.cpp_info.aggregated_components().libdirs] tc.variables["CMAKE_BUILD_RPATH"] = ";".join(libdirs_host) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) @@ -118,19 +120,19 @@ def _patch_sources(self): apply_conandata_patches(self) cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "/W4", "") # Fix up usage of SQLite3 finder outputs - rm(self, "FindSqlite3.cmake", os.path.join(self.source_folder, "cmake")) - replace_in_file(self, cmakelists, "SQLITE3_FOUND", "SQLite3_FOUND") - replace_in_file(self, cmakelists, "SQLITE3_VERSION", "SQLite3_VERSION") - replace_in_file(self, cmakelists, "find_package(Sqlite3 REQUIRED)", "find_package(SQLite3 REQUIRED)") + if Version(self.version) < "9.4.0": + rm(self, "FindSqlite3.cmake", os.path.join(self.source_folder, "cmake")) + replace_in_file(self, cmakelists, "SQLITE3_FOUND", "SQLite3_FOUND") + replace_in_file(self, cmakelists, "SQLITE3_VERSION", "SQLite3_VERSION") + replace_in_file(self, cmakelists, "find_package(Sqlite3 REQUIRED)", "find_package(SQLite3 REQUIRED)") # Let CMake install shared lib with a clean rpath ! - if Version(self.version) >= "7.1.0" and Version(self.version) < "9.0.0": - replace_in_file(self, cmakelists, - "set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", - "") + if "7.1.0" <= Version(self.version) < "9.0.0": + replace_in_file(self, cmakelists, "set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", "") # Aggressive workaround against SIP on macOS, to handle sqlite3 executable # linked to shared sqlite3 lib @@ -155,6 +157,11 @@ def _patch_sources(self): if Version(self.version) < "8.1.0": rmdir(self, os.path.join(self.source_folder, "include", "proj", "internal", "nlohmann")) + # Remove warning flags that are unfamiliar to GCC 5 + if Version(self.version) >= "9.0" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8.0": + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "${PROJ_C_WARN_FLAGS}", "") + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "${PROJ_CXX_WARN_FLAGS}", "") + def build(self): self._patch_sources() cmake = CMake(self) diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch b/recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch deleted file mode 100644 index c7cf8eab51037..0000000000000 --- a/recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/src/lib_proj.cmake -+++ b/src/lib_proj.cmake -@@ -444,8 +444,7 @@ if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT) - 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) -@@ -455,16 +454,14 @@ endif() - - if(TIFF_ENABLED) - target_compile_definitions(proj PRIVATE -DTIFF_ENABLED) -- target_include_directories(proj PRIVATE ${TIFF_INCLUDE_DIR}) -- target_link_libraries(proj PRIVATE ${TIFF_LIBRARY}) -+ target_link_libraries(proj PRIVATE TIFF::TIFF) - endif() - - if(CURL_ENABLED) - target_compile_definitions(proj PRIVATE -DCURL_ENABLED) -- target_include_directories(proj PRIVATE ${CURL_INCLUDE_DIR}) - target_link_libraries(proj - PRIVATE -- ${CURL_LIBRARY} -+ CURL::libcurl - $<$:ws2_32> - $<$:wldap32> - $<$:advapi32> diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-9.0.1.patch b/recipes/proj/all/patches/0001-use-cmake-targets-9.0.1.patch deleted file mode 100644 index 6920410551838..0000000000000 --- a/recipes/proj/all/patches/0001-use-cmake-targets-9.0.1.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/src/lib_proj.cmake -+++ b/src/lib_proj.cmake -@@ -444,8 +444,7 @@ if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT) - 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) -@@ -455,16 +454,14 @@ endif() - - if(TIFF_ENABLED) - target_compile_definitions(proj PRIVATE -DTIFF_ENABLED) -- target_include_directories(proj PRIVATE ${TIFF_INCLUDE_DIR}) -- target_link_libraries(proj PRIVATE ${TIFF_LIBRARY}) -+ target_link_libraries(proj PRIVATE TIFF::TIFF) - endif() - - if(CURL_ENABLED) - target_compile_definitions(proj PRIVATE -DCURL_ENABLED) -- target_include_directories(proj PRIVATE ${CURL_INCLUDE_DIRS}) - target_link_libraries(proj - PRIVATE -- ${CURL_LIBRARIES} -+ CURL::libcurl - $<$:ws2_32> - $<$:wldap32> - $<$:advapi32> diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-9.1.0.patch b/recipes/proj/all/patches/0001-use-cmake-targets-9.1.0.patch deleted file mode 100644 index ddd144b4ef122..0000000000000 --- a/recipes/proj/all/patches/0001-use-cmake-targets-9.1.0.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/src/lib_proj.cmake -+++ b/src/lib_proj.cmake -@@ -447,8 +447,7 @@ if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT) - 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) -@@ -458,16 +457,14 @@ endif() - - if(TIFF_ENABLED) - target_compile_definitions(proj PRIVATE -DTIFF_ENABLED) -- target_include_directories(proj PRIVATE ${TIFF_INCLUDE_DIR}) -- target_link_libraries(proj PRIVATE ${TIFF_LIBRARY}) -+ target_link_libraries(proj PRIVATE TIFF::TIFF) - endif() - - if(CURL_ENABLED) - target_compile_definitions(proj PRIVATE -DCURL_ENABLED) -- target_include_directories(proj PRIVATE ${CURL_INCLUDE_DIRS}) - target_link_libraries(proj - PRIVATE -- ${CURL_LIBRARIES} -+ CURL::libcurl - $<$:ws2_32> - $<$:wldap32> - $<$:advapi32> diff --git a/recipes/proj/all/patches/0002-cmake-configure-proj-pc.patch b/recipes/proj/all/patches/0002-cmake-configure-proj-pc.patch deleted file mode 100644 index e39909dc403a9..0000000000000 --- a/recipes/proj/all/patches/0002-cmake-configure-proj-pc.patch +++ /dev/null @@ -1,13 +0,0 @@ -fixed by https://github.com/OSGeo/PROJ/pull/3087 - ---- a/cmake/ProjUtilities.cmake -+++ b/cmake/ProjUtilities.cmake -@@ -98,7 +98,7 @@ function(configure_proj_pc) - list(APPEND EXTRA_LIBS -lole32 -lshell32) - else() - set(cxx_libs "${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}") -- list(REMOVE_ITEM cxx_libs ${CMAKE_C_IMPLICIT_LINK_LIBRARIES}) -+ list(REMOVE_ITEM cxx_libs ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} CMake_3.19_quirk) - foreach(lib IN LISTS cxx_libs) - list(APPEND EXTRA_LIBS "-l${lib}") - endforeach() diff --git a/recipes/proj/config.yml b/recipes/proj/config.yml index ab5afce9c830c..557db04c01e50 100644 --- a/recipes/proj/config.yml +++ b/recipes/proj/config.yml @@ -1,18 +1,12 @@ versions: + "9.4.1": + folder: "all" "9.3.1": folder: "all" "9.3.0": folder: "all" "9.2.1": folder: "all" - "9.1.1": - folder: "all" - "9.1.0": - folder: "all" - "9.0.1": - folder: "all" - "9.0.0": - folder: "all" "8.2.1": folder: "all" "7.2.1": diff --git a/recipes/proposal/all/conandata.yml b/recipes/proposal/all/conandata.yml index 413be0b0859fb..6fbf698e7992a 100644 --- a/recipes/proposal/all/conandata.yml +++ b/recipes/proposal/all/conandata.yml @@ -2,51 +2,9 @@ sources: "7.6.2": url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.6.2.tar.gz" sha256: "52e91807009b8e610deee485ea57523482cf5626a28f3e42b747dc58d9f505d8" - "7.6.1": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.6.1.tar.gz" - sha256: "ed1621e1b859179672468330c1a5ac7d84a4c0a5b80d6bf826b22ed6ef6967ca" - "7.6.0": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.6.0.tar.gz" - sha256: "8c0ddd53ac81c2c4959f2425a9d4bf8e40fba55f03407aefc1d3ac9b3d523a62" "7.5.1": url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.5.1.tar.gz" sha256: "2a283bfc335c4b6b01d2acc1eea1a5e4c456bd3dd11e41ef24ca3d955c9655a3" - "7.5.0": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.5.0.tar.gz" - sha256: "ba31bd0a2337f3717a1ad88a3b3f7fefa3f1e4dae4fc922e72144cfecffe5e94" "7.4.2": url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.2.tar.gz" sha256: "f0db44c96a80a6ce3dda02c598574f5f0209376bd2c6c176797710da8eb3e108" - "7.4.1": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.1.tar.gz" - sha256: "e6ff9749f402dd77f320a2a28b77a45636cbe186f926d9b5a7b54ea6ee631ada" - "7.4.0": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.0.tar.gz" - sha256: "34865a84052c670fbc4554361acef716655906f65f5bba88e3fd73dff92989de" - "7.3.1": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.3.1.tar.gz" - sha256: "260426f71226c888832a6da47c55c05dab31b8240dbbc67b4b2466af24d962d3" - "7.3.0": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.3.0.tar.gz" - sha256: "fa3763fee656164e5f3a7d6a11f08771dd70700adb93de9db4625ad981e0defb" - "7.2.1": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.2.1.tar.gz" - sha256: "279c1b897c8ae426a493ca77e01c8cfd47e8cd313f3e35ed3ddf098dcccdeeda" - "7.1.1": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.1.1.tar.gz" - sha256: "090e885d6f241b87a98234571cc1bd2ff935933365717e327602ea37f4d3548a" - "7.1.0": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.1.0.tar.gz" - sha256: "98faba7cd9d743dae2a8bec70b1c4a382339b9fa40b71fda2936c9d7054d7a85" - "7.0.7": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.7.tar.gz" - sha256: "e366e9280fbe99e68bc5b31a74f51610e27ca8a646dff28e883573893572ab75" - "7.0.5": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.5.tar.gz" - sha256: "232f84e410f439e6bc1b721fc65280906e9f6ad5b39490561870d42a1ee1af17" - "7.0.4": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.4.tar.gz" - sha256: "1442b9f5d8824e7794e97a2eca3f5f109e33c423a37714ada9ad98435b4d4b01" - "7.0.2": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.2.tar.gz" - sha256: "8166ffca150abce77cc4254343bb89d3476e17910e96fa4936b87dafcc72d592" diff --git a/recipes/proposal/all/conanfile.py b/recipes/proposal/all/conanfile.py index 99caccadb2b21..8f555fa886660 100644 --- a/recipes/proposal/all/conanfile.py +++ b/recipes/proposal/all/conanfile.py @@ -61,9 +61,9 @@ def requirements(self): # from implementation in headers (templates) self.requires("cubicinterpolation/0.1.5", transitive_headers=True, transitive_libs=True) # spdlog: requires transitive_libs due to direct calls to functionality from headers - self.requires("spdlog/1.11.0", transitive_headers=True, transitive_libs=True) + self.requires("spdlog/[>=1.11 <2]", transitive_headers=True, transitive_libs=True) # nlohmann_json: public headers include json.hpp and json_fwd.hpp - self.requires("nlohmann_json/3.11.2", transitive_headers=True) + self.requires("nlohmann_json/[~3.11]", transitive_headers=True) if self.options.with_python: self.requires("pybind11/2.10.1") diff --git a/recipes/proposal/config.yml b/recipes/proposal/config.yml index 52f45a4a6325f..eeec1942674b6 100644 --- a/recipes/proposal/config.yml +++ b/recipes/proposal/config.yml @@ -1,35 +1,7 @@ versions: "7.6.2": folder: all - "7.6.1": - folder: all - "7.6.0": - folder: all "7.5.1": folder: all - "7.5.0": - folder: all "7.4.2": folder: all - "7.4.1": - folder: all - "7.4.0": - folder: all - "7.3.1": - folder: all - "7.3.0": - folder: all - "7.2.1": - folder: all - "7.1.1": - folder: all - "7.1.0": - folder: all - "7.0.7": - folder: all - "7.0.5": - folder: all - "7.0.4": - folder: all - "7.0.2": - folder: all diff --git a/recipes/protobuf/all/conandata.yml b/recipes/protobuf/all/conandata.yml index 0417c4d805f42..c03c8334c3fff 100644 --- a/recipes/protobuf/all/conandata.yml +++ b/recipes/protobuf/all/conandata.yml @@ -1,62 +1,99 @@ sources: + "5.27.0": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v5.27.0.tar.gz" + sha256: "1611a03e550c27c526bde1da544c94f7aa65c10687bbc8e570537dfa94069e1a" + "4.25.3": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v4.25.3.tar.gz" + sha256: "1d6b8d9114cb5b33ce8711729893097a107d4fefff5423528eb1decb5451856c" "3.21.12": url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.12.tar.gz" sha256: "930c2c3b5ecc6c9c12615cf5ad93f1cd6e12d0aba862b572e076259970ac3a53" - "3.21.9": - url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.9.tar.gz" - sha256: "1add10f9bd92775b91f326da259f243881e904dd509367d5031d4c782ba82810" "3.20.3": url: "https://github.com/protocolbuffers/protobuf/archive/v3.20.3.tar.gz" sha256: "9c0fd39c7a08dff543c643f0f4baf081988129a411b977a07c46221793605638" - "3.20.0": - url: "https://github.com/protocolbuffers/protobuf/archive/v3.20.0.tar.gz" - sha256: "b07772d38ab07e55eca4d50f4b53da2d998bb221575c60a4f81100242d4b4889" - "3.19.6": - url: "https://github.com/protocolbuffers/protobuf/archive/v3.19.6.tar.gz" - sha256: "9a301cf94a8ddcb380b901e7aac852780b826595075577bb967004050c835056" - "3.18.3": - url: "https://github.com/protocolbuffers/protobuf/archive/v3.18.3.tar.gz" - sha256: "663b3a6d56605e6ab7888d32a1525c34f34639b25b8996337821591e60c37041" - "3.17.1": - 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" - patch_type: "bugfix" - patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" "3.20.3": - patch_file: "patches/protobuf-3.20.0-upstream-macos-macros.patch" patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" patch_type: "bugfix" patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" - "3.20.0": - - patch_file: "patches/protobuf-3.20.0-upstream-macos-macros.patch" - patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" - patch_type: "bugfix" - patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" - "3.19.6": - - patch_file: "patches/upstream-pr-9437-msvc-runtime.patch" - patch_description: "Properly handle CMAKE_MSVC_RUNTIME_LIBRARY when using CMake >= 3.15" - patch_type: "portability" - patch_source: "https://github.com/protocolbuffers/protobuf/pull/9437" - - patch_file: "patches/protobuf-3.19.6-upstream-macos-macros.patch" - patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" - patch_type: "bugfix" - patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" - "3.18.3": - - patch_file: "patches/protobuf-3.18.1-upstream-macos-macros.patch" - patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" - patch_type: "bugfix" - patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" - "3.17.1": - - patch_file: "patches/protobuf-3.17.1-upstream-macos-macros.patch" - patch_description: "Handle case where macOS SDK macros may conflict with protobuf message types" - patch_type: "bugfix" - patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" +absl_deps: + "5.27.0": + - absl_absl_check + - absl_absl_log + - absl_algorithm + - absl_base + - absl_bind_front + - absl_bits + - absl_btree + - absl_cleanup + - absl_cord + - absl_core_headers + - absl_debugging + - absl_die_if_null + - absl_dynamic_annotations + - absl_flags + - absl_flat_hash_map + - absl_flat_hash_set + - absl_function_ref + - absl_hash + - absl_if_constexpr + - absl_layout + - absl_log_initialize + - absl_log_globals + - absl_log_severity + - absl_memory + - absl_node_hash_map + - absl_node_hash_set + - absl_optional + - absl_random_distributions + - absl_random_random + - absl_span + - absl_status + - absl_statusor + - absl_strings + - absl_synchronization + - absl_time + - absl_type_traits + - absl_utility + - absl_variant + "4.25.3": + - absl_absl_check + - absl_absl_log + - absl_algorithm + - absl_base + - absl_bind_front + - absl_bits + - absl_btree + - absl_cleanup + - absl_cord + - absl_core_headers + - absl_debugging + - absl_die_if_null + - absl_dynamic_annotations + - absl_flags + - absl_flat_hash_map + - absl_flat_hash_set + - absl_function_ref + - absl_hash + - absl_layout + - absl_log_initialize + - absl_log_severity + - absl_memory + - absl_node_hash_map + - absl_node_hash_set + - absl_optional + - absl_span + - absl_status + - absl_statusor + - absl_strings + - absl_synchronization + - absl_time + - absl_type_traits + - absl_utility + - absl_variant diff --git a/recipes/protobuf/all/conanfile.py b/recipes/protobuf/all/conanfile.py index f696a27880684..2b0003b1adc84 100644 --- a/recipes/protobuf/all/conanfile.py +++ b/recipes/protobuf/all/conanfile.py @@ -1,13 +1,13 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import copy, rename, get, apply_conandata_patches, export_conandata_patches, replace_in_file, rmdir, rm from conan.tools.microsoft import check_min_vs, msvc_runtime_flag, is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os -import textwrap required_conan_version = ">=1.53" @@ -27,6 +27,7 @@ class ProtobufConan(ConanFile): "with_zlib": [True, False], "with_rtti": [True, False], "lite": [True, False], + "upb": [True, False], "debug_suffix": [True, False], } default_options = { @@ -35,6 +36,7 @@ class ProtobufConan(ConanFile): "with_zlib": True, "with_rtti": True, "lite": False, + "upb": False, "debug_suffix": True, } @@ -47,9 +49,15 @@ def _is_clang_cl(self): @property def _is_clang_x86(self): return self.settings.compiler == "clang" and self.settings.arch == "x86" + + @property + def _protobuf_release(self): + current_ver = Version(self.version) + return Version(f"{current_ver.minor}.{current_ver.patch}") def export_sources(self): export_conandata_patches(self) + copy(self, "protobuf-conan-protoc-target.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -59,6 +67,9 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + if self._protobuf_release < "27.0": + self.options.rm_safe("upb") + def layout(self): cmake_layout(self, src_folder="src") @@ -66,10 +77,39 @@ def requirements(self): if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") + if self._protobuf_release >= "22.0": + self.requires("abseil/20240116.2", transitive_headers=True) + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + def validate(self): if self.options.shared and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Protobuf can't be built with shared + MT(d) runtimes") - + + if is_msvc(self) and self._protobuf_release >= "22" and self.options.shared and \ + not self.dependencies["abseil"].options.shared: + raise ConanInvalidConfiguration("When building protobuf as a shared library on Windows, " + "abseil needs to be a shared library too") + + if self._protobuf_release >= "22.0": + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + else: + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), None) + compiler_version = Version(self.settings.compiler.version) + if minimum_version and compiler_version < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++14, which your compiler does not support.", + ) + check_min_vs(self, "190") if self.settings.compiler == "clang": @@ -93,6 +133,11 @@ def generate(self): tc.cache_variables["protobuf_DEBUG_POSTFIX"] = "" tc.cache_variables["protobuf_BUILD_LIBPROTOC"] = self.settings.os != "tvOS" tc.cache_variables["protobuf_DISABLE_RTTI"] = not self.options.with_rtti + tc.cache_variables["protobuf_BUILD_LIBUPB"] = self.options.get_safe("upb") + if self._protobuf_release >= "22.0": + tc.cache_variables["protobuf_ABSL_PROVIDER"] = "package" + if not self.settings.compiler.get_safe("cppstd") and self._protobuf_release >= "22.0": + tc.variables["CMAKE_CXX_STANDARD"] = 14 if is_msvc(self) or self._is_clang_cl: runtime = msvc_runtime_flag(self) if not runtime: @@ -109,53 +154,14 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - # Provide relocatable protobuf::protoc target and Protobuf_PROTOC_EXECUTABLE cache variable - # TODO: some of the following logic might be disabled when conan will - # allow to create executable imported targets in package_info() - protobuf_config_cmake = os.path.join(self.source_folder, "cmake", "protobuf-config.cmake.in") - - replace_in_file(self, - protobuf_config_cmake, - "@_protobuf_FIND_ZLIB@", - "# BEGIN CONAN PATCH\n#_protobuf_FIND_ZLIB@\n# END CONAN PATCH" - ) - - exe_ext = ".exe" if self.settings.os == "Windows" else "" - protoc_filename = "protoc" + exe_ext - module_folder_depth = len(os.path.normpath(self._cmake_install_base_path).split(os.path.sep)) - protoc_rel_path = "{}bin/{}".format("".join(["../"] * module_folder_depth), protoc_filename) - protoc_target = textwrap.dedent(f"""\ - if(NOT TARGET protobuf::protoc) - # Locate protoc executable - ## Workaround for legacy "cmake" generator in case of cross-build - if(CMAKE_CROSSCOMPILING) - find_program(PROTOC_PROGRAM NAMES protoc PATHS ENV PATH NO_DEFAULT_PATH) - endif() - ## And here this will work fine with "CMakeToolchain" (for native & cross-build) - ## and legacy "cmake" generator in case of native build - if(NOT PROTOC_PROGRAM) - find_program(PROTOC_PROGRAM NAMES protoc) - endif() - ## Last resort: we search in package folder directly - if(NOT PROTOC_PROGRAM) - set(PROTOC_PROGRAM \"${{CMAKE_CURRENT_LIST_DIR}}/{protoc_rel_path}\") - endif() - get_filename_component(PROTOC_PROGRAM \"${{PROTOC_PROGRAM}}\" ABSOLUTE) - - # Give opportunity to users to provide an external protoc executable - # (this is a feature of official FindProtobuf.cmake) - set(Protobuf_PROTOC_EXECUTABLE ${{PROTOC_PROGRAM}} CACHE FILEPATH \"The protoc compiler\") - - # Create executable imported target protobuf::protoc - add_executable(protobuf::protoc IMPORTED) - set_property(TARGET protobuf::protoc PROPERTY IMPORTED_LOCATION ${{Protobuf_PROTOC_EXECUTABLE}}) - endif() - """) - replace_in_file(self, - protobuf_config_cmake, - "include(\"${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake\")", - protoc_target - ) + if self._protobuf_release < "22.0": + # In older versions of protobuf, this file defines the `protobuf_generate` function + protobuf_config_cmake = os.path.join(self.source_folder, "cmake", "protobuf-config.cmake.in") + replace_in_file(self, protobuf_config_cmake, "@_protobuf_FIND_ZLIB@", "") + replace_in_file(self, protobuf_config_cmake, + "include(\"${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake\")", + "" + ) # Disable a potential warning in protobuf-module.cmake.in # TODO: remove this patch? Is it really useful? @@ -171,13 +177,6 @@ def _patch_sources(self): "endif()", ) - # https://github.com/protocolbuffers/protobuf/issues/9916 - # it will be solved in protobuf 3.21.0 - if Version(self.version) == "3.20.0": - replace_in_file(self, os.path.join(self.source_folder, "src", "google", "protobuf", "port_def.inc"), - "#elif PROTOBUF_GNUC_MIN(12, 0)", - "#elif PROTOBUF_GNUC_MIN(12, 2)") - def build(self): self._patch_sources() cmake = CMake(self) @@ -190,11 +189,15 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - os.unlink(os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-config-version.cmake")) - os.unlink(os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-targets.cmake")) - os.unlink(os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-targets-{}.cmake".format(str(self.settings.build_type).lower()))) - rename(self, os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-config.cmake"), - os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-generate.cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake", "utf8_range")) + if self._protobuf_release < "22.0": + rename(self, os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-config.cmake"), + os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-generate.cmake")) + + cmake_config_folder = os.path.join(self.package_folder, self._cmake_install_base_path) + rm(self, "protobuf-config*.cmake", folder=cmake_config_folder) + rm(self, "protobuf-targets*.cmake", folder=cmake_config_folder) + copy(self, "protobuf-conan-protoc-target.cmake", src=self.source_folder, dst=cmake_config_folder) if not self.options.lite: rm(self, "libprotobuf-lite*", os.path.join(self.package_folder, "lib")) @@ -210,12 +213,32 @@ def package_info(self): os.path.join(self._cmake_install_base_path, "protobuf-generate.cmake"), os.path.join(self._cmake_install_base_path, "protobuf-module.cmake"), os.path.join(self._cmake_install_base_path, "protobuf-options.cmake"), + os.path.join(self._cmake_install_base_path, "protobuf-conan-protoc-target.cmake"), ] self.cpp_info.set_property("cmake_build_modules", build_modules) lib_prefix = "lib" if (is_msvc(self) or self._is_clang_cl) else "" lib_suffix = "d" if self.settings.build_type == "Debug" and self.options.debug_suffix else "" + if self._protobuf_release >= "22.0": + absl_deps = [f"abseil::{c}" for c in self.conan_data["absl_deps"][self.version]] + + if self._protobuf_release >= "22.0" and (not self.options.shared or self.options.get_safe("upb")): + # utf8 libraries + # it's a private dependency and unconditionally built as a static library, should only + # be exposed when protobuf itself is static (or if upb is being built) + self.cpp_info.components["utf8_range"].set_property("cmake_target_name", "utf8_range::utf8_range") + self.cpp_info.components["utf8_range"].libs = ["utf8_range"] + self.cpp_info.components["utf8_validity"].set_property("cmake_target_name", "utf8_range::utf8_validity") + self.cpp_info.components["utf8_validity"].libs = ["utf8_validity"] + self.cpp_info.components["utf8_validity"].requires = ["abseil::absl_strings"] + + if self.options.get_safe("upb"): + # upb libraries: note that these are unconditionally static + self.cpp_info.components["upb"].set_property("cmake_target_name", "protobuf::libupb") + self.cpp_info.components["upb"].libs = [lib_prefix + "upb" + lib_suffix] + self.cpp_info.components["upb"].requires = ["utf8_range"] + # libprotobuf self.cpp_info.components["libprotobuf"].set_property("cmake_target_name", "protobuf::libprotobuf") self.cpp_info.components["libprotobuf"].set_property("pkg_config_name", "protobuf") @@ -223,6 +246,11 @@ def package_info(self): self.cpp_info.components["libprotobuf"].libs = [lib_prefix + "protobuf" + lib_suffix] if self.options.with_zlib: self.cpp_info.components["libprotobuf"].requires = ["zlib::zlib"] + if self._protobuf_release >= "22.0": + self.cpp_info.components["libprotobuf"].requires.extend(absl_deps) + if not self.options.shared: + self.cpp_info.components["libprotobuf"].requires.extend(["utf8_validity"]) + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libprotobuf"].system_libs.extend(["m", "pthread"]) if self._is_clang_x86 or "arm" in str(self.settings.arch): @@ -238,6 +266,8 @@ def package_info(self): self.cpp_info.components["libprotoc"].set_property("cmake_target_name", "protobuf::libprotoc") self.cpp_info.components["libprotoc"].libs = [lib_prefix + "protoc" + lib_suffix] self.cpp_info.components["libprotoc"].requires = ["libprotobuf"] + if self._protobuf_release >= "22.0": + self.cpp_info.components["libprotoc"].requires.extend(absl_deps) # libprotobuf-lite if self.options.lite: @@ -254,6 +284,8 @@ def package_info(self): self.cpp_info.components["libprotobuf-lite"].defines = ["PROTOBUF_USE_DLLS"] if self.settings.os == "Android": self.cpp_info.components["libprotobuf-lite"].system_libs.append("log") + if self._protobuf_release >= "22.0": + self.cpp_info.components["libprotobuf-lite"].requires.extend(absl_deps) # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.filenames["cmake_find_package"] = "Protobuf" diff --git a/recipes/protobuf/all/patches/protobuf-3.17.1-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.17.1-upstream-macos-macros.patch deleted file mode 100644 index d8f8f14a25361..0000000000000 --- a/recipes/protobuf/all/patches/protobuf-3.17.1-upstream-macos-macros.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc -index 61f0859..d673519 100644 ---- a/src/google/protobuf/port_def.inc -+++ b/src/google/protobuf/port_def.inc -@@ -616,6 +616,22 @@ - #undef timezone - #endif // _MSC_VER - -+#ifdef __APPLE__ -+// Inconvenient macro names from usr/include/math.h in some macOS SDKs. -+#pragma push_macro("DOMAIN") -+#undef DOMAIN -+// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. -+#pragma push_macro("TRUE") -+#undef TRUE -+#pragma push_macro("FALSE") -+#undef FALSE -+// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. -+#pragma push_macro("UID_MAX") -+#undef UID_MAX -+#pragma push_macro("GID_MAX") -+#undef GID_MAX -+#endif // __APPLE__ -+ - #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) - // Don't let Objective-C Macros interfere with proto identifiers with the same - // name. -diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc -index 82fe794..dfbbf5b 100644 ---- a/src/google/protobuf/port_undef.inc -+++ b/src/google/protobuf/port_undef.inc -@@ -112,6 +112,14 @@ - #pragma pop_macro("timezone") - #endif - -+#ifdef __APPLE__ -+#pragma pop_macro("DOMAIN") -+#pragma pop_macro("TRUE") -+#pragma pop_macro("FALSE") -+#pragma pop_macro("UID_MAX") -+#pragma pop_macro("GID_MAX") -+#endif // __APPLE__ -+ - #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) - #pragma pop_macro("DEBUG") - #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.18.1-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.18.1-upstream-macos-macros.patch deleted file mode 100644 index 4825966e01d9d..0000000000000 --- a/recipes/protobuf/all/patches/protobuf-3.18.1-upstream-macos-macros.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc -index 01384c8..8f8a44d 100644 ---- a/src/google/protobuf/port_def.inc -+++ b/src/google/protobuf/port_def.inc -@@ -736,6 +736,22 @@ - #undef timezone - #endif // _MSC_VER - -+#ifdef __APPLE__ -+// Inconvenient macro names from usr/include/math.h in some macOS SDKs. -+#pragma push_macro("DOMAIN") -+#undef DOMAIN -+// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. -+#pragma push_macro("TRUE") -+#undef TRUE -+#pragma push_macro("FALSE") -+#undef FALSE -+// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. -+#pragma push_macro("UID_MAX") -+#undef UID_MAX -+#pragma push_macro("GID_MAX") -+#undef GID_MAX -+#endif // __APPLE__ -+ - #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) - // Don't let Objective-C Macros interfere with proto identifiers with the same - // name. -diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc -index 5fef6e4..9efd5d6 100644 ---- a/src/google/protobuf/port_undef.inc -+++ b/src/google/protobuf/port_undef.inc -@@ -128,6 +128,14 @@ - #pragma pop_macro("timezone") - #endif - -+#ifdef __APPLE__ -+#pragma pop_macro("DOMAIN") -+#pragma pop_macro("TRUE") -+#pragma pop_macro("FALSE") -+#pragma pop_macro("UID_MAX") -+#pragma pop_macro("GID_MAX") -+#endif // __APPLE__ -+ - #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) - #pragma pop_macro("DEBUG") - #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.19.6-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.19.6-upstream-macos-macros.patch deleted file mode 100644 index 5aadd2a257043..0000000000000 --- a/recipes/protobuf/all/patches/protobuf-3.19.6-upstream-macos-macros.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc -index 30af1cf..4ddf5dc 100644 ---- a/src/google/protobuf/port_def.inc -+++ b/src/google/protobuf/port_def.inc -@@ -763,6 +763,22 @@ - #undef timezone - #endif // _MSC_VER - -+#ifdef __APPLE__ -+// Inconvenient macro names from usr/include/math.h in some macOS SDKs. -+#pragma push_macro("DOMAIN") -+#undef DOMAIN -+// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. -+#pragma push_macro("TRUE") -+#undef TRUE -+#pragma push_macro("FALSE") -+#undef FALSE -+// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. -+#pragma push_macro("UID_MAX") -+#undef UID_MAX -+#pragma push_macro("GID_MAX") -+#undef GID_MAX -+#endif // __APPLE__ -+ - #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) - // Don't let Objective-C Macros interfere with proto identifiers with the same - // name. -diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc -index 579eb41..7a179f9 100644 ---- a/src/google/protobuf/port_undef.inc -+++ b/src/google/protobuf/port_undef.inc -@@ -129,6 +129,14 @@ - #pragma pop_macro("timezone") - #endif - -+#ifdef __APPLE__ -+#pragma pop_macro("DOMAIN") -+#pragma pop_macro("TRUE") -+#pragma pop_macro("FALSE") -+#pragma pop_macro("UID_MAX") -+#pragma pop_macro("GID_MAX") -+#endif // __APPLE__ -+ - #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) - #pragma pop_macro("DEBUG") - #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/protobuf-3.21.9-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.21.9-upstream-macos-macros.patch deleted file mode 100644 index 3a152f62bca69..0000000000000 --- a/recipes/protobuf/all/patches/protobuf-3.21.9-upstream-macos-macros.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc -index f00daf7..d956db2 100644 ---- a/src/google/protobuf/port_def.inc -+++ b/src/google/protobuf/port_def.inc -@@ -870,6 +870,8 @@ - // Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. - #pragma push_macro("UID_MAX") - #undef UID_MAX -+#pragma push_macro("GID_MAX") -+#undef GID_MAX - #endif // __APPLE__ - - #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) -diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc -index e880fa5..f8968d9 100644 ---- a/src/google/protobuf/port_undef.inc -+++ b/src/google/protobuf/port_undef.inc -@@ -144,6 +144,7 @@ - #pragma pop_macro("TRUE") - #pragma pop_macro("FALSE") - #pragma pop_macro("UID_MAX") -+#pragma pop_macro("GID_MAX") - #endif // __APPLE__ - - #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) diff --git a/recipes/protobuf/all/patches/upstream-pr-9437-msvc-runtime.patch b/recipes/protobuf/all/patches/upstream-pr-9437-msvc-runtime.patch deleted file mode 100644 index 06cb0a97681d1..0000000000000 --- a/recipes/protobuf/all/patches/upstream-pr-9437-msvc-runtime.patch +++ /dev/null @@ -1,17 +0,0 @@ -Fix from Protobuf PR: https://github.com/protocolbuffers/protobuf/pull/9437 - ---- a/cmake/CMakeLists.txt -+++ b/cmake/CMakeLists.txt -@@ -182,7 +182,11 @@ else (protobuf_BUILD_SHARED_LIBS) - # making programmatic control difficult. Prefer the functionality in newer - # CMake versions when available. - if(CMAKE_VERSION VERSION_GREATER 3.15 OR CMAKE_VERSION VERSION_EQUAL 3.15) -- set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug>) -+ if (protobuf_MSVC_STATIC_RUNTIME) -+ set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug>) -+ else() -+ set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug>DLL) -+ endif() - else() - # In case we are building static libraries, link also the runtime library statically - # so that MSVCR*.DLL is not required at runtime. diff --git a/recipes/protobuf/all/protobuf-conan-protoc-target.cmake b/recipes/protobuf/all/protobuf-conan-protoc-target.cmake new file mode 100644 index 0000000000000..6165d8f1b731b --- /dev/null +++ b/recipes/protobuf/all/protobuf-conan-protoc-target.cmake @@ -0,0 +1,25 @@ +if(NOT TARGET protobuf::protoc) + # Locate protoc executable + ## Workaround for legacy "cmake" generator in case of cross-build + if(CMAKE_CROSSCOMPILING) + find_program(PROTOC_PROGRAM NAMES protoc PATHS ENV PATH NO_DEFAULT_PATH) + endif() + ## And here this will work fine with "CMakeToolchain" (for native & cross-build) + ## and legacy "cmake" generator in case of native build + if(NOT PROTOC_PROGRAM) + find_program(PROTOC_PROGRAM NAMES protoc) + endif() + ## Last resort: we search in package folder directly + if(NOT PROTOC_PROGRAM) + set(PROTOC_PROGRAM "${CMAKE_CURRENT_LIST_DIR}/../../../bin/protoc${CMAKE_EXECUTABLE_SUFFIX}") + endif() + get_filename_component(PROTOC_PROGRAM "${PROTOC_PROGRAM}" ABSOLUTE) + + # Give opportunity to users to provide an external protoc executable + # (this is a feature of official FindProtobuf.cmake) + set(Protobuf_PROTOC_EXECUTABLE ${PROTOC_PROGRAM} CACHE FILEPATH "The protoc compiler") + + # Create executable imported target protobuf::protoc + add_executable(protobuf::protoc IMPORTED) + set_property(TARGET protobuf::protoc PROPERTY IMPORTED_LOCATION ${Protobuf_PROTOC_EXECUTABLE}) +endif() diff --git a/recipes/protobuf/all/test_package/CMakeLists.txt b/recipes/protobuf/all/test_package/CMakeLists.txt index a5240f3215abb..b19277151deaf 100644 --- a/recipes/protobuf/all/test_package/CMakeLists.txt +++ b/recipes/protobuf/all/test_package/CMakeLists.txt @@ -4,8 +4,12 @@ project(test_package LANGUAGES CXX) find_package(protobuf CONFIG REQUIRED) -add_executable(${PROJECT_NAME} test_package.cpp addressbook.proto) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_executable(${PROJECT_NAME} test_package.cpp) +if(CONAN_TEST_USE_CXXSTD_14) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") if (protobuf_LITE) target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf-lite) @@ -17,5 +21,10 @@ if(TARGET protobuf::libprotoc) target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotoc) endif() -protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS TARGET ${PROJECT_NAME}) -protobuf_generate(LANGUAGE cpp TARGET ${PROJECT_NAME} PROTOS addressbook.proto) +if(NOT TARGET protobuf::protoc) + message(FATAL_ERROR "protoc executable should have been defined as part of find_package(protobuf)") +endif() + +if(NOT COMMAND protobuf_generate) + message(FATAL_ERROR "protobuf_generate should have been defined as part of find_package(protobuf)") +endif() diff --git a/recipes/protobuf/all/test_package/conanfile.py b/recipes/protobuf/all/test_package/conanfile.py index 81404c86104a8..880d1f9d7d72e 100644 --- a/recipes/protobuf/all/test_package/conanfile.py +++ b/recipes/protobuf/all/test_package/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.build import can_run from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +from conan.tools.scm import Version import os @@ -13,14 +14,14 @@ def layout(self): cmake_layout(self) def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - self.tool_requires(self.tested_reference_str) + # note `run=True` so that the runenv can find protoc + self.requires(self.tested_reference_str, run=True) def generate(self): tc = CMakeToolchain(self) tc.cache_variables["protobuf_LITE"] = self.dependencies[self.tested_reference_str].options.lite + protobuf_version = Version(self.dependencies[self.tested_reference_str].ref.version) + tc.cache_variables["CONAN_TEST_USE_CXXSTD_14"] = protobuf_version >= "3.22" tc.generate() def build(self): @@ -32,3 +33,8 @@ def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") + + # Invoke protoc in the same way CMake would + self.run(f"protoc --proto_path={self.source_folder} --cpp_out={self.build_folder} {self.source_folder}/addressbook.proto", env="conanrun") + assert os.path.exists(os.path.join(self.build_folder,"addressbook.pb.cc")) + assert os.path.exists(os.path.join(self.build_folder,"addressbook.pb.h")) diff --git a/recipes/protobuf/all/test_package/test_package.cpp b/recipes/protobuf/all/test_package/test_package.cpp index aee0c47205eed..61cb2bc104cd7 100644 --- a/recipes/protobuf/all/test_package/test_package.cpp +++ b/recipes/protobuf/all/test_package/test_package.cpp @@ -1,17 +1,15 @@ #include #include -#include "addressbook.pb.h" +#include +#include int main() { - std::cout << "Bincrafters\n"; + google::protobuf::Timestamp ts; + google::protobuf::util::TimeUtil::FromString("1972-01-01T10:00:20.021Z", &ts); + const auto nanoseconds = ts.nanos(); - tutorial::Person p; - p.set_id(21); - p.set_name("conan-center-index"); - p.set_email("info@conan.io"); - - std::cout << p.SerializeAsString() << "\n"; + std::cout << "1972-01-01T10:00:20.021Z in nanoseconds: " << nanoseconds << "\n"; return EXIT_SUCCESS; } diff --git a/recipes/protobuf/all/test_v1_package/CMakeLists.txt b/recipes/protobuf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index f16bc97992e86..0000000000000 --- a/recipes/protobuf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_v1_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/protobuf/all/test_v1_package/conanfile.py b/recipes/protobuf/all/test_v1_package/conanfile.py deleted file mode 100644 index f31e33d3b0ff4..0000000000000 --- a/recipes/protobuf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,27 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires(self.tested_reference_str) - - def build(self): - with tools.no_op() if hasattr(self, "settings_build") else tools.run_environment(self): - cmake = CMake(self) - cmake.definitions["protobuf_LITE"] = self.options["protobuf"].lite - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - self.run("protoc --version", run_environment=True) - self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/protobuf/config.yml b/recipes/protobuf/config.yml index 89750d93410cc..cb567195f025d 100644 --- a/recipes/protobuf/config.yml +++ b/recipes/protobuf/config.yml @@ -1,15 +1,9 @@ versions: - "3.21.12": - folder: all - "3.21.9": - folder: all - "3.20.3": + "5.27.0": folder: all - "3.20.0": + "4.25.3": folder: all - "3.19.6": - folder: all - "3.18.3": + "3.21.12": folder: all - "3.17.1": + "3.20.3": folder: all diff --git a/recipes/proxy/all/conandata.yml b/recipes/proxy/all/conandata.yml new file mode 100644 index 0000000000000..3833bc86e0c87 --- /dev/null +++ b/recipes/proxy/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "2.4.0": + url: "https://github.com/microsoft/proxy/archive/refs/tags/2.4.0.tar.gz" + sha256: "7eed973655938d681a90dcc0c200e6cc1330ea8611a9c1a9e1b30439514443cb" + "2.3.2": + url: "https://github.com/microsoft/proxy/archive/refs/tags/2.3.2.tar.gz" + sha256: "d592f70b82a452dc9834ac3a953039d4b0136eefc023503d37879aba5ced369f" + "2.3.1": + url: "https://github.com/microsoft/proxy/archive/refs/tags/2.3.1.tar.gz" + sha256: "bfec45ada9cd3dc576df34bbe877c5d03a81906a00759970c0197c3fa041c5c7" + "2.3.0": + url: "https://github.com/microsoft/proxy/archive/refs/tags/2.3.0.tar.gz" + sha256: "ff6f17c5360895776d29ce2b1235de7b42912468b52729810506431e352a78d0" + "2.2.1": + url: "https://github.com/microsoft/proxy/archive/refs/tags/2.2.1.tar.gz" + sha256: "096f0b2d793dffc54d41def2bca0ced594b6b8efe35ac5ae27db35802e742b96" diff --git a/recipes/proxy/all/conanfile.py b/recipes/proxy/all/conanfile.py new file mode 100644 index 0000000000000..eb01ebfdc540f --- /dev/null +++ b/recipes/proxy/all/conanfile.py @@ -0,0 +1,67 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class ProxyConan(ConanFile): + name = "proxy" + description = "Proxy: Next Generation Polymorphism in C++" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/microsoft/proxy" + topics = ("runtime-polymorphism", "polymorphism", "duck-typing", "metaprogramming", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + # proxy/2.3.0 has an internal compilation error on gcc 11. + "gcc": "11" if Version(self.version) < "2.3.0" else "12", + "clang": "15", + "apple-clang": "14", + "msvc": "193", + "Visual Studio": "17", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "proxy.h", self.source_folder, os.path.join(self.package_folder, "include", "proxy")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "proxy") + self.cpp_info.set_property("cmake_target_name", "msft_proxy") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/proxy/all/test_package/CMakeLists.txt b/recipes/proxy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7ca64396c7e13 --- /dev/null +++ b/recipes/proxy/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(proxy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE msft_proxy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/proxy/all/test_package/conanfile.py b/recipes/proxy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/proxy/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/proxy/all/test_package/test_package.cpp b/recipes/proxy/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..09afe4defb583 --- /dev/null +++ b/recipes/proxy/all/test_package/test_package.cpp @@ -0,0 +1,47 @@ +// https://github.com/microsoft/proxy/blob/2.1.0/samples/resource_dictionary/main.cpp +// Copyright (c) Microsoft Corporation. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE + +#include + +#include +#include +#include +#include + + +namespace poly { + +PRO_DEF_MEMBER_DISPATCH(at, std::string(int)); +PRO_DEF_FACADE(Dictionary, at); + +} // namespace poly + +void demo_print(pro::proxy dictionary) { + std::cout << dictionary(1) << std::endl; +} + +int main() { + std::map container1{{1, "hello"}}; + std::vector container2{"hello", "world"}; + demo_print(&container1); // print: hello\n + demo_print(&container2); // print: world\n + return 0; +} diff --git a/recipes/proxy/config.yml b/recipes/proxy/config.yml new file mode 100644 index 0000000000000..e219a60af9483 --- /dev/null +++ b/recipes/proxy/config.yml @@ -0,0 +1,11 @@ +versions: + "2.4.0": + folder: all + "2.3.2": + folder: all + "2.3.1": + folder: all + "2.3.0": + folder: all + "2.2.1": + folder: all diff --git a/recipes/pulseaudio/all/conanfile.py b/recipes/pulseaudio/all/conanfile.py index d4ada3ef9ee78..002d47cbedf08 100644 --- a/recipes/pulseaudio/all/conanfile.py +++ b/recipes/pulseaudio/all/conanfile.py @@ -1,3 +1,5 @@ +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import cross_building @@ -5,7 +7,6 @@ from conan.tools.files import copy, get, rm, rmdir from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps from conan.tools.layout import basic_layout -import os required_conan_version = ">=1.53.0" @@ -111,6 +112,10 @@ def generate(self): "--with-udev-rules-dir=${prefix}/bin/udev/rules.d", f"--with-systemduserunitdir={os.path.join(self.build_folder, 'ignore')}", ]) + # Workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268250 + # clang-15 works, but we need to skip the gnu11 flag check + if self.settings.compiler == "clang" and self.settings.compiler.version == 15: + tc.configure_args.append("ax_cv_check_cflags__pedantic__Werror__std_gnu11=yes") for lib in ["alsa", "x11", "openssl", "dbus"]: tc.configure_args.append(f"--enable-{lib}={yes_no(getattr(self.options, f'with_{lib}'))}") # TODO: to remove when automatically handled by AutotoolsToolchain diff --git a/recipes/pybind11/all/conandata.yml b/recipes/pybind11/all/conandata.yml index 62adb5a253c62..c44f76e084fcf 100644 --- a/recipes/pybind11/all/conandata.yml +++ b/recipes/pybind11/all/conandata.yml @@ -1,25 +1,31 @@ sources: - 2.7.1: - url: "https://github.com/pybind/pybind11/archive/v2.7.1.tar.gz" - sha256: "616d1c42e4cf14fa27b2a4ff759d7d7b33006fdc5ad8fd603bb2c22622f27020" - 2.8.1: - url: "https://github.com/pybind/pybind11/archive/v2.8.1.tar.gz" - sha256: "f1bcc07caa568eb312411dde5308b1e250bd0e1bc020fae855bf9f43209940cc" - 2.9.1: - url: "https://github.com/pybind/pybind11/archive/v2.9.1.tar.gz" - sha256: "c6160321dc98e6e1184cc791fbeadd2907bb4a0ce0e447f2ea4ff8ab56550913" - 2.9.2: - url: "https://github.com/pybind/pybind11/archive/v2.9.2.tar.gz" - sha256: "6bd528c4dbe2276635dc787b6b1f2e5316cf6b49ee3e150264e455a0d68d19c1" + "2.13.1": + url: "https://github.com/pybind/pybind11/archive/v2.13.1.tar.gz" + sha256: "51631e88960a8856f9c497027f55c9f2f9115cafb08c0005439838a05ba17bfc" + "2.12.0": + url: "https://github.com/pybind/pybind11/archive/v2.12.0.tar.gz" + sha256: "bf8f242abd1abcd375d516a7067490fb71abd79519a282d22b6e4d19282185a7" + "2.11.1": + url: "https://github.com/pybind/pybind11/archive/v2.11.1.tar.gz" + sha256: "d475978da0cdc2d43b73f30910786759d593a9d8ee05b1b6846d1eb16c6d2e0c" + "2.10.4": + url: "https://github.com/pybind/pybind11/archive/v2.10.4.tar.gz" + sha256: "832e2f309c57da9c1e6d4542dedd34b24e4192ecb4d62f6f4866a737454c9970" + "2.10.1": + url: "https://github.com/pybind/pybind11/archive/v2.10.1.tar.gz" + sha256: "111014b516b625083bef701df7880f78c2243835abdb263065b6b59b960b6bad" "2.10.0": url: "https://github.com/pybind/pybind11/archive/v2.10.0.tar.gz" sha256: "eacf582fa8f696227988d08cfc46121770823839fe9e301a20fbce67e7cd70ec" - 2.10.1: - url: "https://github.com/pybind/pybind11/archive/v2.10.1.tar.gz" - sha256: "111014b516b625083bef701df7880f78c2243835abdb263065b6b59b960b6bad" - 2.10.4: - url: "https://github.com/pybind/pybind11/archive/v2.10.4.tar.gz" - sha256: "832e2f309c57da9c1e6d4542dedd34b24e4192ecb4d62f6f4866a737454c9970" - 2.11.1: - url: "https://github.com/pybind/pybind11/archive/v2.11.1.tar.gz" - sha256: "d475978da0cdc2d43b73f30910786759d593a9d8ee05b1b6846d1eb16c6d2e0c" + "2.9.2": + url: "https://github.com/pybind/pybind11/archive/v2.9.2.tar.gz" + sha256: "6bd528c4dbe2276635dc787b6b1f2e5316cf6b49ee3e150264e455a0d68d19c1" + "2.9.1": + url: "https://github.com/pybind/pybind11/archive/v2.9.1.tar.gz" + sha256: "c6160321dc98e6e1184cc791fbeadd2907bb4a0ce0e447f2ea4ff8ab56550913" + "2.8.1": + url: "https://github.com/pybind/pybind11/archive/v2.8.1.tar.gz" + sha256: "f1bcc07caa568eb312411dde5308b1e250bd0e1bc020fae855bf9f43209940cc" + "2.7.1": + url: "https://github.com/pybind/pybind11/archive/v2.7.1.tar.gz" + sha256: "616d1c42e4cf14fa27b2a4ff759d7d7b33006fdc5ad8fd603bb2c22622f27020" diff --git a/recipes/pybind11/all/conanfile.py b/recipes/pybind11/all/conanfile.py index aa098ee90ec20..8dc874bff4b37 100644 --- a/recipes/pybind11/all/conanfile.py +++ b/recipes/pybind11/all/conanfile.py @@ -12,18 +12,22 @@ class PyBind11Conan(ConanFile): name = "pybind11" description = "Seamless operability between C++11 and Python" - topics = "pybind11", "python", "binding" - homepage = "https://github.com/pybind/pybind11" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/pybind/pybind11" + topics = ("pybind11", "python", "binding", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True def layout(self): basic_layout(self, src_folder="src") + def package_id(self): + self.info.clear() + def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -54,9 +58,6 @@ def package(self): "add_library(", "# add_library(") - def package_id(self): - self.info.clear() - def package_info(self): cmake_base_path = os.path.join("lib", "cmake", "pybind11") self.cpp_info.set_property("cmake_target_name", "pybind11_all_do_not_use") diff --git a/recipes/pybind11/all/test_package/CMakeLists.txt b/recipes/pybind11/all/test_package/CMakeLists.txt index e8d17d781285f..a0ddd8851c031 100644 --- a/recipes/pybind11/all/test_package/CMakeLists.txt +++ b/recipes/pybind11/all/test_package/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.15) -project(test_package CXX) +project(test_package LANGUAGES CXX) + find_package(pybind11 REQUIRED CONFIG) + pybind11_add_module(test_package MODULE test_package.cpp) set_property(TARGET test_package PROPERTY CXX_STANDARD 11) diff --git a/recipes/pybind11/config.yml b/recipes/pybind11/config.yml index 0637bb6f5067e..975b39f3ad740 100644 --- a/recipes/pybind11/config.yml +++ b/recipes/pybind11/config.yml @@ -1,17 +1,21 @@ versions: - "2.7.1": + "2.13.1": folder: all - "2.8.1": + "2.12.0": folder: all - "2.9.1": + "2.11.1": folder: all - "2.9.2": + "2.10.4": + folder: all + "2.10.1": folder: all "2.10.0": folder: all - "2.10.1": + "2.9.2": folder: all - "2.10.4": + "2.9.1": folder: all - "2.11.1": + "2.8.1": + folder: all + "2.7.1": folder: all diff --git a/recipes/qarchive/all/conanfile.py b/recipes/qarchive/all/conanfile.py index 320e0e4349c52..e44b758e45244 100644 --- a/recipes/qarchive/all/conanfile.py +++ b/recipes/qarchive/all/conanfile.py @@ -48,8 +48,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libarchive/3.6.2") - self.requires("qt/5.15.10", transitive_headers=True, transitive_libs=True) + self.requires("libarchive/3.7.4") + self.requires("qt/[~5.15]", transitive_headers=True, transitive_libs=True) def build_requirements(self): self.tool_requires("cmake/[>=3.17 <4]") diff --git a/recipes/qcbor/all/conandata.yml b/recipes/qcbor/all/conandata.yml index 5b5b4f359cdd2..50bed9fddeba6 100644 --- a/recipes/qcbor/all/conandata.yml +++ b/recipes/qcbor/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3": + url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.3.tar.gz" + sha256: "5acd3f3e7b19aad074813736a8776e71859d57c4dec9bfb85cd1dc6c219c8033" "1.2": url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.2.tar.gz" sha256: "0f706ad90ada600bd1ddbdf8dc6f2f5910e11de355bb4454b9b4123f0e4ff525" @@ -9,6 +12,10 @@ sources: url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.0.tar.gz" sha256: "961a46eb5a599cc040bfce4f4fade4427e046f1748f37ba4ebbc097fb9cdf1d3" patches: + "1.3": + - patch_file: "patches/1.2-0001-fix-cmake.patch" + patch_description: "disable fix fPIC and add installation" + patch_type: "conan" "1.2": - patch_file: "patches/1.2-0001-fix-cmake.patch" patch_description: "disable fix fPIC and add installation" diff --git a/recipes/qcbor/config.yml b/recipes/qcbor/config.yml index db25e2b16686a..2bbd629f9a807 100644 --- a/recipes/qcbor/config.yml +++ b/recipes/qcbor/config.yml @@ -1,4 +1,6 @@ versions: + "1.3": + folder: all "1.2": folder: all "1.1": diff --git a/recipes/qr-code-generator/all/CMakeLists.txt b/recipes/qr-code-generator/all/CMakeLists.txt index 60ddaa9f6b380..7629857f9b79e 100644 --- a/recipes/qr-code-generator/all/CMakeLists.txt +++ b/recipes/qr-code-generator/all/CMakeLists.txt @@ -1,9 +1,16 @@ cmake_minimum_required(VERSION 3.15) project(QR-Code-Generator) -include(src/files.cmake) -add_library(${LIBRARY_NAME} ${SRC}) +set(SRC_C ${CMAKE_SOURCE_DIR}/src/c/qrcodegen.c) +set(LIBRARY_NAME_C qrcodegenc) +set(HEADERS_C ${CMAKE_SOURCE_DIR}/src/c/qrcodegen.h) + +add_library(${LIBRARY_NAME_C} ${SRC_C}) +set_target_properties(${LIBRARY_NAME_C} PROPERTIES PUBLIC_HEADER "${HEADERS_C}") +install(TARGETS ${LIBRARY_NAME_C} RUNTIME LIBRARY ARCHIVE PUBLIC_HEADER DESTINATION include/qrcodegenc) +include(src/files.cmake) +add_library(${LIBRARY_NAME} ${SRC}) set_target_properties(${LIBRARY_NAME} PROPERTIES PUBLIC_HEADER "${HEADERS}") install(TARGETS ${LIBRARY_NAME} RUNTIME LIBRARY ARCHIVE PUBLIC_HEADER DESTINATION include/qrcodegen) diff --git a/recipes/qr-code-generator/all/conanfile.py b/recipes/qr-code-generator/all/conanfile.py index 84430d69ae1d0..656603b7ba557 100644 --- a/recipes/qr-code-generator/all/conanfile.py +++ b/recipes/qr-code-generator/all/conanfile.py @@ -101,8 +101,9 @@ def package(self): cmake.install() def package_info(self): - self.cpp_info.libs = [ - "qrcodegen" if Version(self.version) < "1.7.0" else "qrcodegencpp" - ] + self.cpp_info.components["qrcodegencpp"].set_property("cmake_target_name", "qr-code-generator::qrcodegencpp") + self.cpp_info.components["qrcodegencpp"].libs = ["qrcodegen" if Version(self.version) < "1.7.0" else "qrcodegencpp"] + self.cpp_info.components["qrcodegenc"].set_property("cmake_target_name", "qr-code-generator::qrcodegenc") + self.cpp_info.components["qrcodegenc"].libs = ["qrcodegenc"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/qt/5.x.x/conandata.yml b/recipes/qt/5.x.x/conandata.yml index a8c2e2c8e2a71..b12be53bf6b58 100644 --- a/recipes/qt/5.x.x/conandata.yml +++ b/recipes/qt/5.x.x/conandata.yml @@ -1,139 +1,37 @@ sources: - "5.15.13": + "5.15.14": url: - - "https://download.qt.io/official_releases/qt/5.15/5.15.13/single/qt-everywhere-opensource-src-5.15.13.tar.xz" - - "https://download.qt.io/archive/qt/5.15/5.15.13/single/qt-everywhere-opensource-src-5.15.13.tar.xz" - - "https://mirrors.cloud.tencent.com/qt/archive/qt/5.15/5.15.13/single/qt-everywhere-opensource-src-5.15.13.tar.xz" - sha256: "9550ec8fc758d3d8d9090e261329700ddcd712e2dda97e5fcfeabfac22bea2ca" - "5.15.12": - url: - - "https://download.qt.io/official_releases/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://download.qt.io/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://mirrors.20i.com/pub/qt.io/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://ftp.nluug.nl/languages/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://mirror.netcologne.de/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://mirrors.dotsrc.org/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://ftp.icm.edu.pl/packages/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://mirror.web4africa.ng/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://qtproject.mirror.liquidtelecom.com/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://qt.mirror.constant.com/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://mirrors.sau.edu.cn/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://mirrors.cloud.tencent.com/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://mirror.bjtu.edu.cn/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz" - sha256: "93f2c0889ee2e9cdf30c170d353c3f829de5f29ba21c119167dee5995e48ccce" - "5.15.11": - url: - - "https://download.qt.io/official_releases/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://download.qt.io/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://qt.mirror.constant.com/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://mirrors.20i.com/pub/qt.io/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://ftp.nluug.nl/languages/qt/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://mirror.netcologne.de/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://mirror.web4africa.ng/qt/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://mirrors.dotsrc.org/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://ftp.icm.edu.pl/packages/qt/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://qtproject.mirror.liquidtelecom.com/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.tar.xz" - sha256: "7426b1eaab52ed169ce53804bdd05dfe364f761468f888a0f15a308dc1dc2951" - "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" - - "https://download.qt.io/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://ftp1.nluug.nl/languages/qt/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://ftp2.nluug.nl/languages/qt/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://mirror.netcologne.de/qtproject/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://mirrors.dotsrc.org/qtproject/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://master.qt.io/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://qt.mirror.constant.com/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - sha256: "26d5f36134db03abe4a6db794c7570d729c92a3fc1b0bf9b1c8f86d0573cd02f" + - "https://download.qt.io/official_releases/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://download.qt.io/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://ftp.icm.edu.pl/packages/qt/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://mirrors.sau.edu.cn/qt/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://mirrors.cloud.tencent.com/qt/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://mirror.bjtu.edu.cn/qt/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + - "https://mirror.aarnet.edu.au/pub/qtproject/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + sha256: "fdd3a4f197d2c800ee0085c721f4bef60951cbda9e9c46e525d1412f74264ed7" patches: - "5.15.13": - - "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" - "patch_file": "patches/0001-Find-fontconfig-using-pkg-config.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_description": "Fix qmake build with apple-clang>=15" - "patch_file": "patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch" - "patch_source": "https://codereview.qt-project.org/c/qt/qtbase/+/503916" - "patch_type": "portability" - - "base_path": "qt5/qtbase" - "patch_description": "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" - "patch_file": "patches/5.15.12-fix-macos-cpp-lib-memory-resource.patch" - "patch_source": "https://codereview.qt-project.org/c/qt/qtbase/+/482392" - "patch_type": "portability" - "5.15.12": + "5.15.14": - "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/android-backtrace.diff" - "base_path": "qt5/qtbase" "patch_file": "patches/android-openssl.diff" - "base_path": "qt5/qtbase" @@ -147,100 +45,3 @@ patches: "patch_file": "patches/5.15.12-fix-macos-cpp-lib-memory-resource.patch" "patch_source": "https://codereview.qt-project.org/c/qt/qtbase/+/482392" "patch_type": "portability" - "5.15.11": - - "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/android-backtrace.diff" - - "base_path": "qt5/qtbase" - "patch_file": "patches/android-openssl.diff" - - "base_path": "qt5/qtbase" - "patch_file": "patches/android-new-ndk.diff" - - patch_file: "patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch" - base_path: "qt5/qtbase" - patch_description: "Fix qmake build with apple-clang>=15" - patch_type: "portability" - patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" - - patch_file: "patches/5.15.10-fix-macos-cpp-lib-memory-resource.patch" - base_path: "qt5/qtbase" - patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" - patch_type: "portability" - patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" - "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" - - patch_file: "patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch" - base_path: "qt5/qtbase" - patch_description: "Fix qmake build with apple-clang>=15" - patch_type: "portability" - patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" - - patch_file: "patches/5.15.10-fix-macos-cpp-lib-memory-resource.patch" - base_path: "qt5/qtbase" - patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" - patch_type: "portability" - patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" - "5.15.9": - - "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" - - patch_file: "patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch" - base_path: "qt5/qtbase" - patch_description: "Fix build with apple-clang 15" - patch_type: "portability" - patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" - - patch_file: "patches/5.15.7-fix-macos-cpp-lib-memory-resource.patch" - base_path: "qt5/qtbase" - patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" - patch_type: "portability" - patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 9d4a18d87ad0e..99b31fa742027 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanException, ConanInvalidConfiguration from conan.tools.android import android_abi from conan.tools.apple import is_apple_os from conan.tools.build import build_jobs, check_min_cppstd, cross_building @@ -27,6 +27,8 @@ class QtConan(ConanFile): "qtspeech", "qtnetworkauth", "qtremoteobjects", "qtwebglplugin", "qtlottie", "qtquicktimeline", "qtquick3d", "qtknx", "qtmqtt", "qtcoap", "qtopcua"] + _module_statuses = ["essential", "addon", "deprecated", "preview"] + name = "qt" description = "Qt is a cross-platform framework for graphical user interfaces." topics = ("ui", "framework") @@ -78,6 +80,7 @@ class QtConan(ConanFile): "multiconfiguration": [True, False] } options.update({module: [True, False] for module in _submodules}) + options.update({f"{status}_modules": [True, False] for status in _module_statuses}) default_options = { "shared": False, @@ -118,8 +121,10 @@ class QtConan(ConanFile): "cross_compile": None, "sysroot": None, "config": None, - "multiconfiguration": False + "multiconfiguration": False, + "essential_modules": not os.getenv('CONAN_CENTER_BUILD_SERVICE') } + default_options.update({f"{status}_modules": False for status in _module_statuses if status != "essential"}) no_copy_source = True short_paths = True @@ -222,16 +227,6 @@ def configure(self): if not self.options.with_dbus: del self.options.with_atspi - if not self.options.qtmultimedia: - self.options.rm_safe("with_libalsa") - del self.options.with_openal - del self.options.with_gstreamer - del self.options.with_pulseaudio - - if self.settings.os in ("FreeBSD", "Linux"): - if self.options.qtwebengine: - self.options.with_fontconfig = True - if self.options.multiconfiguration: del self.settings.build_type @@ -246,6 +241,8 @@ def configure(self): modulename = section[section.find('"') + 1: section.rfind('"')] status = str(config.get(section, "status")) if status not in ("obsolete", "ignore"): + if status not in self._module_statuses: + raise ConanException(f"module {modulename} has status {status} which is not in self._module_statuses {self._module_statuses}") submodules_tree[modulename] = {"status": status, "path": str(config.get(section, "path")), "depends": []} if config.has_option(section, "depends"): @@ -267,11 +264,27 @@ def _enablemodule(mod): for module in self._submodules: if self.options.get_safe(module): _enablemodule(module) + else: + if module in submodules_tree: + for status in self._module_statuses: + if getattr(self.options, f"{status}_modules") and submodules_tree[module]['status'] == status: + _enablemodule(module) + break for module in self._submodules: if module in self.options and not self.options.get_safe(module): setattr(self.options, module, False) + if not self.options.qtmultimedia: + self.options.rm_safe("with_libalsa") + del self.options.with_openal + del self.options.with_gstreamer + del self.options.with_pulseaudio + + if self.settings.os in ("FreeBSD", "Linux"): + if self.options.qtwebengine: + self.options.with_fontconfig = True + def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, "11") @@ -427,6 +440,8 @@ def package_id(self): self.info.settings.compiler.runtime_type = "Release/Debug" if self.info.settings.os == "Android": del self.info.options.android_sdk + for status in self._module_statuses: + delattr(self.info.options, f"{status}_modules") def build_requirements(self): if self._settings_build.os == "Windows" and is_msvc(self): @@ -598,9 +613,6 @@ def build(self): if cross_building(self): args.append(f"-extprefix {self.package_folder}") args.append("-v") - args.append("-archdatadir %s" % os.path.join(self.package_folder, "bin", "archdatadir")) - args.append("-datadir %s" % os.path.join(self.package_folder, "bin", "datadir")) - args.append("-sysconfdir %s" % os.path.join(self.package_folder, "bin", "sysconfdir")) if self.options.commercial: args.append("-commercial") else: @@ -839,18 +851,7 @@ def package(self): with chdir(self, "build_folder"): self.run(f"{self._make_program()} install") save(self, os.path.join(self.package_folder, "bin", "qt.conf"), """[Paths] -Prefix = .. -ArchData = bin/archdatadir -HostData = bin/archdatadir -Data = bin/datadir -Sysconf = bin/sysconfdir -LibraryExecutables = bin/archdatadir/bin -Plugins = bin/archdatadir/plugins -Imports = bin/archdatadir/imports -Qml2Imports = bin/archdatadir/qml -Translations = bin/datadir/translations -Documentation = bin/datadir/doc -Examples = bin/datadir/examples""") +Prefix = ..""") copy(self, "*LICENSE*", os.path.join(self.source_folder, "qt5/"), os.path.join(self.package_folder, "licenses"), excludes="qtbase/examples/*") for module in self._submodules: @@ -862,6 +863,7 @@ def package(self): rm(self, "*.la*", os.path.join(self.package_folder, "lib"), recursive=True) rm(self, "*.pdb*", os.path.join(self.package_folder, "lib"), recursive=True) rm(self, "*.pdb", os.path.join(self.package_folder, "bin"), recursive=True) + rm(self, "*.pdb", os.path.join(self.package_folder, "plugins"), recursive=True) # "Qt5Bootstrap" is internal Qt library - removing it to avoid linking error, since it contains # symbols that are also in "Qt5Core.lib". It looks like there is no "Qt5Bootstrap.dll". for fl in glob.glob(os.path.join(self.package_folder, "lib", "*Qt5Bootstrap*")): @@ -1034,7 +1036,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): self.cpp_info.components[componentname].names["cmake_find_package_multi"] = pluginname if not self.options.shared: self.cpp_info.components[componentname].libs = [libname + libsuffix] - self.cpp_info.components[componentname].libdirs = [os.path.join("bin", "archdatadir", "plugins", plugintype)] + self.cpp_info.components[componentname].libdirs = [os.path.join("plugins", plugintype)] self.cpp_info.components[componentname].includedirs = [] if "Core" not in requires: requires.append("Core") @@ -1376,8 +1378,10 @@ def _create_plugin(pluginname, libname, plugintype, requires): _create_plugin("QGstreamerCaptureServicePlugin", "gstmediacapture", "mediaservice", []) _create_plugin("QGstreamerPlayerServicePlugin", "gstmediaplayer", "mediaservice", []) if self.settings.os == "Linux": - _create_plugin("CameraBinServicePlugin", "gstcamerabin", "mediaservice", []) - _create_plugin("QAlsaPlugin", "qtaudio_alsa", "audio", []) + if self.options.with_gstreamer: + _create_plugin("CameraBinServicePlugin", "gstcamerabin", "mediaservice", []) + if self.options.get_safe("with_libalsa", False): + _create_plugin("QAlsaPlugin", "qtaudio_alsa", "audio", []) if self.settings.os == "Windows": _create_plugin("AudioCaptureServicePlugin", "qtmedia_audioengine", "mediaservice", []) _create_plugin("DSServicePlugin", "dsengine", "mediaservice", []) @@ -1476,7 +1480,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): self.cpp_info.components["qtCore"].frameworks.append("Cocoa") # qtcore requires "_OBJC_CLASS_$_NSApplication" and more, which are in "Cocoa" framework self.cpp_info.components["qtCore"].frameworks.append("Security") # qtcore requires "_SecRequirementCreateWithString" and more, which are in "Security" framework - self.cpp_info.components["qtCore"].builddirs.append(os.path.join("bin","archdatadir","bin")) + self.cpp_info.components["qtCore"].builddirs.append(os.path.join("bin")) _add_build_module("qtCore", self._cmake_core_extras_file) _add_build_module("qtCore", self._cmake_qt5_private_file("Core")) @@ -1491,8 +1495,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): os.path.join("lib", "cmake", "Qt5Core", "Qt5CoreConfigExtrasMkspecDir.cmake")) mkspecs_dir_begin = qt5core_config_extras_mkspec_dir_cmake.find("mkspecs/") mkspecs_dir_end = qt5core_config_extras_mkspec_dir_cmake.find("\"", mkspecs_dir_begin) - mkspecs_dir = qt5core_config_extras_mkspec_dir_cmake[mkspecs_dir_begin:mkspecs_dir_end].split('/') - mkspecs_path = os.path.join("bin", "archdatadir", *mkspecs_dir) + mkspecs_path = qt5core_config_extras_mkspec_dir_cmake[mkspecs_dir_begin:mkspecs_dir_end] assert os.path.exists(mkspecs_path) self.cpp_info.components["qtCore"].includedirs.append(mkspecs_path) diff --git a/recipes/qt/5.x.x/qtmodules5.15.14.conf b/recipes/qt/5.x.x/qtmodules5.15.14.conf new file mode 100644 index 0000000000000..452233655f279 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.14.conf @@ -0,0 +1,326 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 5.15 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 5.15 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtsvg + path = qtdeclarative + url = ../qtdeclarative.git + branch = 5.15 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 5.15 + status = addon +[submodule "qtscript"] + depends = qtbase + recommends = qttools + path = qtscript + url = ../qtscript.git + branch = 5.15 + status = deprecated +[submodule "qtmultimedia"] + depends = qtbase + recommends = qtdeclarative + path = qtmultimedia + url = ../qtmultimedia.git + branch = 5.15 + status = essential +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 5.15 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = 5.15 + status = deprecated +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 5.15 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtquickcontrols qtquickcontrols2 + path = qtdoc + url = ../qtdoc.git + branch = 5.15 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = master + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase + recommends = qtdeclarative qtquickcontrols qtquickcontrols2 qtserialport + path = qtlocation + url = ../qtlocation.git + branch = 5.15 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 5.15 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtdocgallery"] + depends = qtdeclarative + path = qtdocgallery + url = ../qtdocgallery.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtconnectivity + url = ../qtconnectivity.git + branch = 5.15 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 5.15 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtimageformats qtgamepad + path = qt3d + url = ../qt3d.git + branch = 5.15 + 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 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 5.15 + 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 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 5.15 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 5.15 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtquickcontrols qtquickcontrols2 qtlocation qtwebchannel qttools + path = qtwebengine + url = ../qtwebengine.git + branch = 5.15 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 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 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 5.15 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 5.15 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia qtquickcontrols + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 5.15 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = 5.15 + status = addon +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 5.15 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 5.15 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 5.15 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 5.15 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = 5.15 + status = addon +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 5.15 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 5.15 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative + path = qtquick3d + url = ../qtquick3d.git + branch = 5.15 + status = addon diff --git a/recipes/qt/5.x.x/test_package/conanfile.py b/recipes/qt/5.x.x/test_package/conanfile.py index 5a7b088d4aa41..9146ff6c3fbe3 100644 --- a/recipes/qt/5.x.x/test_package/conanfile.py +++ b/recipes/qt/5.x.x/test_package/conanfile.py @@ -28,17 +28,6 @@ def generate(self): qt_conf = textwrap.dedent(f"""\ [Paths] Prefix = {qt_install_prefix} - ArchData = bin/archdatadir - HostData = bin/archdatadir - Data = bin/datadir - Sysconf = bin/sysconfdir - LibraryExecutables = bin/archdatadir/bin - Plugins = bin/archdatadir/plugins - Imports = bin/archdatadir/imports - Qml2Imports = bin/archdatadir/qml - Translations = bin/datadir/translations - Documentation = bin/datadir/doc - Examples = bin/datadir/examples """) save(self, "qt.conf", qt_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 5cb2041d25d7d..45d17b452e41f 100644 --- a/recipes/qt/5.x.x/test_v1_package/conanfile.py +++ b/recipes/qt/5.x.x/test_v1_package/conanfile.py @@ -25,18 +25,7 @@ def build_requirements(self): def generate(self): save(self, "qt.conf", """[Paths] -Prefix = {} -ArchData = bin/archdatadir -HostData = bin/archdatadir -Data = bin/datadir -Sysconf = bin/sysconfdir -LibraryExecutables = bin/archdatadir/bin -Plugins = bin/archdatadir/plugins -Imports = bin/archdatadir/imports -Qml2Imports = bin/archdatadir/qml -Translations = bin/datadir/translations -Documentation = bin/datadir/doc -Examples = bin/datadir/examples""".format(self.dependencies["qt"].package_folder.replace('\\', '/'))) +Prefix = {}""".format(self.dependencies["qt"].package_folder.replace('\\', '/'))) def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" diff --git a/recipes/qt/6.x.x/conandata.yml b/recipes/qt/6.x.x/conandata.yml index 7d80016fb1b78..8467da32623a7 100644 --- a/recipes/qt/6.x.x/conandata.yml +++ b/recipes/qt/6.x.x/conandata.yml @@ -1,4 +1,64 @@ sources: + "6.7.1": + url: + - "https://download.qt.io/official_releases/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://download.qt.io/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://ftp.icm.edu.pl/packages/qt/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://mirrors.sau.edu.cn/qt/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://mirrors.cloud.tencent.com/qt/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://mirror.bjtu.edu.cn/qt/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/6.7/6.7.1/single/qt-everywhere-src-6.7.1.tar.xz" + sha256: "38dbf2768776e875ed5cdea8cccf1a240512a29769768084430914c4a33bedc4" + "6.7.0": + url: + - "https://download.qt.io/official_releases/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://download.qt.io/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.7/6.7.0/single/qt-everywhere-src-6.7.0.tar.xz" + sha256: "bf5089912364f99cf9baf6c109de76a3172eec6267f148c69800575c47f90087" + "6.6.3": + url: + - "https://download.qt.io/official_releases/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://download.qt.io/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.icm.edu.pl/packages/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.sau.edu.cn/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.tuna.tsinghua.edu.cn/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + sha256: "69d0348fef415da98aa890a34651e9cfb232f1bffcee289b7b4e21386bf36104" "6.6.2": url: - "https://download.qt.io/official_releases/qt/6.6/6.6.2/single/qt-everywhere-src-6.6.2.tar.xz" @@ -85,6 +145,24 @@ sources: - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" sha256: "b90524f686224a0e5a945c1d65307e16a375348dbe275c9ac11de171fe31374a" patches: + "6.7.1": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e_6.6.0.diff" + "patch_source": "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" + "patch_type": "bugfix" + "6.7.0": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e_6.6.0.diff" + "patch_source": "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" + "patch_type": "bugfix" + "6.6.3": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e_6.6.0.diff" + "patch_source": "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" + "patch_type": "bugfix" "6.6.2": - "base_path": "qtwebengine" "patch_description": "Workaround for too long .rps file name" diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index 02d45875b2ac6..60bff7fddfd16 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -1,6 +1,7 @@ import configparser import glob import os +import platform import textwrap from conan import ConanFile @@ -12,7 +13,7 @@ from conan.tools.gnu import PkgConfigDeps from conan.tools.microsoft import msvc_runtime_flag, is_msvc from conan.tools.scm import Version -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanException, ConanInvalidConfiguration required_conan_version = ">=1.55.0" @@ -28,6 +29,8 @@ class QtConan(ConanFile): "qtspeech", "qthttpserver", "qtquick3dphysics", "qtgrpc", "qtquickeffectmaker"] _submodules += ["qtgraphs"] # new modules for qt 6.6.0 + _module_statuses = ["essential", "addon", "deprecated", "preview"] + name = "qt" description = "Qt is a cross-platform framework for graphical user interfaces." topics = ("framework", "ui") @@ -76,6 +79,7 @@ class QtConan(ConanFile): "disabled_features": [None, "ANY"], } options.update({module: [True, False] for module in _submodules}) + options.update({f"{status}_modules": [True, False] for status in _module_statuses}) # this significantly speeds up windows builds no_copy_source = True @@ -118,7 +122,9 @@ class QtConan(ConanFile): "sysroot": None, "multiconfiguration": False, "disabled_features": "", + "essential_modules": not os.getenv('CONAN_CENTER_BUILD_SERVICE') } + default_options.update({f"{status}_modules": False for status in _module_statuses if status != "essential"}) short_paths = True @@ -145,6 +151,8 @@ def _get_module_tree(self): continue status = str(config.get(section, "status")) if status not in ["obsolete", "ignore", "additionalLibrary"]: + if status not in self._module_statuses: + raise ConanException(f"module {modulename} has status {status} which is not in self._module_statuses {self._module_statuses}") assert modulename in self._submodules, f"module {modulename} not in self._submodules" self._submodules_tree[modulename] = {"status": status, "path": str(config.get(section, "path")), "depends": []} @@ -202,16 +210,6 @@ def configure(self): self.options.rm_safe("with_x11") self.options.rm_safe("with_egl") - if not self.options.get_safe("qtmultimedia"): - self.options.rm_safe("with_libalsa") - del self.options.with_openal - del self.options.with_gstreamer - del self.options.with_pulseaudio - - if self.settings.os in ("FreeBSD", "Linux"): - if self.options.get_safe("qtwebengine"): - self.options.with_fontconfig = True - if self.options.multiconfiguration: del self.settings.build_type @@ -223,9 +221,14 @@ def _enablemodule(mod): # enable all modules which are # - required by a module explicitely enabled by the consumer - for module in self._get_module_tree: - if getattr(self.options, module): - _enablemodule(module) + for module_name, module in self._get_module_tree.items(): + if getattr(self.options, module_name): + _enablemodule(module_name) + else: + for status in self._module_statuses: + if getattr(self.options, f"{status}_modules") and module['status'] == status: + _enablemodule(module_name) + break # disable all modules which are: # - not explicitely enabled by the consumer and @@ -234,6 +237,16 @@ def _enablemodule(mod): if getattr(self.options, module).value is None: setattr(self.options, module, False) + if not self.options.get_safe("qtmultimedia"): + self.options.rm_safe("with_libalsa") + del self.options.with_openal + del self.options.with_gstreamer + del self.options.with_pulseaudio + + if self.settings.os in ("FreeBSD", "Linux"): + if self.options.get_safe("qtwebengine"): + self.options.with_fontconfig = True + def validate(self): if os.getenv('CONAN_CENTER_BUILD_SERVICE') is not None: if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) >= "11" or \ @@ -465,12 +478,7 @@ def generate(self): tc = CMakeToolchain(self, generator="Ninja") - package_folder = self.package_folder.replace('\\', '/') - tc.variables["INSTALL_MKSPECSDIR"] = f"{package_folder}/res/archdatadir/mkspecs" - tc.variables["INSTALL_ARCHDATADIR"] = f"{package_folder}/res/archdatadir" - tc.variables["INSTALL_LIBEXECDIR"] = f"{package_folder}/bin" - tc.variables["INSTALL_DATADIR"] = f"{package_folder}/res/datadir" - tc.variables["INSTALL_SYSCONFDIR"] = f"{package_folder}/res/sysconfdir" + tc.absolute_paths = True tc.variables["QT_BUILD_TESTS"] = "OFF" tc.variables["QT_BUILD_EXAMPLES"] = "OFF" @@ -634,10 +642,12 @@ def package_id(self): self.info.settings.compiler.runtime_type = "Release/Debug" if self.info.settings.os == "Android": del self.info.options.android_sdk + for status in self._module_statuses: + delattr(self.info.options, f"{status}_modules") def source(self): destination = self.source_folder - if self.info.settings.os == "Windows": + if platform.system() == "Windows": # Don't use os.path.join, or it removes the \\?\ prefix, which enables long paths destination = rf"\\?\{self.source_folder}" get(self, **self.conan_data["sources"][self.version], @@ -651,9 +661,6 @@ def source(self): " if (enable_precompiled_headers) {\n if (false) {" ) - replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", "QtInternalTargets.cmake"), - "-Zc:wchar_t", - "-Zc:wchar_t -Zc:twoPhase-") for f in ["FindPostgreSQL.cmake"]: file = os.path.join(self.source_folder, "qtbase", "cmake", f) if os.path.isfile(file): @@ -807,7 +814,7 @@ def package(self): rm(self, "*.la*", os.path.join(self.package_folder, "lib"), recursive=True) rm(self, "*.pdb*", self.package_folder, recursive=True) rm(self, "ensure_pro_file.cmake", self.package_folder, recursive=True) - os.remove(os.path.join(self.package_folder, "bin", "qt-cmake-private-install.cmake")) + os.remove(os.path.join(self.package_folder, "libexec" if Version(self.version) >= "6.5.0" and self.settings.os != "Windows" else "bin", "qt-cmake-private-install.cmake")) for m in os.listdir(os.path.join(self.package_folder, "lib", "cmake")): if os.path.isfile(os.path.join(self.package_folder, "lib", "cmake", m, f"{m}Macros.cmake")): @@ -846,7 +853,8 @@ def package(self): targets.append("qsb") if self.options.qtdeclarative: targets.extend(["qmltyperegistrar", "qmlcachegen", "qmllint", "qmlimportscanner"]) - targets.extend(["qmlformat", "qml", "qmlprofiler", "qmlpreview", "qmltestrunner"]) + targets.extend(["qmlformat", "qml", "qmlprofiler", "qmlpreview"]) + # Note: consider "qmltestrunner", see https://github.com/conan-io/conan-center-index/issues/24276 if self.options.get_safe("qtremoteobjects"): targets.append("repc") if self.options.get_safe("qtscxml"): @@ -854,10 +862,13 @@ def package(self): for target in targets: exe_path = None for path_ in [f"bin/{target}{extension}", - f"lib/{target}{extension}"]: + f"lib/{target}{extension}", + f"libexec/{target}{extension}"]: if os.path.isfile(os.path.join(self.package_folder, path_)): exe_path = path_ break + else: + assert False, f"Could not find executable {target}{extension} in {self.package_folder}" if not exe_path: self.output.warning(f"Could not find path to {target}{extension}") filecontents += textwrap.dedent(f"""\ @@ -932,8 +943,8 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "Qt6" # consumers will need the QT_PLUGIN_PATH defined in runenv - self.runenv_info.define("QT_PLUGIN_PATH", os.path.join(self.package_folder, "res", "archdatadir", "plugins")) - self.buildenv_info.define("QT_PLUGIN_PATH", os.path.join(self.package_folder, "res", "archdatadir", "plugins")) + self.runenv_info.define("QT_PLUGIN_PATH", os.path.join(self.package_folder, "plugins")) + self.buildenv_info.define("QT_PLUGIN_PATH", os.path.join(self.package_folder, "plugins")) self.buildenv_info.define("QT_HOST_PATH", self.package_folder) @@ -990,7 +1001,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): self.cpp_info.components[componentname].names["cmake_find_package_multi"] = pluginname if not self.options.shared: self.cpp_info.components[componentname].libs = [libname + libsuffix] - self.cpp_info.components[componentname].libdirs = [os.path.join("res", "archdatadir", "plugins", plugintype)] + self.cpp_info.components[componentname].libdirs = [os.path.join("plugins", plugintype)] self.cpp_info.components[componentname].includedirs = [] if "Core" not in requires: requires.append("Core") @@ -1013,7 +1024,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): _create_module("Core", core_reqs) pkg_config_vars = [ "bindir=${prefix}/bin", - "libexecdir=${prefix}/bin", + "libexecdir=${prefix}/libexec", "exec_prefix=${prefix}", ] self.cpp_info.components["qtCore"].set_property("pkg_config_custom_content", "\n".join(pkg_config_vars)) @@ -1030,7 +1041,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): self.cpp_info.components["qtPlatform"].set_property("cmake_target_name", "Qt6::Platform") self.cpp_info.components["qtPlatform"].names["cmake_find_package"] = "Platform" self.cpp_info.components["qtPlatform"].names["cmake_find_package_multi"] = "Platform" - self.cpp_info.components["qtPlatform"].includedirs = [os.path.join("res", "archdatadir", "mkspecs", self._xplatform())] + self.cpp_info.components["qtPlatform"].includedirs = [os.path.join("mkspecs", self._xplatform())] if self.options.with_dbus: _create_module("DBus", ["dbus::dbus"]) if self.settings.os == "Windows": @@ -1099,7 +1110,11 @@ def _create_plugin(pluginname, libname, plugintype, requires): "wtsapi32", "shcore", "comdlg32", "d3d9", "runtimeobject" ] _create_plugin("QWindowsIntegrationPlugin", "qwindows", "platforms", ["Core", "Gui"]) - _create_plugin("QWindowsVistaStylePlugin", "qwindowsvistastyle", "styles", ["Core", "Gui"]) + # https://github.com/qt/qtbase/commit/65d58e6c41e3c549c89ea4f05a8e467466e79ca3 + if Version(self.version) >= "6.7.0": + _create_plugin("QModernWindowsStylePlugin", "qmodernwindowsstyle", "styles", ["Core", "Gui"]) + else: + _create_plugin("QWindowsVistaStylePlugin", "qwindowsvistastyle", "styles", ["Core", "Gui"]) # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/windows/CMakeLists.txt#L53-L69 self.cpp_info.components["qtQWindowsIntegrationPlugin"].system_libs += [ "advapi32", "dwmapi", "gdi32", "imm32", "ole32", "oleaut32", "setupapi", "shell32", "shlwapi", @@ -1486,7 +1501,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): # https://github.com/qt/qtbase/blob/v6.6.1/src/corelib/CMakeLists.txt#L1079-L1082 self.cpp_info.components["qtCore"].frameworks.append("WatchKit") - self.cpp_info.components["qtCore"].builddirs.append(os.path.join("res", "archdatadir", "bin")) + self.cpp_info.components["qtCore"].builddirs.append(os.path.join("bin")) _add_build_module("qtCore", self._cmake_executables_file) _add_build_module("qtCore", self._cmake_qt6_private_file("Core")) if self.settings.os in ["Windows", "iOS"]: @@ -1522,10 +1537,8 @@ def _create_plugin(pluginname, libname, plugintype, requires): component = "qt" + m[:m.find("_")] if component not in self.cpp_info.components: continue - submodules_dir = os.path.join(object_dir, m) - for sub_dir in os.listdir(submodules_dir): - submodule_dir = os.path.join(submodules_dir, sub_dir) - obj_files = [os.path.join(submodule_dir, file) for file in os.listdir(submodule_dir)] + for root, _, files in os.walk(os.path.join(object_dir, m)): + obj_files = [os.path.join(root, file) for file in files] self.cpp_info.components[component].exelinkflags.extend(obj_files) self.cpp_info.components[component].sharedlinkflags.extend(obj_files) diff --git a/recipes/qt/6.x.x/qtmodules6.6.3.conf b/recipes/qt/6.x.x/qtmodules6.6.3.conf new file mode 100644 index 0000000000000..9ab358b10e06c --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.6.3.conf @@ -0,0 +1,338 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.6.3 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.6.3 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.6.3 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.6.3 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.6.3 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.6.3 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = dev + status = ignore +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 6.6.3 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtshadertools qtwebengine + path = qtdoc + url = ../qtdoc.git + branch = 6.6.3 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = dev + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase qtpositioning + recommends = qtdeclarative + path = qtlocation + url = ../qtlocation.git + branch = 6.6.3 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.6.3 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.6.3 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative + path = qtconnectivity + url = ../qtconnectivity.git + branch = 6.6.3 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.6.3 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools qtmultimedia + path = qt3d + url = ../qt3d.git + branch = 6.6.3 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.6.3 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.6.3 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.6.3 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.6.3 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.6.3 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.6.3 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 6.6.3 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.6.3 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.6.3 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.6.3 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = dev + status = ignore +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 6.6.3 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 6.6.3 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.6.3 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.6.3 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = dev + status = ignore +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 6.6.3 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.6.3 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.6.3 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.6.3 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.6.3 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.6.3 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.6.3 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.6.3 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.6.3 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.6.3 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.6.3 + status = addon +[submodule "qtgrpc"] + depends = qtbase + recommends = qtdeclarative + path = qtgrpc + url = ../qtgrpc.git + branch = 6.6.3 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.6.3 + status = addon +[submodule "qtgraphs"] + depends = qtbase qtdeclarative qtquick3d + path = qtgraphs + url = ../qtgraphs.git + branch = 6.6.3 + status = preview diff --git a/recipes/qt/6.x.x/qtmodules6.7.0.conf b/recipes/qt/6.x.x/qtmodules6.7.0.conf new file mode 100644 index 0000000000000..648d154057232 --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.7.0.conf @@ -0,0 +1,338 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.7.0 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.7.0 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.7.0 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.7.0 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.7.0 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.7.0 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = dev + status = ignore +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 6.7.0 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtshadertools qtwebengine + path = qtdoc + url = ../qtdoc.git + branch = 6.7.0 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = dev + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase qtpositioning + recommends = qtdeclarative + path = qtlocation + url = ../qtlocation.git + branch = 6.7.0 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.7.0 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.7.0 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative + path = qtconnectivity + url = ../qtconnectivity.git + branch = 6.7.0 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.7.0 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools qtmultimedia + path = qt3d + url = ../qt3d.git + branch = 6.7.0 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.7.0 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.7.0 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.7.0 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.7.0 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.7.0 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.7.0 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 6.7.0 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.7.0 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.7.0 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.7.0 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = dev + status = ignore +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 6.7.0 + status = addon +[submodule "qtspeech"] + depends = qtbase qtmultimedia + recommends = qtdeclarative + path = qtspeech + url = ../qtspeech.git + branch = 6.7.0 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.7.0 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.7.0 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = dev + status = ignore +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 6.7.0 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.7.0 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.7.0 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.7.0 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.7.0 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.7 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.7 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.7 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.7.0 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.7.0 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.7.0 + status = addon +[submodule "qtgrpc"] + depends = qtbase + recommends = qtdeclarative + path = qtgrpc + url = ../qtgrpc.git + branch = 6.7.0 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.7.0 + status = addon +[submodule "qtgraphs"] + depends = qtbase qtdeclarative qtquick3d + path = qtgraphs + url = ../qtgraphs.git + branch = 6.7.0 + status = preview diff --git a/recipes/qt/6.x.x/qtmodules6.7.1.conf b/recipes/qt/6.x.x/qtmodules6.7.1.conf new file mode 100644 index 0000000000000..9e00dc7638768 --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.7.1.conf @@ -0,0 +1,338 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.7.1 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.7.1 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.7.1 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.7.1 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.7.1 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.7.1 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = dev + status = ignore +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 6.7.1 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtshadertools qtwebengine + path = qtdoc + url = ../qtdoc.git + branch = 6.7.1 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = dev + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase qtpositioning + recommends = qtdeclarative + path = qtlocation + url = ../qtlocation.git + branch = 6.7.1 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.7.1 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.7.1 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative + path = qtconnectivity + url = ../qtconnectivity.git + branch = 6.7.1 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.7.1 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools qtmultimedia + path = qt3d + url = ../qt3d.git + branch = 6.7.1 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.7.1 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.7.1 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.7.1 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.7.1 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.7.1 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.7.1 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 6.7.1 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.7.1 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.7.1 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.7.1 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = dev + status = ignore +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 6.7.1 + status = addon +[submodule "qtspeech"] + depends = qtbase qtmultimedia + recommends = qtdeclarative + path = qtspeech + url = ../qtspeech.git + branch = 6.7.1 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.7.1 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.7.1 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = dev + status = ignore +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 6.7.1 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.7.1 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.7.1 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.7.1 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.7.1 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.7.1 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.7.1 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.7.1 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.7.1 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.7.1 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.7.1 + status = addon +[submodule "qtgrpc"] + depends = qtbase + recommends = qtdeclarative + path = qtgrpc + url = ../qtgrpc.git + branch = 6.7.1 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.7.1 + status = addon +[submodule "qtgraphs"] + depends = qtbase qtdeclarative qtquick3d + path = qtgraphs + url = ../qtgraphs.git + branch = 6.7.1 + status = preview diff --git a/recipes/qt/6.x.x/test_package/CMakeLists.txt b/recipes/qt/6.x.x/test_package/CMakeLists.txt index 337604f1af6ee..d12764c12f1eb 100644 --- a/recipes/qt/6.x.x/test_package/CMakeLists.txt +++ b/recipes/qt/6.x.x/test_package/CMakeLists.txt @@ -4,6 +4,6 @@ project(test_package LANGUAGES CXX) find_package(Qt6 COMPONENTS Core Network Sql Concurrent Xml REQUIRED CONFIG) add_executable(${PROJECT_NAME} WIN32 test_package.cpp greeter.h example.qrc) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml) +target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml Qt6::Widgets) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) set_target_properties(${PROJECT_NAME} PROPERTIES AUTOMOC ON AUTORCC ON) diff --git a/recipes/qt/6.x.x/test_package/conanfile.py b/recipes/qt/6.x.x/test_package/conanfile.py index 1153f37c5a877..01ccf4f452670 100644 --- a/recipes/qt/6.x.x/test_package/conanfile.py +++ b/recipes/qt/6.x.x/test_package/conanfile.py @@ -24,22 +24,8 @@ def build_requirements(self): def generate(self): path = self.dependencies["qt"].package_folder.replace("\\", "/") - folder = os.path.join(path, "bin") - bin_folder = "bin" if self.settings.os == "Windows" else "libexec" save(self, "qt.conf", f"""[Paths] -Prefix = {path} -ArchData = {folder}/archdatadir -HostData = {folder}/archdatadir -Data = {folder}/datadir -Sysconf = {folder}/sysconfdir -LibraryExecutables = {folder}/archdatadir/{bin_folder} -HostLibraryExecutables = bin -Plugins = {folder}/archdatadir/plugins -Imports = {folder}/archdatadir/imports -Qml2Imports = {folder}/archdatadir/qml -Translations = {folder}/datadir/translations -Documentation = {folder}/datadir/doc -Examples = {folder}/datadir/examples""") +Prefix = {path}""") VirtualRunEnv(self).generate() if can_run(self): diff --git a/recipes/qt/6.x.x/test_v1_package/conanfile.py b/recipes/qt/6.x.x/test_v1_package/conanfile.py index 85db60ab1408b..a586ad3bd4cbc 100644 --- a/recipes/qt/6.x.x/test_v1_package/conanfile.py +++ b/recipes/qt/6.x.x/test_v1_package/conanfile.py @@ -22,18 +22,7 @@ def build_requirements(self): def generate(self): save(self, "qt.conf", """[Paths] -Prefix = {} -ArchData = bin/archdatadir -HostData = bin/archdatadir -Data = bin/datadir -Sysconf = bin/sysconfdir -LibraryExecutables = bin/archdatadir/bin -Plugins = bin/archdatadir/plugins -Imports = bin/archdatadir/imports -Qml2Imports = bin/archdatadir/qml -Translations = bin/datadir/translations -Documentation = bin/datadir/doc -Examples = bin/datadir/examples""".format(self.dependencies["qt"].package_folder.replace('\\', '/'))) +Prefix = {}""".format(self.dependencies["qt"].package_folder.replace('\\', '/'))) def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" diff --git a/recipes/qt/config.yml b/recipes/qt/config.yml index 026f022cea5e2..5eef7e23a9317 100644 --- a/recipes/qt/config.yml +++ b/recipes/qt/config.yml @@ -1,4 +1,10 @@ versions: + "6.7.1": + folder: 6.x.x + "6.7.0": + folder: 6.x.x + "6.6.3": + folder: 6.x.x "6.6.2": folder: 6.x.x "6.6.1": @@ -11,13 +17,5 @@ versions: folder: 6.x.x "6.3.2": folder: 6.x.x - "5.15.13": - folder: 5.x.x - "5.15.12": - folder: 5.x.x - "5.15.11": - folder: 5.x.x - "5.15.10": - folder: 5.x.x - "5.15.9": + "5.15.14": folder: 5.x.x diff --git a/recipes/qtxlsxwriter/all/conanfile.py b/recipes/qtxlsxwriter/all/conanfile.py index a67db1337017f..6acde10a92b2e 100644 --- a/recipes/qtxlsxwriter/all/conanfile.py +++ b/recipes/qtxlsxwriter/all/conanfile.py @@ -19,6 +19,7 @@ class QtXlsxWriterConan(ConanFile): topics = ("excel", "xlsx") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -44,7 +45,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("qt/5.15.7") + self.requires("qt/5.15.13", transitive_headers=True, transitive_libs=True) def validate(self): if not self.dependencies["qt"].options.gui: diff --git a/recipes/quickfast/all/CMakeLists.txt b/recipes/quickfast/all/CMakeLists.txt index 99facf34f7dda..69448bef01a75 100644 --- a/recipes/quickfast/all/CMakeLists.txt +++ b/recipes/quickfast/all/CMakeLists.txt @@ -1,75 +1,58 @@ -# based on: https://github.com/microsoft/vcpkg/blob/master/ports/quickfast/CMakeLists.txt - -# Copyright (c) Microsoft Corporation - -# All rights reserved. - -# MIT License - -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -# of the Software, and to permit persons to whom the Software is furnished to do -# so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.15) project(quickfast CXX) -include(${PROJECT_BINARY_DIR}/../conanbuildinfo.cmake) -conan_basic_setup() +find_package(Boost REQUIRED CONFIG) +find_package(XercesC REQUIRED CONFIG) file(GLOB SOURCES - source_subfolder/src/Application/*.cpp - source_subfolder/src/Common/*.cpp - source_subfolder/src/Codecs/*.cpp - source_subfolder/src/Communication/*.cpp - source_subfolder/src/Messages/*.cpp + src/Application/*.cpp + src/Common/*.cpp + src/Codecs/*.cpp + src/Communication/*.cpp + src/Messages/*.cpp ) -file(GLOB HEADERS RELATIVE ${PROJECT_SOURCE_DIR} - source_subfolder/src/Application/*.h - source_subfolder/src/Common/*.h - source_subfolder/src/Codecs/*.h - source_subfolder/src/Communication/*.h - source_subfolder/src/Messages/*.h +file(GLOB HEADERS + src/Application/*.h + src/Common/*.h + src/Codecs/*.h + src/Communication/*.h + src/Messages/*.h ) add_library(quickfast ${HEADERS} ${SOURCES}) +# Needed to keep support for deprecated placeholders in boost::bind +target_compile_definitions(quickfast PRIVATE -DBOOST_BIND_GLOBAL_PLACEHOLDERS) + if(BUILD_SHARED_LIBS) - target_compile_definitions(quickfast PRIVATE -DQUICKFAST_BUILD_DLL) + target_compile_definitions(quickfast PUBLIC QUICKFAST_BUILD_DLL) else() - target_compile_definitions(quickfast PUBLIC -DQUICKFAST_HAS_DLL=0) + target_compile_definitions(quickfast PUBLIC QUICKFAST_HAS_DLL=0) endif() target_compile_features(quickfast PUBLIC cxx_std_11) - -target_include_directories(quickfast PUBLIC - source_subfolder/src +target_include_directories(quickfast PRIVATE src) +target_link_libraries(${PROJECT_NAME} + Boost::boost + Boost::thread + Boost::system + Boost::filesystem + XercesC::XercesC +) +set_target_properties(quickfast PROPERTIES + PUBLIC_HEADER "${HEADERS}" ) - -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) install(TARGETS quickfast - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} ) foreach (HEADER ${HEADERS}) - file(RELATIVE_PATH HEADER_REL ${PROJECT_SOURCE_DIR}/source_subfolder/src ${PROJECT_SOURCE_DIR}/${HEADER}) - get_filename_component(HEADER_DIR ${HEADER_REL} DIRECTORY) - install(FILES ${HEADER} DESTINATION include/quickfast/${HEADER_DIR}) + file(RELATIVE_PATH HEADER_REL ${PROJECT_SOURCE_DIR}/src ${HEADER}) + get_filename_component(HEADER_DIR ${HEADER_REL} DIRECTORY) + install(FILES ${HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${HEADER_DIR}) endforeach() diff --git a/recipes/quickfast/all/conandata.yml b/recipes/quickfast/all/conandata.yml index f9690b9e48e93..be365a50cf527 100644 --- a/recipes/quickfast/all/conandata.yml +++ b/recipes/quickfast/all/conandata.yml @@ -1,14 +1,16 @@ sources: - "1.5": - url: "https://github.com/objectcomputing/quickfast/archive/V1_5.tar.gz" - sha256: "7ae22d28cc13967a2815c09bec027ce01f2f3e30b6ed752bea00649581e728df" "cci.20170314": url: "https://github.com/objectcomputing/quickfast/archive/f9403cfb20ae5383a04772112728d233502e31c0.tar.gz" sha256: "29f40fa383643bfa381315148c6c985fe41159342706f0d0a274fcf45cf36f49" -patches: "1.5": - - patch_file: "patches/00001-fix-boost-asio.patch" - base_path: "source_subfolder" + url: "https://github.com/objectcomputing/quickfast/archive/V1_5.tar.gz" + sha256: "7ae22d28cc13967a2815c09bec027ce01f2f3e30b6ed752bea00649581e728df" +patches: "cci.20170314": - - patch_file: "patches/00002-fix-boost-asio.patch" - base_path: "source_subfolder" + - patch_file: "patches/0001-cci.20170314-fix-boost-asio.patch" + patch_type: "portability" + patch_description: "Fix compilation issues with newer Boost.Asio" + "1.5": + - patch_file: "patches/0001-1.5-fix-boost-asio.patch" + patch_type: "portability" + patch_description: "Fix compilation issues with newer Boost.Asio" diff --git a/recipes/quickfast/all/conanfile.py b/recipes/quickfast/all/conanfile.py index c5aa454e68422..29ce60d7e04be 100644 --- a/recipes/quickfast/all/conanfile.py +++ b/recipes/quickfast/all/conanfile.py @@ -1,70 +1,83 @@ -from conans import ConanFile, CMake, tools import os -import shutil -import glob + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class QuickfastConan(ConanFile): name = "quickfast" + description = "QuickFAST is an Open Source native C++ implementation of the FAST Protocol" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" - homepage = "https://objectcomputing.com/" - description = "QuickFAST is an Open Source native C++ implementation of the FAST Protocol" - topics = ("conan", "QuickFAST", "FAST", "FIX", "Fix Adapted for STreaming", "Financial Information Exchange", - "libraries", "cpp") - settings = "os", "compiler", "build_type", "arch" - options = {"fPIC": [True, False], - "shared": [True, False]} - default_options = {"fPIC": True, - "shared": False} - requires = ["boost/1.75.0", "xerces-c/3.2.3"] - generators = "cmake" - exports_sources = "CMakeLists.txt", "patches/**" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + homepage = "https://github.com/objectcomputing/quickfast" + topics = ("fast-protocol", "fast", "fix-adapted-for-streaming", "fpl", "fix-protocol-limited") - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob("quickfast-*")[0] - os.rename(extracted_dir, self._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 export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # Uses Boost.Asio transitively + self.requires("boost/1.85.0", transitive_headers=True, transitive_libs=True) + self.requires("xerces-c/3.2.5") + + def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "11") + check_min_cppstd(self, 11) - def build(self): - patches = self.conan_data["patches"][self.version] - for patch in patches: - tools.patch(**patch) + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - cmake = self._configure_cmake() - cmake.build(target="quickfast") + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - cmake = self._configure_cmake() + copy(self, "license.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - self.copy("license.txt", dst="licenses", src=self._source_subfolder) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = ["quickfast"] self.cpp_info.includedirs.append(os.path.join("include", "quickfast")) - if not self.options.shared: + # Needed to keep support for deprecated placeholders in boost::bind + self.cpp_info.defines.append("BOOST_BIND_GLOBAL_PLACEHOLDERS") + + if is_msvc(self) and not self.options.shared: self.cpp_info.defines.append("QUICKFAST_HAS_DLL=0") diff --git a/recipes/quickfast/all/patches/00001-fix-boost-asio.patch b/recipes/quickfast/all/patches/00001-fix-boost-asio.patch deleted file mode 100644 index 02dcc3611cf5c..0000000000000 --- a/recipes/quickfast/all/patches/00001-fix-boost-asio.patch +++ /dev/null @@ -1,42 +0,0 @@ -Patch taken from: -https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/quickfast/00001-fix-boost-asio.patch - -diff --git a/src/Common/QuickFASTPch.h b/src/Common/QuickFASTPch.h -index 3574df8..c4ef4e1 100644 ---- a/src/Common/QuickFASTPch.h -+++ b/src/Common/QuickFASTPch.h -@@ -32,7 +32,7 @@ - #include - - // If building for .NET, must link boost threads dynamically --#define BOOST_THREAD_USE_DLL -+// #define BOOST_THREAD_USE_DLL - // This reports at compile time which boost libraries will be used - // #define BOOST_LIB_DIAGNOSTIC - -diff --git a/src/Communication/AsioService.h b/src/Communication/AsioService.h -index 4f61915..96f2198 100644 ---- a/src/Communication/AsioService.h -+++ b/src/Communication/AsioService.h -@@ -99,6 +99,7 @@ namespace QuickFAST - { - return ioService_; - } -+ boost::asio::io_service::executor_type get_executor() BOOST_ASIO_NOEXCEPT { return ioService_.get_executor();} - - ///@brief Post a completion handler for later processing (usually in a different thread) - /// @param handler is the handler to be posted -diff --git a/src/Communication/AsioService_fwd.h b/src/Communication/AsioService_fwd.h -index dc2f235..6ad5e68 100644 ---- a/src/Communication/AsioService_fwd.h -+++ b/src/Communication/AsioService_fwd.h -@@ -17,7 +17,8 @@ namespace boost - { - namespace asio - { -- class io_service; -+ class io_context; -+ typedef io_context io_service; - } - } - diff --git a/recipes/quickfast/all/patches/00002-fix-boost-asio.patch b/recipes/quickfast/all/patches/00002-fix-boost-asio.patch deleted file mode 100644 index 62dc10d507afe..0000000000000 --- a/recipes/quickfast/all/patches/00002-fix-boost-asio.patch +++ /dev/null @@ -1,42 +0,0 @@ -Patch adapted from: -https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/quickfast/00001-fix-boost-asio.patch - -diff --git a/src/Common/QuickFASTPch.h b/src/Common/QuickFASTPch.h -index 381f846..e6f6b13 100644 ---- a/src/Common/QuickFASTPch.h -+++ b/src/Common/QuickFASTPch.h -@@ -36,7 +36,7 @@ - #include - - // If building for .NET, must link boost threads dynamically --#define BOOST_THREAD_USE_DLL -+// #define BOOST_THREAD_USE_DLL - // This reports at compile time which boost libraries will be used - // #define BOOST_LIB_DIAGNOSTIC - -diff --git a/src/Communication/AsioService.h b/src/Communication/AsioService.h -index 4f61915..54f92ed 100644 ---- a/src/Communication/AsioService.h -+++ b/src/Communication/AsioService.h -@@ -58,6 +58,7 @@ namespace QuickFAST - { - return ioService_.poll(); - } -+ boost::asio::io_service::executor_type get_executor() BOOST_ASIO_NOEXCEPT { return ioService_.get_executor();} - - /// @brief execute at most one ready event handler than return. - size_t poll_one() -diff --git a/src/Communication/AsioService_fwd.h b/src/Communication/AsioService_fwd.h -index dc2f235..6ad5e68 100644 ---- a/src/Communication/AsioService_fwd.h -+++ b/src/Communication/AsioService_fwd.h -@@ -17,7 +17,8 @@ namespace boost - { - namespace asio - { -- class io_service; -+ class io_context; -+ typedef io_context io_service; - } - } - diff --git a/recipes/quickfast/all/patches/0001-1.5-fix-boost-asio.patch b/recipes/quickfast/all/patches/0001-1.5-fix-boost-asio.patch new file mode 100644 index 0000000000000..379f2376249fb --- /dev/null +++ b/recipes/quickfast/all/patches/0001-1.5-fix-boost-asio.patch @@ -0,0 +1,44 @@ +diff --git a/src/Common/QuickFASTPch.h b/src/Common/QuickFASTPch.h +index 3574df8..5e21e89 100644 +--- a/src/Common/QuickFASTPch.h ++++ b/src/Common/QuickFASTPch.h +@@ -32,7 +32,6 @@ + #include + + // If building for .NET, must link boost threads dynamically +-#define BOOST_THREAD_USE_DLL + // This reports at compile time which boost libraries will be used + // #define BOOST_LIB_DIAGNOSTIC + +diff --git a/src/Communication/AsioService.h b/src/Communication/AsioService.h +index 4f61915..b5fa821 100644 +--- a/src/Communication/AsioService.h ++++ b/src/Communication/AsioService.h +@@ -24,7 +24,7 @@ namespace QuickFAST + /// Normal case is for all classes derived from AsioService to share + /// the same boost::io_service. The alternate constructor gives the + /// application more control if it is needed. +- class QuickFAST_Export AsioService ++ class QuickFAST_Export AsioService : public boost::asio::io_service + { + public: + /// @brief Construct using the internal, common io service +diff --git a/src/Communication/AsioService_fwd.h b/src/Communication/AsioService_fwd.h +index dc2f235..8d9be19 100644 +--- a/src/Communication/AsioService_fwd.h ++++ b/src/Communication/AsioService_fwd.h +@@ -13,13 +13,7 @@ + + // forward declare io_service without including + // boost header +-namespace boost +-{ +- namespace asio +- { +- class io_service; +- } +-} ++#include + + namespace QuickFAST + { diff --git a/recipes/quickfast/all/patches/0001-cci.20170314-fix-boost-asio.patch b/recipes/quickfast/all/patches/0001-cci.20170314-fix-boost-asio.patch new file mode 100644 index 0000000000000..c18362970703c --- /dev/null +++ b/recipes/quickfast/all/patches/0001-cci.20170314-fix-boost-asio.patch @@ -0,0 +1,44 @@ +diff --git a/src/Common/QuickFASTPch.h b/src/Common/QuickFASTPch.h +index 381f846..d3016bd 100644 +--- a/src/Common/QuickFASTPch.h ++++ b/src/Common/QuickFASTPch.h +@@ -36,7 +36,6 @@ + #include + + // If building for .NET, must link boost threads dynamically +-#define BOOST_THREAD_USE_DLL + // This reports at compile time which boost libraries will be used + // #define BOOST_LIB_DIAGNOSTIC + +diff --git a/src/Communication/AsioService.h b/src/Communication/AsioService.h +index 4f61915..b5fa821 100644 +--- a/src/Communication/AsioService.h ++++ b/src/Communication/AsioService.h +@@ -24,7 +24,7 @@ namespace QuickFAST + /// Normal case is for all classes derived from AsioService to share + /// the same boost::io_service. The alternate constructor gives the + /// application more control if it is needed. +- class QuickFAST_Export AsioService ++ class QuickFAST_Export AsioService : public boost::asio::io_service + { + public: + /// @brief Construct using the internal, common io service +diff --git a/src/Communication/AsioService_fwd.h b/src/Communication/AsioService_fwd.h +index dc2f235..8d9be19 100644 +--- a/src/Communication/AsioService_fwd.h ++++ b/src/Communication/AsioService_fwd.h +@@ -13,13 +13,7 @@ + + // forward declare io_service without including + // boost header +-namespace boost +-{ +- namespace asio +- { +- class io_service; +- } +-} ++#include + + namespace QuickFAST + { diff --git a/recipes/quickfast/all/test_package/CMakeLists.txt b/recipes/quickfast/all/test_package/CMakeLists.txt index 05ee1b02f3e86..de906d5745a41 100644 --- a/recipes/quickfast/all/test_package/CMakeLists.txt +++ b/recipes/quickfast/all/test_package/CMakeLists.txt @@ -1,11 +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(quickfast REQUIRED CONFIG) add_executable(test ${PROJECT_SOURCE_DIR}/main.cpp) - -target_link_libraries(test ${CONAN_LIBS}) - -set_property(TARGET test PROPERTY CXX_STANDARD 11) +target_link_libraries(test PRIVATE quickfast::quickfast) +target_compile_features(test PRIVATE cxx_std_11) diff --git a/recipes/quickfast/all/test_package/conanfile.py b/recipes/quickfast/all/test_package/conanfile.py index 9f2cb9b06805b..ab9a844efa050 100644 --- a/recipes/quickfast/all/test_package/conanfile.py +++ b/recipes/quickfast/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 QuickfastTestConan(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") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test") + self.run(bin_path, env="conanrun") diff --git a/recipes/quickfast/all/test_package/main.cpp b/recipes/quickfast/all/test_package/main.cpp index 5adcb1b48cd8f..035eaf9d16cd3 100644 --- a/recipes/quickfast/all/test_package/main.cpp +++ b/recipes/quickfast/all/test_package/main.cpp @@ -1,37 +1,12 @@ -#include "Application/QuickFAST.h" -#include "Codecs/MessageConsumer.h" -#include "Codecs/GenericMessageBuilder.h" +#include +#include -using namespace QuickFAST; +#include +#include -class MessageInterpreter : public Codecs::MessageConsumer -{ -public: - MessageInterpreter(std::ostream & out, bool silent = false){ }; - virtual ~MessageInterpreter(){ }; - void setLogLevel(Common::Logger::LogLevel level){ }; - virtual bool consumeMessage(Messages::Message & message){return true;} - virtual bool wantLog(unsigned short level){return true;} - virtual bool logMessage(unsigned short level, const std::string & logMessage){return true;} - virtual bool reportDecodingError(const std::string & errorMessage){return true;} - virtual bool reportCommunicationError(const std::string & errorMessage){return true;} - virtual void decodingStarted(){ } - virtual void decodingStopped(){ } -}; +int main() { + const auto field = QuickFAST::Messages::FieldAscii::create("Hello, World!"); + std::cout << field->toAscii() << std::endl; -int main(int argc, char* argv[]) -{ - Application::DecoderConfiguration configuration_; - Application::DecoderConnection connection_; - - try - { - MessageInterpreter handler(std::cout); - Codecs::GenericMessageBuilder builder(handler); - connection_.configure(builder, configuration_); - connection_.run(); - } - catch (std::exception &) - { - } + return EXIT_SUCCESS; } diff --git a/recipes/quickfast/all/test_v1_package/CMakeLists.txt b/recipes/quickfast/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/quickfast/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/quickfast/all/test_v1_package/conanfile.py b/recipes/quickfast/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..600f82de3b940 --- /dev/null +++ b/recipes/quickfast/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class QuickfastTestConan(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") + self.run(bin_path, run_environment=True) diff --git a/recipes/quickfast/config.yml b/recipes/quickfast/config.yml index 4aad8295800a6..aafc5449a0ecd 100644 --- a/recipes/quickfast/config.yml +++ b/recipes/quickfast/config.yml @@ -1,5 +1,5 @@ versions: - "1.5": - folder: all "cci.20170314": folder: all + "1.5": + folder: all diff --git a/recipes/quill/all/conandata.yml b/recipes/quill/all/conandata.yml index 289ea10c9c0f4..e3bb4f4c9035b 100644 --- a/recipes/quill/all/conandata.yml +++ b/recipes/quill/all/conandata.yml @@ -1,52 +1,13 @@ sources: - "3.7.0": - url: "https://github.com/odygrd/quill/archive/v3.7.0.tar.gz" - sha256: "53afe555c32b4263c9d31ec11bd0d858983374af7a5e79eb26124f803b192515" - "3.6.0": - url: "https://github.com/odygrd/quill/archive/v3.6.0.tar.gz" - sha256: "ba9dc3df262f2e65c57904580cc8407eba9a462001340c17bab7ae1dccddb4bd" - "3.5.1": - url: "https://github.com/odygrd/quill/archive/v3.5.1.tar.gz" - sha256: "9fa4ebe594c66ce2a409630c304724fa7a2ada0d842ba9c9aaf05f0a90b461f9" - "3.5.0": - url: "https://github.com/odygrd/quill/archive/v3.5.0.tar.gz" - sha256: "47a69465cddeb05645745bed0b3099b49cb627464782f765ce9545723ff1fe84" - "3.4.1": - url: "https://github.com/odygrd/quill/archive/v3.4.1.tar.gz" - sha256: "99f6497b8ba37c30c871fab89f14cd7bc989f3eaa921ccd940a521ee60a6a1c5" - "3.4.0": - url: "https://github.com/odygrd/quill/archive/v3.4.0.tar.gz" - sha256: "16a6cfadc288953f07d128bb51e8ebd4ca6bb8ce4175b5a8af53ce7dde324d8d" - "3.3.1": - url: "https://github.com/odygrd/quill/archive/v3.3.1.tar.gz" - sha256: "f929d54a115b45c32dd2acd1a9810336d35c31fde9f5581c51ad2b80f980d0d1" - "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" - "2.9.2": - url: "https://github.com/odygrd/quill/archive/v2.9.2.tar.gz" - sha256: "5b5b502f33277d1ebdb39d57898b1ca25affef4819d390927499f368dd562d91" - "2.9.1": - url: "https://github.com/odygrd/quill/archive/v2.9.1.tar.gz" - sha256: "921e053118136f63cebb2ca1d7e42456fd0bf9626facb755884709092753c054" - "2.9.0": - url: "https://github.com/odygrd/quill/archive/v2.9.0.tar.gz" - sha256: "dec64c0fbb4bfbafe28fdeeeefac10206285bf2be4a42ec5dfb7987ca4ccb372" - "2.8.0": - url: "https://github.com/odygrd/quill/archive/v2.8.0.tar.gz" - sha256: "0461a6c314e3d882f3b9ada487ef1bf558925272509ee41a9fd25f7776db6075" - "2.7.0": - url: "https://github.com/odygrd/quill/archive/v2.7.0.tar.gz" - sha256: "10b8912e4c463a3a86b809076b95bec49aa08393d9ae6b92196cd46314236b87" - "2.6.0": - url: "https://github.com/odygrd/quill/archive/v2.6.0.tar.gz" - sha256: "d72fd5a01bf8d3e59ed93a789a8f103bc31efe0fb3c09182c74036a2e3a8451b" - "1.7.3": - url: "https://github.com/odygrd/quill/archive/v1.7.3.tar.gz" - sha256: "3fff0c5ffb19bbde5429369079741f84a6acce3a781b504cec5e677b05461208" + "4.5.0": + url: "https://github.com/odygrd/quill/archive/v4.5.0.tar.gz" + sha256: "70e8f4a76fd8a83b60d378f31b70dd09a9381686ebafdcd0db08fe099f518309" + "4.4.1": + url: "https://github.com/odygrd/quill/archive/v4.4.1.tar.gz" + sha256: "c5e0c829096f81364fd55ac1358fe72b27785839474caa9c904b12a9e95c0e88" + "4.4.0": + url: "https://github.com/odygrd/quill/archive/v4.4.0.tar.gz" + sha256: "be166da93210df53aab34ece1bddd14b08506588186723b504ffeeec651bbf7c" + "4.3.0": + url: "https://github.com/odygrd/quill/archive/v4.3.0.tar.gz" + sha256: "c97bf3bfac6dfb7ed77fa08d945a490e302ba07e405539fda61985b39750cb29" diff --git a/recipes/quill/all/conanfile.py b/recipes/quill/all/conanfile.py index 96693e04b9fe8..a696da22a6a0a 100644 --- a/recipes/quill/all/conanfile.py +++ b/recipes/quill/all/conanfile.py @@ -1,10 +1,9 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.files import 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 -from conan.tools.microsoft import is_msvc +from conan.tools.layout import basic_layout import os @@ -16,60 +15,28 @@ class QuillConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/odygrd/quill/" - topics = ("logging", "log", "async") - package_type = "static-library" + topics = ("logging", "log", "async", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - options = { - "fPIC": [True, False], - "with_bounded_queue": [True, False], - "with_no_exceptions": [True, False], - "with_x86_arch": [True, False], - "with_bounded_blocking_queue": [True, False], - } - default_options = { - "fPIC": True, - "with_bounded_queue": False, - "with_no_exceptions": False, - "with_x86_arch": False, - "with_bounded_blocking_queue": False, - } @property def _min_cppstd(self): - return "17" if Version(self.version) >= "2.0.0" else "14" + return "17" @property def _compilers_minimum_versions(self): return { - "14": - { - "gcc": "5", - "Visual Studio": "15", - "clang": "5", - "apple-clang": "10", - }, - "17": - { - "gcc": "8", - "Visual Studio": "16", - "clang": "7", - "apple-clang": "12", - }, + "gcc": "8", + "Visual Studio": "16", + "clang": "7", + "apple-clang": "12", } - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def configure(self): - if Version(self.version) < "2.8.0": - del self.options.with_bounded_blocking_queue - def layout(self): - cmake_layout(self, src_folder="src") + basic_layout(self, src_folder="src") - def requirements(self): - self.requires("fmt/10.2.1", transitive_headers=True) + def package_id(self): + self.info.clear() def validate(self): supported_archs = ["x86", "x86_64", "armv6", "armv7", "armv7hf", "armv8"] @@ -80,95 +47,42 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) - compilers_minimum_version = self._compilers_minimum_versions[self._min_cppstd] + compilers_minimum_version = self._compilers_minimum_versions minimum_version = compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: if Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") - else: - self.output.warning(f"{self.ref} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") - if Version(self.version) >= "2.0.0" and \ - self.settings.compiler== "clang" and Version(self.settings.compiler.version).major == "11" and \ + if self.settings.compiler== "clang" and Version(self.settings.compiler.version).major == "11" and \ self.settings.compiler.libcxx == "libstdc++": raise ConanInvalidConfiguration(f"{self.ref} requires C++ filesystem library, which your compiler doesn't support.") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def is_quilll_x86_arch(self): - if not self.options.with_x86_arch: - return False - if Version(self.version) < "2.7.0": - return False - if self.settings.arch not in ("x86", "x86_64"): - return False - if self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libc++": - return False - if is_msvc(self): - return False - return True - - 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(): - if Version(self.version) < "2.8.0": - tc.variables["QUILL_X86ARCH"] = True - else: - tc.preprocessor_definitions["QUILL_X86ARCH"] = 1 - 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) - deps.generate() def _patch_sources(self): # remove bundled fmt rmdir(self, os.path.join(self.source_folder, "quill", "quill", "include", "quill", "bundled", "fmt")) - rmdir(self, os.path.join(self.source_folder, "quill", "quill", "src", "bundled", "fmt")) - - if "2.0.0" <= Version(self.version) < "2.9.1": - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - """set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/quill/cmake" CACHE STRING "Modules for CMake" FORCE)""", - """set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_LIST_DIR}/quill/cmake")""" - ) def build(self): self._patch_sources() - cmake = CMake(self) - cmake.configure() - cmake.build() def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - cmake = CMake(self) - cmake.install() + copy( + self, + "*.h", + os.path.join(self.source_folder, "quill", "include"), + os.path.join(self.package_folder, "include"), + ) - rmdir(self, os.path.join(self.package_folder, "pkgconfig")) - rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.libs = ["quill"] - self.cpp_info.defines.append("QUILL_FMT_EXTERNAL") - if self.is_quilll_x86_arch(): - self.cpp_info.defines.append("QUILL_X86ARCH") - self.cpp_info.cxxflags.append("-mclflushopt") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("pthread") - if Version(self.version) >= "2.0.0" and \ - self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": self.cpp_info.system_libs.append("stdc++fs") diff --git a/recipes/quill/all/test_package/CMakeLists.txt b/recipes/quill/all/test_package/CMakeLists.txt index b6b657d776df5..4d5e7a7566fab 100644 --- a/recipes/quill/all/test_package/CMakeLists.txt +++ b/recipes/quill/all/test_package/CMakeLists.txt @@ -4,13 +4,8 @@ project(test_package LANGUAGES CXX) find_package(quill REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) + target_link_libraries(${PROJECT_NAME} PRIVATE quill::quill) -if(quill_VERSION VERSION_GREATER_EQUAL "2.0.0") - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -else() - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) -endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_compile_definitions(${PROJECT_NAME} PRIVATE QUILL_FILE_HANDLERS_API_V3_3) -if(quill_VERSION VERSION_GREATER_EQUAL "3.3.0") - target_compile_definitions(${PROJECT_NAME} PRIVATE QUILL_FILE_HANDLERS_API_V3_3) -endif() diff --git a/recipes/quill/all/test_package/test_package.cpp b/recipes/quill/all/test_package/test_package.cpp index b02a6dd344b06..3c984618a5cd0 100644 --- a/recipes/quill/all/test_package/test_package.cpp +++ b/recipes/quill/all/test_package/test_package.cpp @@ -1,19 +1,59 @@ -#include "quill/Quill.h" +#include "quill/Backend.h" +#include "quill/Frontend.h" +#include "quill/LogMacros.h" +#include "quill/Logger.h" +#include "quill/sinks/ConsoleSink.h" + +#include +#include + +/** + * Trivial logging example to console + */ int main() { - quill::start(); -#ifdef QUILL_FILE_HANDLERS_API_V3_3 - auto file_handler = quill::file_handler("logfile.log", []() { - quill::FileHandlerConfig cfg; - cfg.set_open_mode('w'); - return cfg; - }()); -#else - auto file_handler = quill::file_handler("logfile.log", "w"); -#endif - auto my_logger = quill::create_logger("my_logger", std::move(file_handler)); - - LOG_INFO(my_logger, "Hello from {}", "Quill"); - LOG_CRITICAL(my_logger, "This is a conan example {}", 1234); + // Start the backend thread + quill::BackendOptions backend_options; + quill::Backend::start(backend_options); + + // Frontend + auto console_sink = quill::Frontend::create_or_get_sink("sink_id_1"); + quill::Logger* logger = quill::Frontend::create_or_get_logger("root", std::move(console_sink)); + + // Change the LogLevel to print everything + logger->set_log_level(quill::LogLevel::TraceL3); + + LOG_TRACE_L3(logger, "This is a log trace l3 example {}", 1); + LOG_TRACE_L2(logger, "This is a log trace l2 example {} {}", 2, 2.3); + LOG_TRACE_L1(logger, "This is a log trace l1 {} example", "string"); + LOG_DEBUG(logger, "This is a log debug example {}", 4); + LOG_INFO(logger, "This is a log info example {}", sizeof(std::string)); + LOG_WARNING(logger, "This is a log warning example {}", sizeof(std::string)); + LOG_ERROR(logger, "This is a log error example {}", sizeof(std::string)); + LOG_CRITICAL(logger, "This is a log critical example {}", sizeof(std::string)); + + // libfmt format specification mini language is supported + // note: named arguments are not supported + LOG_INFO(logger, "Support for int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}", 42); + LOG_INFO(logger, "Easy padding in numbers like {:08d}", 12); + LOG_INFO(logger, "{:>30}", "right aligned"); + LOG_INFO(logger, "Positional arguments {1} {2} {0} ", "too", "are", "supported"); + LOG_INFO(logger, "Support for precision {:.4f}", 1.23456); + + // To log with a different format to the same sink, just create another logger + auto console_sink_2 = quill::Frontend::get_sink("sink_id_1"); // get the created sink + quill::Logger* logger_2 = quill::Frontend::create_or_get_logger( + "logger_2", std::move(console_sink_2), "%(time) %(log_level:<9) %(logger:<12) %(message)"); + + logger_2->set_log_level(quill::LogLevel::TraceL3); + + LOG_TRACE_L3(logger_2, "This is a log trace l3 example {}", 1); + LOG_TRACE_L2(logger_2, "This is a log trace l2 example {} {}", 2, 2.3); + LOG_TRACE_L1(logger_2, "This is a log trace l1 {} example", "string"); + LOG_DEBUG(logger_2, "This is a log debug example {}", 4); + LOG_INFO(logger_2, "This is a log info example {}", sizeof(std::string)); + LOG_WARNING(logger_2, "This is a log warning example {}", sizeof(std::string)); + LOG_ERROR(logger_2, "This is a log error example {}", sizeof(std::string)); + LOG_CRITICAL(logger_2, "This is a log critical example {}", sizeof(std::string)); } diff --git a/recipes/quill/all/test_v1_package/CMakeLists.txt b/recipes/quill/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/quill/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/quill/config.yml b/recipes/quill/config.yml index b27bda5fe6f9a..5fc71b60926cd 100644 --- a/recipes/quill/config.yml +++ b/recipes/quill/config.yml @@ -1,35 +1,23 @@ versions: - "3.7.0": + "4.5.0": folder: "all" - "3.6.0": + "4.4.1": folder: "all" - "3.5.1": + "4.4.0": folder: "all" - "3.5.0": + "4.3.0": folder: "all" + "3.9.0": + folder: "old" + "3.8.0": + folder: "old" + "3.7.0": + folder: "old" + "3.6.0": + folder: "old" + "3.5.1": + folder: "old" "3.4.1": - folder: "all" - "3.4.0": - folder: "all" + folder: "old" "3.3.1": - folder: "all" - "3.2.0": - folder: "all" - "3.1.0": - folder: "all" - "3.0.2": - folder: "all" - "2.9.2": - folder: "all" - "2.9.1": - folder: "all" - "2.9.0": - folder: "all" - "2.8.0": - folder: "all" - "2.7.0": - folder: "all" - "2.6.0": - folder: "all" - "1.7.3": - folder: "all" + folder: "old" diff --git a/recipes/quill/old/conandata.yml b/recipes/quill/old/conandata.yml new file mode 100644 index 0000000000000..e824ffff0b673 --- /dev/null +++ b/recipes/quill/old/conandata.yml @@ -0,0 +1,22 @@ +sources: + "3.9.0": + url: "https://github.com/odygrd/quill/archive/v3.9.0.tar.gz" + sha256: "6e6a46dc6ae94e8321aca00d27dae754dcc51ee83fe60078f8f1f3eb7b3b227b" + "3.8.0": + url: "https://github.com/odygrd/quill/archive/v3.8.0.tar.gz" + sha256: "d3e1b349c5d6904c9644e5b79ec65f21692e8094a3d75241a7fe071076eef4dd" + "3.7.0": + url: "https://github.com/odygrd/quill/archive/v3.7.0.tar.gz" + sha256: "53afe555c32b4263c9d31ec11bd0d858983374af7a5e79eb26124f803b192515" + "3.6.0": + url: "https://github.com/odygrd/quill/archive/v3.6.0.tar.gz" + sha256: "ba9dc3df262f2e65c57904580cc8407eba9a462001340c17bab7ae1dccddb4bd" + "3.5.1": + url: "https://github.com/odygrd/quill/archive/v3.5.1.tar.gz" + sha256: "9fa4ebe594c66ce2a409630c304724fa7a2ada0d842ba9c9aaf05f0a90b461f9" + "3.4.1": + url: "https://github.com/odygrd/quill/archive/v3.4.1.tar.gz" + sha256: "99f6497b8ba37c30c871fab89f14cd7bc989f3eaa921ccd940a521ee60a6a1c5" + "3.3.1": + url: "https://github.com/odygrd/quill/archive/v3.3.1.tar.gz" + sha256: "f929d54a115b45c32dd2acd1a9810336d35c31fde9f5581c51ad2b80f980d0d1" diff --git a/recipes/quill/old/conanfile.py b/recipes/quill/old/conanfile.py new file mode 100644 index 0000000000000..a45f9d7d13297 --- /dev/null +++ b/recipes/quill/old/conanfile.py @@ -0,0 +1,143 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import 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 +from conan.tools.microsoft import is_msvc + +import os + +required_conan_version = ">=1.52.0" + +class QuillConan(ConanFile): + name = "quill" + description = "Asynchronous Low Latency C++ Logging Library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/odygrd/quill/" + topics = ("logging", "log", "async") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "with_bounded_queue": [True, False], + "with_no_exceptions": [True, False], + "with_x86_arch": [True, False], + "with_bounded_blocking_queue": [True, False], + } + default_options = { + "fPIC": True, + "with_bounded_queue": False, + "with_no_exceptions": False, + "with_x86_arch": False, + "with_bounded_blocking_queue": False, + } + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_versions(self): + return { + "gcc": "8", + "Visual Studio": "16", + "clang": "7", + "apple-clang": "12", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("fmt/10.2.1", transitive_headers=True) + + def validate(self): + supported_archs = ["x86", "x86_64", "armv6", "armv7", "armv7hf", "armv8"] + + if not any(arch in str(self.settings.arch) for arch in supported_archs): + raise ConanInvalidConfiguration(f"{self.settings.arch} is not supported by {self.ref}") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + compilers_minimum_version = self._compilers_minimum_versions + minimum_version = compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version: + if Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") + else: + self.output.warning(f"{self.ref} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") + + if self.settings.compiler== "clang" and Version(self.settings.compiler.version).major == "11" and \ + self.settings.compiler.libcxx == "libstdc++": + raise ConanInvalidConfiguration(f"{self.ref} requires C++ filesystem library, which your compiler doesn't support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def is_quilll_x86_arch(self): + if not self.options.with_x86_arch: + return False + if self.settings.arch not in ("x86", "x86_64"): + return False + if self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libc++": + return False + if is_msvc(self): + return False + return True + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["QUILL_FMT_EXTERNAL"] = True + tc.variables["QUILL_ENABLE_INSTALL"] = True + 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(): + tc.preprocessor_definitions["QUILL_X86ARCH"] = 1 + tc.variables["CMAKE_CXX_FLAGS"] = "-mclflushopt" + if self.options.get_safe("with_bounded_blocking_queue"): + tc.preprocessor_definitions["QUILL_USE_BOUNDED_BLOCKING_QUEUE"] = 1 + tc.variables["QUILL_DISABLE_POSITION_INDEPENDENT_CODE"] = not self.options.get_safe("fPIC") + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + # remove bundled fmt + rmdir(self, os.path.join(self.source_folder, "quill", "quill", "include", "quill", "bundled", "fmt")) + rmdir(self, os.path.join(self.source_folder, "quill", "quill", "src", "bundled", "fmt")) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["quill"] + if self.is_quilll_x86_arch(): + self.cpp_info.defines.append("QUILL_X86ARCH") + self.cpp_info.cxxflags.append("-mclflushopt") + self.cpp_info.defines.append("QUILL_FMT_EXTERNAL") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": + self.cpp_info.system_libs.append("stdc++fs") diff --git a/recipes/quill/old/test_package/CMakeLists.txt b/recipes/quill/old/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..519d5ee2b3973 --- /dev/null +++ b/recipes/quill/old/test_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(quill REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +target_link_libraries(${PROJECT_NAME} PRIVATE quill::quill) +if(quill_VERSION VERSION_GREATER_EQUAL "2.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() + +if(quill_VERSION VERSION_GREATER_EQUAL "3.3.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE QUILL_FILE_HANDLERS_API_V3_3) +endif() diff --git a/recipes/quill/old/test_package/conanfile.py b/recipes/quill/old/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/quill/old/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/quill/old/test_package/test_package.cpp b/recipes/quill/old/test_package/test_package.cpp new file mode 100644 index 0000000000000..b02a6dd344b06 --- /dev/null +++ b/recipes/quill/old/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include "quill/Quill.h" + +int main() +{ + quill::start(); +#ifdef QUILL_FILE_HANDLERS_API_V3_3 + auto file_handler = quill::file_handler("logfile.log", []() { + quill::FileHandlerConfig cfg; + cfg.set_open_mode('w'); + return cfg; + }()); +#else + auto file_handler = quill::file_handler("logfile.log", "w"); +#endif + auto my_logger = quill::create_logger("my_logger", std::move(file_handler)); + + LOG_INFO(my_logger, "Hello from {}", "Quill"); + LOG_CRITICAL(my_logger, "This is a conan example {}", 1234); +} diff --git a/recipes/libassert/all/test_v1_package/CMakeLists.txt b/recipes/quill/old/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/libassert/all/test_v1_package/CMakeLists.txt rename to recipes/quill/old/test_v1_package/CMakeLists.txt diff --git a/recipes/quill/all/test_v1_package/conanfile.py b/recipes/quill/old/test_v1_package/conanfile.py similarity index 100% rename from recipes/quill/all/test_v1_package/conanfile.py rename to recipes/quill/old/test_v1_package/conanfile.py diff --git a/recipes/qxmpp/all/CMakeLists.txt b/recipes/qxmpp/all/CMakeLists.txt deleted file mode 100644 index 59052ada070a2..0000000000000 --- a/recipes/qxmpp/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS KEEP_RPATHS) - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory(source_subfolder) diff --git a/recipes/qxmpp/all/conandata.yml b/recipes/qxmpp/all/conandata.yml index 57b44e43f1da6..d54578ee2ca20 100644 --- a/recipes/qxmpp/all/conandata.yml +++ b/recipes/qxmpp/all/conandata.yml @@ -4,7 +4,9 @@ sources: sha256: "2148162138eaf4b431a6ee94104f87877b85a589da803dff9433c698b4cf4f19" patches: "1.4.0": - - patch_file: "patches/001-add_conan_1.4.0.patch" - base_path: "source_subfolder" - - patch_file: "patches/002-add_gstreamer_1.4.0.patch" - base_path: "source_subfolder" + - patch_file: "patches/001-skip-module-path.patch" + patch_description: "Do not use module path provided by the upstream" + patch_type: "conan" + - patch_file: "patches/002-use-conan-gstreamer.patch" + patch_description: "Adapt to consume gstreamer from Conan" + patch_type: "conan" diff --git a/recipes/qxmpp/all/conanfile.py b/recipes/qxmpp/all/conanfile.py index b89c7627065d2..e57f163a543f8 100644 --- a/recipes/qxmpp/all/conanfile.py +++ b/recipes/qxmpp/all/conanfile.py @@ -1,20 +1,27 @@ -from conan import ConanFile -from conan.tools import files -from conans import CMake -import functools 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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, rename, mkdir +from conan.tools.microsoft import is_msvc +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.scm import Version + +required_conan_version = ">=1.60.0 <2 || >=2.0.5" class QxmppConan(ConanFile): name = "qxmpp" + description = ("Cross-platform C++ XMPP client and server library. " + "It is written in C++ and uses Qt framework.") license = "LGPL-2.1" - homepage = "https://github.com/qxmpp-project/qxmpp" url = "https://github.com/conan-io/conan-center-index" - description = "Cross-platform C++ XMPP client and server library. It is written in C++ and uses Qt framework." - topics = "qt", "qt6", "xmpp", "xmpp-library", "xmpp-server", "xmpp-client" + homepage = "https://github.com/qxmpp-project/qxmpp" + topics = ("qt", "qt6", "xmpp", "xmpp-library", "xmpp-server", "xmpp-client") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -27,62 +34,84 @@ class QxmppConan(ConanFile): "with_gstreamer": False, } - generators = "cmake", "cmake_find_package_multi" + @property + def _min_cppstd(self): + return 17 @property - def _source_subfolder(self): - return "source_subfolder" + def _compilers_minimum_version(self): + return { + "gcc": "10", + "Visual Studio": "17", + "msvc": "192", + "clang": "8", + "apple-clang": "13", + } def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - if self.options.shared: - del self.options.fPIC + if self.options.get_safe("shared"): + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("qt/6.2.4") + self.requires("qt/[>=5.15 <7]", transitive_headers=True, transitive_libs=True) if self.options.with_gstreamer: - self.requires("gstreamer/1.19.2") - self.requires("glib/2.70.1") + self.requires("gstreamer/1.22.6") + self.requires("glib/2.78.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.") + + def build_requirements(self): + self.tool_requires("qt/") def source(self): - files.get(self, **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): + venv = VirtualBuildEnv(self) + venv.generate() + venv = VirtualRunEnv(self) + venv.generate(scope="build") + tc = CMakeToolchain(self) + tc.variables["BUILD_DOCUMENTATION"] = False + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["WITH_GSTREAMER"] = self.options.with_gstreamer + tc.variables["BUILD_SHARED"] = self.options.get_safe("shared") + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + tc = CMakeDeps(self) + tc.generate() - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): + apply_conandata_patches(self) cmake = CMake(self) - cmake.definitions["BUILD_DOCUMENTATION"] = "OFF" - cmake.definitions["BUILD_TESTS"] = "OFF" - cmake.definitions["BUILD_EXAMPLES"] = "OFF" - cmake.definitions["WITH_GSTREAMER"] = self.options.with_gstreamer - cmake.definitions["BUILD_SHARED"] = self.options.shared cmake.configure() - return cmake - - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - files.patch(self, **patch) - cmake = self._configure_cmake() cmake.build() def package(self): - self.copy("LICENSE.LGPL", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.LGPL", 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", "pkgconfig")) - - if self.options.shared and self.settings.os == "Windows": - files.mkdir(self, os.path.join(self.package_folder, "bin")) - files.rename(self, os.path.join(self.package_folder, "lib", "qxmpp.dll"), - os.path.join(self.package_folder, "bin", "qxmpp.dll")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + if is_msvc(self) and self.options.shared: + mkdir(self, os.path.join(self.package_folder, "bin")) + rename(self, os.path.join(self.package_folder, "lib", "qxmpp.dll"), os.path.join(self.package_folder, "bin", "qxmpp.dll")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "QXmpp") @@ -91,7 +120,5 @@ def package_info(self): self.cpp_info.libs = ["qxmpp"] self.cpp_info.includedirs.append(os.path.join("include", "qxmpp")) self.cpp_info.requires = ["qt::qtCore", "qt::qtNetwork", "qt::qtXml"] - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "QXmpp" - self.cpp_info.names["cmake_find_package_multi"] = "QXmpp" + if self.options.with_gstreamer: + self.cpp_info.requires.extend(["gstreamer::gstreamer", "glib::glib"]) diff --git a/recipes/qxmpp/all/patches/001-add_conan_1.4.0.patch b/recipes/qxmpp/all/patches/001-add_conan_1.4.0.patch deleted file mode 100644 index da7431faa740a..0000000000000 --- a/recipes/qxmpp/all/patches/001-add_conan_1.4.0.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 550ea39a..9ed4d825 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -8,10 +8,12 @@ set(CMAKE_CXX_STANDARD 17) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) - --set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/modules") - --find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network Xml) --find_package(Qt${QT_VERSION_MAJOR} 5.7.0 REQUIRED COMPONENTS Core Network Xml) -+list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}) -+list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}) -+ -+find_package(Qt6 COMPONENTS Core Network Xml REQUIRED) -+set(QT_VERSION_MAJOR 6) - - set(CMAKE_AUTOMOC ON) - set(CMAKE_AUTORCC ON) diff --git a/recipes/qxmpp/all/patches/001-skip-module-path.patch b/recipes/qxmpp/all/patches/001-skip-module-path.patch new file mode 100644 index 0000000000000..d499e412b3ef3 --- /dev/null +++ b/recipes/qxmpp/all/patches/001-skip-module-path.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 550ea39..e550959 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,10 +8,8 @@ set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + +-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/modules") + + find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network Xml) +-find_package(Qt${QT_VERSION_MAJOR} 5.7.0 REQUIRED COMPONENTS Core Network Xml) + + set(CMAKE_AUTOMOC ON) + set(CMAKE_AUTORCC ON) diff --git a/recipes/qxmpp/all/patches/002-add_gstreamer_1.4.0.patch b/recipes/qxmpp/all/patches/002-use-conan-gstreamer.patch similarity index 100% rename from recipes/qxmpp/all/patches/002-add_gstreamer_1.4.0.patch rename to recipes/qxmpp/all/patches/002-use-conan-gstreamer.patch diff --git a/recipes/qxmpp/all/test_package/CMakeLists.txt b/recipes/qxmpp/all/test_package/CMakeLists.txt index 4398033dd2797..d6ea9ec68f7ad 100644 --- a/recipes/qxmpp/all/test_package/CMakeLists.txt +++ b/recipes/qxmpp/all/test_package/CMakeLists.txt @@ -1,12 +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(QXmpp REQUIRED CONFIG) -set(CMAKE_CXX_STANDARD 17) - add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} QXmpp::QXmpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/qxmpp/all/test_package/conanfile.py b/recipes/qxmpp/all/test_package/conanfile.py index 1bf1c7e26255d..ef5d7042163ec 100644 --- a/recipes/qxmpp/all/test_package/conanfile.py +++ b/recipes/qxmpp/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", "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) @@ -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/qxmpp/all/test_package/test_package.cpp b/recipes/qxmpp/all/test_package/test_package.cpp index dabb1c214e126..213a59473e7a4 100644 --- a/recipes/qxmpp/all/test_package/test_package.cpp +++ b/recipes/qxmpp/all/test_package/test_package.cpp @@ -1,7 +1,9 @@ +#include #include #include int main() { QXmppClient client; client.logger()->setLoggingType(QXmppLogger::StdoutLogging); + return EXIT_SUCCESS; } diff --git a/recipes/rabbitmq-c/all/conandata.yml b/recipes/rabbitmq-c/all/conandata.yml index 4a93aef8c8422..eeadabf60d0ef 100755 --- a/recipes/rabbitmq-c/all/conandata.yml +++ b/recipes/rabbitmq-c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.14.0": + url: "https://github.com/alanxz/rabbitmq-c/archive/v0.14.0.tar.gz" + sha256: "839b28eae20075ac58f45925fe991d16a3138cbde015db0ee11df1acb1c493df" "0.13.0": url: "https://github.com/alanxz/rabbitmq-c/archive/v0.13.0.tar.gz" sha256: "8b224e41bba504fc52b02f918d8df7e4bf5359d493cbbff36c06078655c676e6" diff --git a/recipes/rabbitmq-c/all/conanfile.py b/recipes/rabbitmq-c/all/conanfile.py index a192092e12ead..278092bcc50b8 100755 --- a/recipes/rabbitmq-c/all/conanfile.py +++ b/recipes/rabbitmq-c/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rmdir from conan.tools.scm import Version +from conan.tools.env import VirtualBuildEnv import os required_conan_version = ">=1.53.0" @@ -9,10 +10,10 @@ class RabbitmqcConan(ConanFile): name = "rabbitmq-c" + description = "This is a C-language AMQP client library for use with v2.0+ of the RabbitMQ broker." license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/alanxz/rabbitmq-c" - description = "This is a C-language AMQP client library for use with v2.0+ of the RabbitMQ broker." topics = ("rabbitmq", "message queue") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -41,6 +42,10 @@ def requirements(self): if self.options.ssl: self.requires("openssl/[>=1.1 <4]") + def build_requirements(self): + if Version(self.version) >= "0.14.0": + self.tool_requires("cmake/[>=3.22 <4]") + def layout(self): cmake_layout(self, src_folder="src") @@ -68,6 +73,10 @@ def generate(self): deps = CMakeDeps(self) deps.generate() + if Version(self.version) >= "0.14.0": + venv = VirtualBuildEnv(self) + venv.generate(scope="build") + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/rabbitmq-c/config.yml b/recipes/rabbitmq-c/config.yml index 5d590dc0b2c3b..b97f7da4c2ee8 100644 --- a/recipes/rabbitmq-c/config.yml +++ b/recipes/rabbitmq-c/config.yml @@ -1,4 +1,6 @@ versions: + "0.14.0": + folder: all "0.13.0": folder: all "0.11.0": diff --git a/recipes/rapidcsv/all/conandata.yml b/recipes/rapidcsv/all/conandata.yml index 22f73545deb36..9764e6f2eeb8e 100644 --- a/recipes/rapidcsv/all/conandata.yml +++ b/recipes/rapidcsv/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "8.83": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.83.tar.gz" + sha256: "9342eeb0ce37e30b778c4c030129d03e99f44a66d4710ac19627187bee774097" + "8.82": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.82.tar.gz" + sha256: "4f1f57ca9db0f5447416acbef4e059cbd7cb03f6eb39fec1301732bbedaac927" "8.80": url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.80.tar.gz" sha256: "4c9e01cb2554cc76acac61532ef33b59e5b1f822160d2eb7efee2c128ea7f4c5" diff --git a/recipes/rapidcsv/config.yml b/recipes/rapidcsv/config.yml index 643c892898926..d9fb49b9ff86d 100644 --- a/recipes/rapidcsv/config.yml +++ b/recipes/rapidcsv/config.yml @@ -1,4 +1,8 @@ versions: + "8.83": + folder: "all" + "8.82": + folder: "all" "8.80": folder: "all" "8.77": diff --git a/recipes/rapidfuzz/all/conandata.yml b/recipes/rapidfuzz/all/conandata.yml index 79328af160566..2504b2040c796 100644 --- a/recipes/rapidfuzz/all/conandata.yml +++ b/recipes/rapidfuzz/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.4": + url: "https://github.com/rapidfuzz/rapidfuzz-cpp/archive/refs/tags/v3.0.4.tar.gz" + sha256: "18d1c41575ceddd6308587da8befc98c85d3b5bc2179d418daffed6d46b8cb0a" "3.0.2": url: "https://github.com/rapidfuzz/rapidfuzz-cpp/archive/refs/tags/v3.0.2.tar.gz" sha256: "4fddce5c0368e78bd604c6b820e6be248d669754715e39b4a8a281bda4c06de1" diff --git a/recipes/rapidfuzz/config.yml b/recipes/rapidfuzz/config.yml index f32d6b33d56dc..7af7ecd804cb2 100644 --- a/recipes/rapidfuzz/config.yml +++ b/recipes/rapidfuzz/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.4": + folder: "all" "3.0.2": folder: "all" "3.0.0": diff --git a/recipes/rapidyaml/all/conandata.yml b/recipes/rapidyaml/all/conandata.yml index dd5074af2a9b9..70ade977aaed0 100644 --- a/recipes/rapidyaml/all/conandata.yml +++ b/recipes/rapidyaml/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.0": + url: "https://github.com/biojppm/rapidyaml/releases/download/v0.7.0/rapidyaml-0.7.0-src.tgz" + sha256: "ef9f89b68de711c561720f1e70d1594e953356a07d297d36b8ccd3ded0589715" "0.5.0": url: "https://github.com/biojppm/rapidyaml/releases/download/v0.5.0/rapidyaml-0.5.0-src.tgz" sha256: "6493557778791a3a2375510ce6c0ecd70163fc8ce4f8ed683acc36e3e55ee881" @@ -12,6 +15,10 @@ sources: url: "https://github.com/biojppm/rapidyaml/releases/download/v0.3.0/rapidyaml-0.3.0-src.tgz" sha256: "38854b8359eaf42cc27352f4b7321f509f6775445a3e2746cc8cd1e468a52aa9" patches: + "0.7.0": + - patch_file: "patches/0.7.0-001-remove-internal-c4core.patch" + patch_description: "disable using internal c4core" + patch_type: "conan" "0.5.0": - patch_file: "patches/0.5.0-001-remove-internal-c4core.patch" patch_description: "disable using internal c4core" diff --git a/recipes/rapidyaml/all/conanfile.py b/recipes/rapidyaml/all/conanfile.py index 5e12ce14eb4bb..01c81be0b90ae 100644 --- a/recipes/rapidyaml/all/conanfile.py +++ b/recipes/rapidyaml/all/conanfile.py @@ -21,12 +21,16 @@ class RapidYAMLConan(ConanFile): "fPIC": [True, False], "with_default_callbacks": [True, False], "with_tab_tokens": [True, False], + "with_default_callback_uses_exceptions": [True, False], + "with_assert": [True, False], } default_options = { "shared": False, "fPIC": True, "with_default_callbacks": True, "with_tab_tokens": False, + "with_default_callback_uses_exceptions": False, + "with_assert": False, } @property @@ -41,16 +45,25 @@ def config_options(self): del self.options.fPIC if Version(self.version) < "0.4.0": del self.options.with_tab_tokens + if Version(self.version) < "0.6.0": + del self.options.with_default_callback_uses_exceptions + del self.options.with_assert def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + # with_default_callback_uses_exceptions should only be valid if with_default_callbacks is true + if not self.options.with_default_callbacks: + self.options.rm_safe("with_default_callback_uses_exceptions") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("c4core/0.1.11", transitive_headers=True) + if Version(self.version) < "0.6.0": + self.requires("c4core/0.1.11", transitive_headers=True) + else: + self.requires("c4core/0.2.0", transitive_headers=True) def validate(self): if self.info.settings.compiler.cppstd: @@ -65,6 +78,9 @@ def generate(self): tc.variables["RYML_DEFAULT_CALLBACKS"] = self.options.with_default_callbacks if Version(self.version) >= "0.4.0": tc.variables["RYML_WITH_TAB_TOKENS"] = self.options.with_tab_tokens + if Version(self.version) >= "0.6.0": + tc.variables["RYML_DEFAULT_CALLBACK_USES_EXCEPTIONS"] = self.options.with_default_callback_uses_exceptions + tc.variables["RYML_USE_ASSERT"] = self.options.with_assert tc.generate() deps = CMakeDeps(self) diff --git a/recipes/rapidyaml/all/patches/0.7.0-001-remove-internal-c4core.patch b/recipes/rapidyaml/all/patches/0.7.0-001-remove-internal-c4core.patch new file mode 100644 index 0000000000000..00f7a998b45ee --- /dev/null +++ b/recipes/rapidyaml/all/patches/0.7.0-001-remove-internal-c4core.patch @@ -0,0 +1,53 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 762bb97..d1bc8a7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,7 @@ project(ryml + LANGUAGES CXX) + include(./compat.cmake) + +-c4_project(VERSION 0.7.0 STANDALONE ++c4_project(VERSION 0.7.0 + AUTHOR "Joao Paulo Magalhaes ") + + +@@ -27,11 +27,11 @@ option(RYML_INSTALL "Enable install target" ON) + + #------------------------------------------------------- + +-c4_require_subproject(c4core INCORPORATE +- SUBDIRECTORY ${RYML_EXT_DIR}/c4core +- OVERRIDE C4CORE_INSTALL ${RYML_INSTALL} +-) +- ++# c4_require_subproject(c4core INCORPORATE ++# SUBDIRECTORY ${RYML_EXT_DIR}/c4core ++# OVERRIDE C4CORE_INSTALL ${RYML_INSTALL} ++# ) ++find_package(c4core REQUIRED CONFIG) + c4_add_library(ryml + SOURCES + ryml.hpp +@@ -77,10 +77,10 @@ c4_add_library(ryml + INC_DIRS + $ + $ +- LIBS c4core +- INCORPORATE c4core ++ # LIBS c4core ++ LIBS c4core::c4core ++ # INCORPORATE c4core + ) +- + if(RYML_WITH_TAB_TOKENS) + target_compile_definitions(ryml PUBLIC RYML_WITH_TAB_TOKENS) + endif() +@@ -113,7 +113,7 @@ endif() + + if(RYML_INSTALL) + c4_install_target(ryml) +- c4_install_exports(DEPENDENCIES c4core) ++# c4_install_exports(DEPENDENCIES c4core) + c4_pack_project() + endif() + diff --git a/recipes/rapidyaml/config.yml b/recipes/rapidyaml/config.yml index a10a27debb1f0..23d421955a48a 100644 --- a/recipes/rapidyaml/config.yml +++ b/recipes/rapidyaml/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.0": + folder: all "0.5.0": folder: all "0.4.1": diff --git a/recipes/raylib/all/conanfile.py b/recipes/raylib/all/conanfile.py index b00589d9af8ba..38b018aee6008 100644 --- a/recipes/raylib/all/conanfile.py +++ b/recipes/raylib/all/conanfile.py @@ -48,8 +48,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if self.settings.os != "Android": - self.requires("glfw/3.3.8") + if self.settings.os not in ["Android", "Emscripten"]: + self.requires("glfw/3.4") self.requires("opengl/system") if self.settings.os == "Linux": self.requires("xorg/system") @@ -60,6 +60,10 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_EXAMPLES"] = False + if self.settings.os == "Emscripten": + tc.variables["PLATFORM"] = "Web" + tc.variables["USE_EXTERNAL_GLFW"] = "ON" + tc.variables["OPENGL_VERSION"] = "ES 2.0" if self.settings.os == "Android": tc.variables["PLATFORM"] = "Android" tc.variables["USE_EXTERNAL_GLFW"] = "OFF" diff --git a/recipes/rdma-core/all/conandata.yml b/recipes/rdma-core/all/conandata.yml index 4d08bc2892211..30eaf3a7cd31f 100644 --- a/recipes/rdma-core/all/conandata.yml +++ b/recipes/rdma-core/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "51.0": + url: "https://github.com/linux-rdma/rdma-core/releases/download/v51.0/rdma-core-51.0.tar.gz" + sha256: "0a4a55b1351356c2750f26ec9010e8c7370402a13c95799cb8b447cf0134dd61" "49.0": url: "https://github.com/linux-rdma/rdma-core/releases/download/v49.0/rdma-core-49.0.tar.gz" sha256: "953546ad2b179f9ce68dc21eb1eb26003098ea1bf0f87a4baed45bcea134b2b4" diff --git a/recipes/rdma-core/all/conanfile.py b/recipes/rdma-core/all/conanfile.py index 99a8017855d89..c2a42528f2835 100644 --- a/recipes/rdma-core/all/conanfile.py +++ b/recipes/rdma-core/all/conanfile.py @@ -59,7 +59,7 @@ def validate(self): def build_requirements(self): if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.1.0") + self.tool_requires("pkgconf/2.2.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/rdma-core/config.yml b/recipes/rdma-core/config.yml index 14360fc69dbd2..bc069e4d0ced3 100644 --- a/recipes/rdma-core/config.yml +++ b/recipes/rdma-core/config.yml @@ -1,3 +1,5 @@ versions: + "51.0": + folder: all "49.0": folder: all diff --git a/recipes/re2/all/conandata.yml b/recipes/re2/all/conandata.yml index c28d8dfdd5d72..718ca942e6960 100644 --- a/recipes/re2/all/conandata.yml +++ b/recipes/re2/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "20240702": + url: "https://github.com/google/re2/releases/download/2024-07-02/re2-2024-07-02.tar.gz" + sha256: "eb2df807c781601c14a260a507a5bb4509be1ee626024cb45acbd57cb9d4032b" + "20240301": + url: "https://github.com/google/re2/releases/download/2024-03-01/re2-2024-03-01.tar.gz" + sha256: "7b2b3aa8241eac25f674e5b5b2e23d4ac4f0a8891418a2661869f736f03f57f4" "20231101": url: "https://github.com/google/re2/releases/download/2023-11-01/re2-2023-11-01.tar.gz" sha256: "4e6593ac3c71de1c0f322735bc8b0492a72f66ffccfad76e259fa21c41d27d8a" diff --git a/recipes/re2/all/conanfile.py b/recipes/re2/all/conanfile.py index 8d2e83b161ad9..caa9278099d00 100644 --- a/recipes/re2/all/conanfile.py +++ b/recipes/re2/all/conanfile.py @@ -62,7 +62,7 @@ def requirements(self): if self.options.get_safe("with_icu"): self.requires("icu/73.2") if Version(self.version) >= "20230601": - self.requires("abseil/20230802.1", transitive_headers=True) + self.requires("abseil/20240116.1", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/re2/config.yml b/recipes/re2/config.yml index 56ae3dda8367b..bfce54f7e636d 100644 --- a/recipes/re2/config.yml +++ b/recipes/re2/config.yml @@ -1,4 +1,8 @@ versions: + "20240702": + folder: all + "20240301": + folder: all "20231101": folder: all "20230901": diff --git a/recipes/reactiveplusplus/all/conandata.yml b/recipes/reactiveplusplus/all/conandata.yml index a8ee60a2f8197..45940f3c98c16 100644 --- a/recipes/reactiveplusplus/all/conandata.yml +++ b/recipes/reactiveplusplus/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.1": + url: "https://github.com/victimsnino/ReactivePlusPlus/archive/refs/tags/v2.1.1.tar.gz" + sha256: "0b962478d7c973a1f74062ce7f8d24c2fdcd2733031b1f014e65d252d59ebe6a" "2.0.0": url: "https://github.com/victimsnino/ReactivePlusPlus/archive/v2.0.0.tar.gz" sha256: "8950fe579aea23be1a6affd4ec8845c78016454aaf875dbae6a52d10eeb6df02" diff --git a/recipes/reactiveplusplus/config.yml b/recipes/reactiveplusplus/config.yml index feccf8f451435..f409d3e717279 100644 --- a/recipes/reactiveplusplus/config.yml +++ b/recipes/reactiveplusplus/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.1": + folder: all "2.0.0": folder: all "0.2.3": diff --git a/recipes/read-excel/all/test_package/conanfile.py b/recipes/read-excel/all/test_package/conanfile.py index bddb5e263d5d6..8a5bb47f50c4c 100644 --- a/recipes/read-excel/all/test_package/conanfile.py +++ b/recipes/read-excel/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - xls_path = os.path.join(self.source_folder, "sample.xls") - self.run("{} \"{}\"".format(bin_path, xls_path), env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/read-excel/all/test_package/sample.xls b/recipes/read-excel/all/test_package/sample.xls deleted file mode 100644 index ecf08ebffbbb9..0000000000000 Binary files a/recipes/read-excel/all/test_package/sample.xls and /dev/null differ diff --git a/recipes/read-excel/all/test_package/test_package.cpp b/recipes/read-excel/all/test_package/test_package.cpp index 847cfd34b125e..f8edcee4eecf3 100644 --- a/recipes/read-excel/all/test_package/test_package.cpp +++ b/recipes/read-excel/all/test_package/test_package.cpp @@ -6,31 +6,11 @@ int main(int argc, char ** argv) { - if (argc < 2) { - std::cerr << "Need an argument\n"; - return 1; - } - try { - Excel::Book book( argv[1] ); - - Excel::Sheet * sheet = book.sheet( 0 ); - - if(sheet->cell( 0, 0 ).getString() == L"This is a string.") - return 0; - - return 1; + Excel::Book book( "non-real-file.xls" ); } catch(const Excel::Exception &) { - return 1; - } - catch(const CompoundFile::Exception &) - { - return 1; - } - catch(const std::exception &) - { - return 1; + printf("Test\n"); } } diff --git a/recipes/read-excel/all/test_v1_package/conanfile.py b/recipes/read-excel/all/test_v1_package/conanfile.py index 3524db189d6f0..38f4483872d47 100644 --- a/recipes/read-excel/all/test_v1_package/conanfile.py +++ b/recipes/read-excel/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - xls_path = os.path.join(self.source_folder, os.pardir, "test_package", "sample.xls") - self.run("{} \"{}\"".format(bin_path, xls_path), run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/readline/all/conanfile.py b/recipes/readline/all/conanfile.py index 0c46be5b31c24..d5b233744c63a 100644 --- a/recipes/readline/all/conanfile.py +++ b/recipes/readline/all/conanfile.py @@ -11,6 +11,7 @@ required_conan_version = ">=1.53.0" + class ReadLineConan(ConanFile): name = "readline" description = "A set of functions for use by applications that allow users to edit command lines as they are typed in" @@ -18,6 +19,8 @@ class ReadLineConan(ConanFile): license = "GPL-3.0-only" homepage = "https://tiswww.case.edu/php/chet/readline/rltop.html" url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -69,6 +72,9 @@ def generate(self): ]) if cross_building(self): tc.configure_args.append("bash_cv_wcwidth_broken=yes") + + tc.configure_args.append("--disable-install-examples") + tc.generate() deps = AutotoolsDeps(self) deps.generate() diff --git a/recipes/readosm/all/conanfile.py b/recipes/readosm/all/conanfile.py index b9c849a552887..8a9b5054afef4 100644 --- a/recipes/readosm/all/conanfile.py +++ b/recipes/readosm/all/conanfile.py @@ -54,7 +54,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") self.requires("zlib/[>=1.2.11 <2]") def build_requirements(self): diff --git a/recipes/reflect-cpp/all/conandata.yml b/recipes/reflect-cpp/all/conandata.yml index e8f0dda436088..ad65b35cf4e50 100644 --- a/recipes/reflect-cpp/all/conandata.yml +++ b/recipes/reflect-cpp/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.11.1": + url: "https://github.com/getml/reflect-cpp/archive/v0.11.1.tar.gz" + sha256: "e45f112fb3f14507a4aa53b99ae2d4ab6a4e7b2d5f04dd06fec00bf7faa7bbdc" + "0.11.0": + url: "https://github.com/getml/reflect-cpp/archive/v0.11.0.tar.gz" + sha256: "85f66939608acacf66dc782529af0c5a36b7d695c55b310b10c49700251b6221" + "0.10.0": + url: "https://github.com/getml/reflect-cpp/archive/v0.10.0.tar.gz" + sha256: "d2c8876d993ddc8c57c5804e767786bdb46a2bdf1a6cd81f4b14f57b1552dfd7" "0.6.0": url: "https://github.com/getml/reflect-cpp/archive/v0.6.0.tar.gz" sha256: "D8231B91989397A67E841B56A0673FDCDF969DBE956D54BB629F14100B030664" diff --git a/recipes/reflect-cpp/all/conanfile.py b/recipes/reflect-cpp/all/conanfile.py index 4952fc02f03a6..30e94da61ba89 100644 --- a/recipes/reflect-cpp/all/conanfile.py +++ b/recipes/reflect-cpp/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.files import get, copy from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.layout import basic_layout @@ -14,7 +14,7 @@ class ReflectCppConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/getml/reflect-cpp" - topics = ("reflection", "serialization", "memory", "json", "xml", "flatbuffers", "header-only") + topics = ("reflection", "serialization", "memory", "json", "xml", "flatbuffers", "yaml", "toml", "msgpack", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { @@ -22,12 +22,14 @@ class ReflectCppConan(ConanFile): "with_xml" : [True, False], "with_flatbuffers" : [True, False], "with_yaml": [True, False], + "with_msgpack": [True, False], } default_options = { "with_json" : False, "with_xml" : False, "with_flatbuffers" : False, "with_yaml" : False, + "with_msgpack": False, } @property @@ -44,9 +46,6 @@ def _compilers_minimum_version(self): "apple-clang": "15", } - def export_sources(self): - export_conandata_patches(self) - def layout(self): basic_layout(self, src_folder="src") @@ -59,7 +58,12 @@ def requirements(self): self.requires("flatbuffers/23.5.26", transitive_headers=True) if self.options.with_yaml: self.requires("yaml-cpp/0.8.0", transitive_headers=True) - + if self.options.with_msgpack: + self.requires("msgpack-c/6.0.0", transitive_headers=True) + + if Version(self.version) >= "0.11.1": + self.requires("ctre/3.9.0", transitive_headers=True) + def package_id(self): self.info.clear() @@ -75,9 +79,6 @@ def validate(self): 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( @@ -90,3 +91,5 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + if Version(self.version) >= "0.11.1": + self.cpp_info.defines.append("REFLECTCPP_NO_BUNDLED_DEPENDENCIES") diff --git a/recipes/reflect-cpp/all/test_package/CMakeLists.txt b/recipes/reflect-cpp/all/test_package/CMakeLists.txt index 66b58d7b20ff5..767315c296e76 100644 --- a/recipes/reflect-cpp/all/test_package/CMakeLists.txt +++ b/recipes/reflect-cpp/all/test_package/CMakeLists.txt @@ -6,3 +6,7 @@ find_package(reflect-cpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE reflect-cpp::reflect-cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) + +if(CONAN_TEST_WITH_MSGPACK) + target_compile_definitions(${PROJECT_NAME} PRIVATE CONAN_TEST_WITH_MSGPACK) +endif() diff --git a/recipes/reflect-cpp/all/test_package/conanfile.py b/recipes/reflect-cpp/all/test_package/conanfile.py index a9fb96656f203..c0ce5c17be896 100644 --- a/recipes/reflect-cpp/all/test_package/conanfile.py +++ b/recipes/reflect-cpp/all/test_package/conanfile.py @@ -1,12 +1,12 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout, CMake +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" def requirements(self): @@ -14,6 +14,12 @@ def requirements(self): def layout(self): cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + if self.dependencies[self.tested_reference_str].options.with_msgpack: + tc.cache_variables["CONAN_TEST_WITH_MSGPACK"] = True + tc.generate() def build(self): cmake = CMake(self) diff --git a/recipes/reflect-cpp/all/test_package/test_package.cpp b/recipes/reflect-cpp/all/test_package/test_package.cpp index 04e4309cba5ea..ed7b54690e256 100644 --- a/recipes/reflect-cpp/all/test_package/test_package.cpp +++ b/recipes/reflect-cpp/all/test_package/test_package.cpp @@ -1,6 +1,11 @@ #include +#include #include +#if defined(CONAN_TEST_WITH_MSGPACK) + #include +#endif + struct TestStruct { int x; std::string name; @@ -11,5 +16,14 @@ int main(void) { (void) f.name(); (void) f.type(); } + +#if defined(CONAN_TEST_WITH_MSGPACK) + const auto test = TestStruct{.x = 15, .name = "test_package"}; + std::cout << "msgpack test: "; + rfl::msgpack::write(test, std::cout) << std::endl; +#endif + + std::cout << "reflect-cpp test successful\n"; + return 0; } diff --git a/recipes/reflect-cpp/all/test_v1_package/CMakeLists.txt b/recipes/reflect-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9652e22fc19d5..0000000000000 --- a/recipes/reflect-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.12) - -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/reflect-cpp/all/test_v1_package/conanfile.py b/recipes/reflect-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/reflect-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/reflect-cpp/config.yml b/recipes/reflect-cpp/config.yml index 7d9ba9dbc8ac9..1fd3a60496588 100644 --- a/recipes/reflect-cpp/config.yml +++ b/recipes/reflect-cpp/config.yml @@ -1,3 +1,9 @@ versions: + "0.11.1": + folder: all + "0.11.0": + folder: all + "0.10.0": + folder: all "0.6.0": folder: all diff --git a/recipes/resiprocate/all/conandata.yml b/recipes/resiprocate/all/conandata.yml index 30a690c6f981a..3c5856f5a74a9 100644 --- a/recipes/resiprocate/all/conandata.yml +++ b/recipes/resiprocate/all/conandata.yml @@ -1,4 +1,4 @@ sources: "1.12.0": - url: https://www.resiprocate.org/files/pub/reSIProcate/releases/resiprocate-1.12.0.tar.gz - sha256: 046826503d3c8682ae0e42101b28f903c5f988235f1ff4a98dbfb9066d0d3d49 + url: "https://github.com/resiprocate/resiprocate/archive/refs/tags/resiprocate-1.12.0.tar.gz" + sha256: "aa8906082e4221bffbfab3210df68a6ba1f57ba1532d89ea4572b4fa9877914f" diff --git a/recipes/resiprocate/all/conanfile.py b/recipes/resiprocate/all/conanfile.py index 54400194c9ba3..65f010b869c78 100644 --- a/recipes/resiprocate/all/conanfile.py +++ b/recipes/resiprocate/all/conanfile.py @@ -1,94 +1,106 @@ import os -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building +from conan.tools.env import VirtualRunEnv +from conan.tools.files import copy, get, rm, rmdir, chdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.29.1" class ResiprocateConan(ConanFile): name = "resiprocate" - description = "The project is dedicated to maintaining a complete, correct, and commercially usable implementation of SIP and a few related protocols. " - topics = ("sip", "voip", "communication", "signaling") - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://www.resiprocate.org" + description = ( + "The project is dedicated to maintaining a complete, correct, " + "and commercially usable implementation of SIP and a few related protocols." + ) license = "VSL-1.0" - settings = "os", "compiler", "build_type", "arch" - options = {"fPIC": [True, False], - "shared": [True, False], - "with_ssl": [True, False], - "with_postgresql": [True, False], - "with_mysql": [True, False]} - default_options = {"fPIC": True, - "shared": False, - "with_ssl": True, - "with_postgresql": True, - "with_mysql": True} - _autotools = None + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/resiprocate/resiprocate/wiki/" + topics = ("sip", "voip", "communication", "signaling") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": [True, False], + "with_postgresql": [True, False], + "with_mysql": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": True, + "with_postgresql": True, + "with_mysql": False, + } def config_options(self): - if self.settings.os == 'Windows': + if self.settings.os == "Windows": del self.options.fPIC def configure(self): - if self.settings.os in ("Windows", "Macos"): - # FIXME: Visual Studio project & Mac support seems available in resiprocate - raise ConanInvalidConfiguration("reSIProcate recipe does not currently support {}.".format(self.settings.os)) + if self.settings.os == "Windows" or is_apple_os(self): + # FIXME: unreleased versions of resiprocate use CMake and should support Windows and macOS + raise ConanInvalidConfiguration(f"reSIProcate recipe does not currently support {self.settings.os}.") if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_ssl: - self.requires("openssl/1.1.1q") + self.requires("openssl/1.1.1w") # OpenSSL 3.x is not supported if self.options.with_postgresql: - self.requires("libpq/14.2") + self.requires("libpq/15.4") if self.options.with_mysql: - self.requires("libmysqlclient/8.0.29") + self.requires("libmysqlclient/8.1.0") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("{}-{}".format(self.name, self.version), self._source_subfolder) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - yes_no = lambda v: "yes" if v else "no" - configure_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))) - ] + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): + if not cross_building(self): + venv = VirtualRunEnv(self) + venv.generate(scope="build") + tc = AutotoolsToolchain(self) # These options do not support yes/no if self.options.with_ssl: - configure_args.append("--with-ssl") + tc.configure_args.append("--with-ssl") if self.options.with_mysql: - configure_args.append("--with-mysql") + tc.configure_args.append("--with-mysql") if self.options.with_postgresql: - configure_args.append("--with-postgresql") - - self._autotools.configure(configure_dir=self._source_subfolder, args=configure_args) - return self._autotools + tc.configure_args.append("--with-postgresql") + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() def build(self): - autotools = self._configure_autotools() - autotools.make() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - autotools = self._configure_autotools() - autotools.install() - tools.rmdir(os.path.join(os.path.join(self.package_folder, "share"))) - tools.remove_files_by_mask(os.path.join(self.package_folder), "*.la") + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(os.path.join(self.package_folder, "share"))) + rm(self, "*.la", os.path.join(self.package_folder), recursive=True) def package_info(self): self.cpp_info.libs = ["resip", "rutil", "dum", "resipares"] if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.system_libs = ["pthread"] + + # TODO: Legacy, to be removed on Conan 2.0 bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.PATH.append(bin_path) diff --git a/recipes/resiprocate/all/test_package/CMakeLists.txt b/recipes/resiprocate/all/test_package/CMakeLists.txt index 33ae887aa6aea..9a3b67fc7fe91 100644 --- a/recipes/resiprocate/all/test_package/CMakeLists.txt +++ b/recipes/resiprocate/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(resiprocate REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE resiprocate::resiprocate) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/resiprocate/all/test_package/conanfile.py b/recipes/resiprocate/all/test_package/conanfile.py index ea57a464900be..ef5d7042163ec 100644 --- a/recipes/resiprocate/all/test_package/conanfile.py +++ b/recipes/resiprocate/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/resiprocate/all/test_v1_package/CMakeLists.txt b/recipes/resiprocate/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/resiprocate/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/resiprocate/all/test_v1_package/conanfile.py b/recipes/resiprocate/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..84ee68733e516 --- /dev/null +++ b/recipes/resiprocate/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/ring-span-lite/all/conandata.yml b/recipes/ring-span-lite/all/conandata.yml index ecb24a4b876e4..4919bacb7f2d0 100644 --- a/recipes/ring-span-lite/all/conandata.yml +++ b/recipes/ring-span-lite/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.0": + url: "https://github.com/martinmoene/ring-span-lite/archive/v0.7.0.tar.gz" + sha256: "7650bb1bcf76cb0f7ac75240c5346203cbe7eb7027c0843c60253f6db08a93c1" "0.6.0": url: "https://github.com/martinmoene/ring-span-lite/archive/v0.6.0.tar.gz" sha256: "3248ee40a3147e6ba3cee051a838f727770654ade0c9852b1640f0f40d2e0573" diff --git a/recipes/ring-span-lite/all/conanfile.py b/recipes/ring-span-lite/all/conanfile.py index 91e2240703f2a..fa9939f4bd005 100644 --- a/recipes/ring-span-lite/all/conanfile.py +++ b/recipes/ring-span-lite/all/conanfile.py @@ -8,12 +8,13 @@ class RingSpanLiteConan(ConanFile): name = "ring-span-lite" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/martinmoene/ring-span-lite" description = ( "ring-span lite - A ring_span type for C++98, C++11 and later in a single-file header-only library ") - topics = ("cpp98", "cpp11", "cpp14", "cpp17", "ring-span") license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/ring-span-lite" + topics = ("cpp98", "cpp11", "cpp14", "cpp17", "ring-span", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -24,11 +25,7 @@ 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) - - def build(self): - pass + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), diff --git a/recipes/ring-span-lite/all/test_package/conanfile.py b/recipes/ring-span-lite/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/ring-span-lite/all/test_package/conanfile.py +++ b/recipes/ring-span-lite/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/ring-span-lite/config.yml b/recipes/ring-span-lite/config.yml index babcbfb79d964..a0804c43130f1 100644 --- a/recipes/ring-span-lite/config.yml +++ b/recipes/ring-span-lite/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.0": + folder: all "0.6.0": folder: all "0.5.0": diff --git a/recipes/rmm/all/conandata.yml b/recipes/rmm/all/conandata.yml index 67683994d5b6f..31ecfbfa6c6ef 100644 --- a/recipes/rmm/all/conandata.yml +++ b/recipes/rmm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "24.04.00": + url: "https://github.com/rapidsai/rmm/archive/v24.04.00a.tar.gz" + sha256: "47a5d28a99165fc6e1f02399e0cc8b304f5bbc9aaf2071288ae92638ecdf516c" "23.10.00": url: "https://github.com/rapidsai/rmm/archive/v23.10.00.tar.gz" sha256: "4e2408073662fdfd92ca21d87f7d2afc64d2595fd5a1e3fa321d3472cfbd7f7a" diff --git a/recipes/rmm/all/conanfile.py b/recipes/rmm/all/conanfile.py index ca0e3861927c1..91388dbe02f58 100644 --- a/recipes/rmm/all/conanfile.py +++ b/recipes/rmm/all/conanfile.py @@ -42,8 +42,8 @@ def layout(self): def requirements(self): self.requires("thrust/1.17.2") - self.requires("spdlog/1.12.0") - self.requires("fmt/10.1.1") + self.requires("spdlog/1.13.0") + self.requires("fmt/10.2.1") def package_id(self): self.info.clear() diff --git a/recipes/rmm/config.yml b/recipes/rmm/config.yml index 20cd4f56dc99f..396bbc9cfd497 100644 --- a/recipes/rmm/config.yml +++ b/recipes/rmm/config.yml @@ -1,4 +1,6 @@ versions: + "24.04.00": + folder: all "23.10.00": folder: all "23.06.00": diff --git a/recipes/roaring/all/conandata.yml b/recipes/roaring/all/conandata.yml index edc3ffb72f6d6..610e2569247a2 100644 --- a/recipes/roaring/all/conandata.yml +++ b/recipes/roaring/all/conandata.yml @@ -1,40 +1,25 @@ sources: + "4.1.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.1.0.tar.gz" + sha256: "0596c6e22bcccb56f38260142b435f1f72aef7721fa370fd9f2b88380245fc1d" + "4.0.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.0.0.tar.gz" + sha256: "a8b98db3800cd10979561a1388e4e970886a24015bd6cfabb08ba7917f541b0d" + "3.0.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v3.0.0.tar.gz" + sha256: "25183bc54ab650d964256d547869a34573a13d06f7e6a369b79e77f5c1feb8ba" "2.1.2": url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v2.1.2.tar.gz" sha256: "a53d2f540f78ddae31e30c573b1b7fd41d7257d6a090507ba35d9c398712e5ad" - "2.1.1": - url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v2.1.1.tar.gz" - sha256: "40a1c04e220bb2305c3adb5347f42b6b435c4bb4ac89dd0047ba8e73a7388dfb" - "2.1.0": - url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v2.1.0.tar.gz" - sha256: "75e2c106bf3c035f92560017b56b01602744b643a3fef08d69255c138c6c6f5c" "2.0.4": url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v2.0.4.tar.gz" sha256: "3c962c196ba28abf2639067f2e2fd25879744ba98152a4e0e74556ca515eda33" - "2.0.2": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v2.0.2.tar.gz" - sha256: "92636a931f8a7bf36ce5a96d3039db128afd0e075f5aa7936fa1685dd2bbc75b" "1.3.0": url: "https://github.com/RoaringBitmap/CRoaring/archive/v1.3.0.tar.gz" sha256: "c4fccf6a8cfa6f15f47d0e6f6b202940c2305e3078eb745d25fe9e2739ae5278" "1.1.5": url: "https://github.com/RoaringBitmap/CRoaring/archive/v1.1.5.tar.gz" sha256: "5210a277ce83c3099dfee41d494c28aec61bdbc9160b3b124cb5afeab49cd123" - "1.1.2": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v1.1.2.tar.gz" - sha256: "545fab4f00d946000743c563b3c315c1a11cee1f19c6ba4fb9493824a4e68b9a" - "1.1.0": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v1.1.0.tar.gz" - sha256: "b59495578e3e4790a216420ce70578d22c1b6d1987232fc2bf46463a03fb1c06" "1.0.0": url: "https://github.com/RoaringBitmap/CRoaring/archive/v1.0.0.tar.gz" sha256: "08f884cd2790fcfba69b63443442034702f5d4865514fb09ac6ff05e048bf230" - "0.9.9": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.9.9.tar.gz" - sha256: "3083bcbc37e43403111c482ddf317a710972256c23bc83abc8925803a02bdf60" - "0.8.1": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.8.1.tar.gz" - sha256: "5359f2a051f10e42cea5edc3cb3650fd272e9125e6a0538901cf30619939d4f8" - "0.7.3": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.7.3.tar.gz" - sha256: "e3f8115ba44ef0e1eb7b982dc3c3233f08f5f95ec1260169c2ad0ca50e56b656" diff --git a/recipes/roaring/config.yml b/recipes/roaring/config.yml index cc4a150b9e961..4c7b26e41f0a9 100644 --- a/recipes/roaring/config.yml +++ b/recipes/roaring/config.yml @@ -1,27 +1,17 @@ versions: - "2.1.2": + "4.1.0": folder: all - "2.1.1": + "4.0.0": folder: all - "2.1.0": + "3.0.0": folder: all - "2.0.4": + "2.1.2": folder: all - "2.0.2": + "2.0.4": folder: all "1.3.0": folder: all "1.1.5": folder: all - "1.1.2": - folder: all - "1.1.0": - folder: all "1.0.0": folder: all - "0.9.9": - folder: all - "0.8.1": - folder: all - "0.7.3": - folder: all diff --git a/recipes/rocket/all/conandata.yml b/recipes/rocket/all/conandata.yml new file mode 100644 index 0000000000000..03683863693df --- /dev/null +++ b/recipes/rocket/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "cci.20200603": + url: "https://github.com/tripleslash/rocket/archive/348869fcda83f8b8b521c7654f83fea07ebe7a0a.tar.gz" + sha256: "de03b9c7f9b9478cfaa60683f95a7b0773dc0929d14e510c23f53b3804cc921f" +patches: + "cci.20200603": + - patch_file: "patches/0001-fix-thread_id.patch" + patch_description: "Fix compilation on different C++ std versions" + patch_type: "backport" + patch_source: "https://github.com/tripleslash/rocket/issues/10" diff --git a/recipes/rocket/all/conanfile.py b/recipes/rocket/all/conanfile.py new file mode 100644 index 0000000000000..7e395c84d11ae --- /dev/null +++ b/recipes/rocket/all/conanfile.py @@ -0,0 +1,72 @@ +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, load, save +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class RocketConan(ConanFile): + name = "rocket" + description = "Fast single header signal/slots library for C++" + license = "DocumentRef-README.md:LicenseRef-Rocket-public-domain" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tripleslash/rocket" + topics = ("signal-slots", "observer-pattern", "header-only") + package_type = "header-library" + settings = "os", "compiler", "build_type", "arch" + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "6", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + def export_sources(self): + export_conandata_patches(self) + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package_id(self): + self.info.clear() + + def build(self): + apply_conandata_patches(self) + + def _extract_license(self): + readme_content = load(self, os.path.join(self.source_folder, "README.md")) + first = readme_content.find("# rocket") + last = readme_content.find("signals2).") + license_content = readme_content[first:last+len("signals2).")] + # Make sure the extracted text from README has the license type + assert license_content.find("public-domain") != -1 + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_content) + + def package(self): + self._extract_license() + copy(self, "rocket.hpp", self.build_folder, os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + diff --git a/recipes/rocket/all/patches/0001-fix-thread_id.patch b/recipes/rocket/all/patches/0001-fix-thread_id.patch new file mode 100644 index 0000000000000..793c870ed12dc --- /dev/null +++ b/recipes/rocket/all/patches/0001-fix-thread_id.patch @@ -0,0 +1,16 @@ +diff --git a/rocket.hpp b/rocket.hpp +index 8c4e539..47d650a 100644 +--- a/rocket.hpp ++++ b/rocket.hpp +@@ -2082,8 +2082,8 @@ namespace rocket + + bool is_queued() const ROCKET_NOEXCEPT + { +- return thread_id != std::thread::id{} +- && thread_id != std::this_thread::get_id(); ++ return !(thread_id == std::thread::id{}) ++ && !(thread_id == std::this_thread::get_id()); + } + + #ifndef ROCKET_NO_BLOCKING_CONNECTIONS + diff --git a/recipes/rocket/all/test_package/CMakeLists.txt b/recipes/rocket/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6555535f21daa --- /dev/null +++ b/recipes/rocket/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(rocket REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rocket::rocket) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/rocket/all/test_package/conanfile.py b/recipes/rocket/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b4c8de77c89d8 --- /dev/null +++ b/recipes/rocket/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 RocketTestConan(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/rocket/all/test_package/test_package.cpp b/recipes/rocket/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..33702a87e060d --- /dev/null +++ b/recipes/rocket/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include + +int main() +{ + rocket::signal test; + test.connect([](int x) + { return x * 3; }); + + constexpr int value = 2; + + const auto result{test(value) == value * 3}; + std::cout << "Rocket test success: " << std::boolalpha << result << '\n'; + return result? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/recipes/rocket/config.yml b/recipes/rocket/config.yml new file mode 100644 index 0000000000000..0496cb4bde798 --- /dev/null +++ b/recipes/rocket/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200603": + folder: "all" diff --git a/recipes/rocksdb/all/conandata.yml b/recipes/rocksdb/all/conandata.yml index d4cc95fcc067b..9311e262a5a90 100644 --- a/recipes/rocksdb/all/conandata.yml +++ b/recipes/rocksdb/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "9.2.1": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v9.2.1.tar.gz" + sha256: "bb20fd9a07624e0dc1849a8e65833e5421960184f9c469d508b58ed8f40a780f" + "9.1.0": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v9.1.0.tar.gz" + sha256: "3c225e45bf6f6367cf5a4413f71abc4a3427627790e6d58c57adc2daa4b6309d" + "9.0.0": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v9.0.0.tar.gz" + sha256: "013aac178aa12837cbfa3b1e20e9e91ff87962ab7fdd044fd820e859f8964f9b" + "8.8.1": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v8.8.1.tar.gz" + sha256: "056c7e21ad8ae36b026ac3b94b9d6e0fcc60e1d937fc80330921e4181be5c36e" "6.29.5": url: "https://github.com/facebook/rocksdb/archive/refs/tags/v6.29.5.tar.gz" sha256: "ddbf84791f0980c0bbce3902feb93a2c7006f6f53bfd798926143e31d4d756f0" @@ -8,9 +20,6 @@ sources: "6.20.3": url: "https://github.com/facebook/rocksdb/archive/refs/tags/v6.20.3.tar.gz" sha256: "c6502c7aae641b7e20fafa6c2b92273d935d2b7b2707135ebd9a67b092169dca" - "8.8.1": - url: "https://github.com/facebook/rocksdb/archive/refs/tags/v8.8.1.tar.gz" - sha256: "056c7e21ad8ae36b026ac3b94b9d6e0fcc60e1d937fc80330921e4181be5c36e" patches: "6.29.5": - patch_file: "patches/6.29.5-0001-add-include-cstdint-for-gcc-13.patch" diff --git a/recipes/rocksdb/all/conanfile.py b/recipes/rocksdb/all/conanfile.py index 09425b9f86390..f9abafa35f177 100644 --- a/recipes/rocksdb/all/conanfile.py +++ b/recipes/rocksdb/all/conanfile.py @@ -163,6 +163,8 @@ def generate(self): if self.options.with_jemalloc: deps.set_property("jemalloc", "cmake_file_name", "JeMalloc") deps.set_property("jemalloc", "cmake_target_name", "JeMalloc::JeMalloc") + if self.options.with_zstd: + deps.set_property("zstd", "cmake_target_name", "zstd::zstd") deps.generate() def build(self): diff --git a/recipes/rocksdb/config.yml b/recipes/rocksdb/config.yml index 3691365f4f4a3..1e0d22057397b 100644 --- a/recipes/rocksdb/config.yml +++ b/recipes/rocksdb/config.yml @@ -1,9 +1,15 @@ versions: + "9.2.1": + folder: all + "9.1.0": + folder: all + "9.0.0": + folder: all + "8.8.1": + folder: all "6.29.5": folder: all "6.27.3": folder: all "6.20.3": folder: all - "8.8.1": - folder: all diff --git a/recipes/rotor/all/conandata.yml b/recipes/rotor/all/conandata.yml index 1b4efa7d91b72..4119e3f61f535 100644 --- a/recipes/rotor/all/conandata.yml +++ b/recipes/rotor/all/conandata.yml @@ -1,19 +1,22 @@ sources: - "0.21": - url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.21.tar.gz" - sha256: "1a5bc1919fe1052c8ad148707708b19fad903ff3db33015710cfb4f89baab8fa" - "0.23": - url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.23.tar.gz" - sha256: "8f89f9d0a561ab7cc90253cc761d8b5a78887c99ef488e75ae4c49abb44ddac4" - "0.24": - url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.24.tar.gz" - sha256: "3a360d6ce7c743b740b9c6c4063493f67298690fc51e29efa19811bb3d11fa86" - "0.25": - url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.25.tar.gz" - sha256: "b1de95937adb8d7a9beb93bc4956d8e28ff64a6c0a898e7ce12b22a224bb8f6f" - "0.28": - url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.28.tar.gz" - sha256: "9fc7d1721379adca228ca45d0240b5a0060c993de984f0288c9e4b9cf667b971" + "0.30": + url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.30.tar.gz" + sha256: "d143bfce1d18d42ab0f072acfe239d1cc07a495411537579e02260673cbe8121" "0.29": url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.29.tar.gz" sha256: "e17e25f2d6402389e8fde07a158ca952b815666f0a2b5e07748dfc062834c522" + "0.28": + url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.28.tar.gz" + sha256: "9fc7d1721379adca228ca45d0240b5a0060c993de984f0288c9e4b9cf667b971" + "0.25": + url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.25.tar.gz" + sha256: "b1de95937adb8d7a9beb93bc4956d8e28ff64a6c0a898e7ce12b22a224bb8f6f" + "0.24": + url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.24.tar.gz" + sha256: "3a360d6ce7c743b740b9c6c4063493f67298690fc51e29efa19811bb3d11fa86" + "0.23": + url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.23.tar.gz" + sha256: "8f89f9d0a561ab7cc90253cc761d8b5a78887c99ef488e75ae4c49abb44ddac4" + "0.21": + url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.21.tar.gz" + sha256: "1a5bc1919fe1052c8ad148707708b19fad903ff3db33015710cfb4f89baab8fa" diff --git a/recipes/rotor/all/conanfile.py b/recipes/rotor/all/conanfile.py index ab2f66e84b836..e7aca39a8475a 100644 --- a/recipes/rotor/all/conanfile.py +++ b/recipes/rotor/all/conanfile.py @@ -24,6 +24,7 @@ class RotorConan(ConanFile): "enable_thread": [True, False], "multithreading": [True, False], # enables multithreading support "enable_ev": [True, False], + "enable_fltk": [True, False], } default_options = { "fPIC": True, @@ -32,6 +33,7 @@ class RotorConan(ConanFile): "enable_thread": False, "multithreading": True, "enable_ev": False, + "enable_fltk": False, } @property @@ -56,6 +58,8 @@ def config_options(self): del self.options.fPIC if Version(self.version) < "0.26": del self.options.enable_ev + if Version(self.version) < "0.30": + del self.options.enable_fltk def configure(self): if self.options.shared: @@ -65,6 +69,8 @@ def requirements(self): self.requires("boost/1.84.0", transitive_headers=True) if self.options.get_safe("enable_ev", False): self.requires("libev/4.33") + if self.options.get_safe("enable_fltk", False): + self.requires("fltk/1.3.9") def layout(self): cmake_layout(self, src_folder="src") @@ -77,6 +83,8 @@ def generate(self): tc.variables["BUILD_TESTING"] = False if Version(self.version) >= "0.26": tc.variables["BUILD_EV"] = self.options.enable_ev + if Version(self.version) >= "0.30": + tc.variables["BUILD_FLTK"] = self.options.enable_fltk tc.generate() tc = CMakeDeps(self) tc.generate() @@ -126,3 +134,10 @@ def package_info(self): if self.options.get_safe("enable_ev", False): self.cpp_info.components["ev"].libs = ["rotor_ev"] self.cpp_info.components["ev"].requires = ["core", "libev::libev"] + + if self.options.get_safe("enable_fltk", False): + self.cpp_info.components["fltk"].libs = ["rotor_fltk"] + self.cpp_info.components["fltk"].requires = ["core", "fltk::fltk"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["core"].system_libs.append("m") diff --git a/recipes/rotor/config.yml b/recipes/rotor/config.yml index b66cf5d118ce8..706ccf0a88afa 100644 --- a/recipes/rotor/config.yml +++ b/recipes/rotor/config.yml @@ -1,13 +1,15 @@ versions: - "0.21": + "0.30": folder: all - "0.23": + "0.29": folder: all - "0.24": + "0.28": folder: all "0.25": folder: all - "0.28": + "0.24": folder: all - "0.29": + "0.23": + folder: all + "0.21": folder: all diff --git a/recipes/rtmidi/all/conandata.yml b/recipes/rtmidi/all/conandata.yml index 7f688e03dcce4..ad84f3a29f6e6 100644 --- a/recipes/rtmidi/all/conandata.yml +++ b/recipes/rtmidi/all/conandata.yml @@ -1,12 +1,18 @@ sources: "6.0.0": - url: "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-6.0.0.tar.gz" + url: + - "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-6.0.0.tar.gz" + - "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-6.0.0.tar.gz" sha256: "5960ccf64b42c23400720ccc880e2f205677ce9457f747ef758b598acd64db5b" "5.0.0": - url: "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-5.0.0.tar.gz" + url: + - "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-5.0.0.tar.gz" + - "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-5.0.0.tar.gz" sha256: "48db0ed58c8c0e207b5d7327a0210b5bcaeb50e26387935d02829239b0f3c2b9" "4.0.0": - url: "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz" + url: + - "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz" + - "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz" sha256: "370cfe710f43fbeba8d2b8c8bc310f314338c519c2cf2865e2d2737b251526cd" patches: "4.0.0": diff --git a/recipes/runtimeqml/all/conanfile.py b/recipes/runtimeqml/all/conanfile.py index 8ed18efdf54c9..cae0fb3d308bb 100644 --- a/recipes/runtimeqml/all/conanfile.py +++ b/recipes/runtimeqml/all/conanfile.py @@ -41,8 +41,7 @@ def _compilers_minimum_version(self): } def export_sources(self): - copy(self, "CMakeLists.txt", self.recipe_folder, - self.export_sources_folder) + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -50,19 +49,16 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") def layout(self): - cmake_layout(self) + cmake_layout(self, src_folder="src") def requirements(self): if Version(self.version) <= "cci.20211220": - self.requires("qt/5.15.5") + self.requires("qt/5.15.13") else: - self.requires("qt/6.3.1") + self.requires("qt/6.6.2") def validate(self): if self.info.settings.compiler.cppstd: @@ -81,8 +77,7 @@ def validate(self): f"{self.ref} requires option qt:qtdeclarative=True") def source(self): - get(self, **self.conan_data["sources"][str(self.version)], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][str(self.version)], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/s2let/all/CMakeLists.txt b/recipes/s2let/all/CMakeLists.txt deleted file mode 100644 index 0496b29838549..0000000000000 --- a/recipes/s2let/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/s2let/all/conandata.yml b/recipes/s2let/all/conandata.yml index 93e1e80ecc199..9a04386d3631c 100644 --- a/recipes/s2let/all/conandata.yml +++ b/recipes/s2let/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.6": + url: "https://github.com/astro-informatics/s2let/archive/v2.2.6.tar.gz" + sha256: "0ce214e110305fdd3729875add515ca00c23dde3329af43d1fff763514607381" "2.2.3": url: "https://github.com/astro-informatics/s2let/archive/refs/tags/v2.2.3.tar.gz" sha256: "1321e1bc96ba200e4cd4056843cd4075de1c05be20e64185f065f48b9cefe3f8" diff --git a/recipes/s2let/all/conanfile.py b/recipes/s2let/all/conanfile.py index 1fc2aa8dc0cd5..a68602d8d89c3 100644 --- a/recipes/s2let/all/conanfile.py +++ b/recipes/s2let/all/conanfile.py @@ -1,17 +1,24 @@ -from conans import CMake, 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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rm +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class S2let(ConanFile): name = "s2let" + description = "Fast wavelets on the sphere" license = "GPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/astro-informatics/s2let" - description = "Fast wavelets on the sphere" - settings = "os", "arch", "compiler", "build_type" topics = ("physics", "astrophysics", "radio interferometry") + + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], "with_cfitsio": [True, False], @@ -20,62 +27,50 @@ class S2let(ConanFile): "fPIC": True, "with_cfitsio": False, } - generators = "cmake", "cmake_find_package" - exports_sources = ["CMakeLists.txt"] - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + 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("astro-informatics-so3/1.3.4") + self.requires("astro-informatics-so3/1.3.6", transitive_headers=True, transitive_libs=True) if self.options.with_cfitsio: - self.requires("cfitsio/3.490") + self.requires("cfitsio/4.3.1") def validate(self): - if self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration( - "S2LET requires C99 support for complex numbers." - ) + if is_msvc(self): + raise ConanInvalidConfiguration("S2LET requires C99 support for complex numbers.") 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) - @property - def _cmake(self): - if not hasattr(self, "_cmake_instance"): - self._cmake_instance = CMake(self) - self._cmake_instance.definitions["BUILD_TESTING"] = False - self._cmake_instance.definitions["cfitsio"] = self.options.with_cfitsio - self._cmake_instance.configure(build_folder=self._build_subfolder) - return self._cmake_instance + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["cfitsio"] = self.options.with_cfitsio + tc.generate() + tc = CMakeDeps(self) + tc.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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rm(self, "*.cmake", self.package_folder, recursive=True) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "s2let" - self.cpp_info.names["cmake_find_package_multi"] = "s2let" self.cpp_info.libs = ["s2let"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] diff --git a/recipes/s2let/all/test_package/CMakeLists.txt b/recipes/s2let/all/test_package/CMakeLists.txt index 87839a22ea4e7..d0ee79e2b9187 100644 --- a/recipes/s2let/all/test_package/CMakeLists.txt +++ b/recipes/s2let/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(s2let REQUIRED NO_MODULE) +find_package(s2let REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.c) target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) diff --git a/recipes/s2let/all/test_package/conanfile.py b/recipes/s2let/all/test_package/conanfile.py index abcaeed3f89b6..ef5d7042163ec 100644 --- a/recipes/s2let/all/test_package/conanfile.py +++ b/recipes/s2let/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/s2let/all/test_v1_package/CMakeLists.txt b/recipes/s2let/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/s2let/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/s2let/all/test_v1_package/conanfile.py b/recipes/s2let/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..abcaeed3f89b6 --- /dev/null +++ b/recipes/s2let/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/s2let/config.yml b/recipes/s2let/config.yml index a0d8538280848..880dc7c80ba70 100644 --- a/recipes/s2let/config.yml +++ b/recipes/s2let/config.yml @@ -1,3 +1,5 @@ versions: + "2.2.6": + folder: all "2.2.3": folder: all diff --git a/recipes/s2n/all/conandata.yml b/recipes/s2n/all/conandata.yml index 23e77bed0050e..5b8f0f1c01b2c 100644 --- a/recipes/s2n/all/conandata.yml +++ b/recipes/s2n/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.4.16": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.4.1.tar.gz" + sha256: "d8c1d8e1142441412434feacb4947ce6430a244dcd8f58921af79b29bd901731" + "1.4.13": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.4.13.tar.gz" + sha256: "8b0b36697963d6752e5a1b49e28e393605990d348edf1aef6f39c33164d45edb" "1.4.1": url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.4.1.tar.gz" sha256: "d8c1d8e1142441412434feacb4947ce6430a244dcd8f58921af79b29bd901731" diff --git a/recipes/s2n/config.yml b/recipes/s2n/config.yml index 516ed15f07d2b..c02d8ff3f44d9 100644 --- a/recipes/s2n/config.yml +++ b/recipes/s2n/config.yml @@ -1,4 +1,8 @@ versions: + "1.4.16": + folder: all + "1.4.13": + folder: all "1.4.1": folder: all "1.4.0": diff --git a/recipes/sail/all/conandata.yml b/recipes/sail/all/conandata.yml index 999f5e67c9331..0afb569405de9 100644 --- a/recipes/sail/all/conandata.yml +++ b/recipes/sail/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.9.5": + url: "https://github.com/HappySeaFox/sail/archive/v0.9.5.tar.gz" + sha256: "28c601c0399be1940710afc150b5836f8b3f5f6a35b98d7ac1467e62bc568e20" + "0.9.4": + url: "https://github.com/HappySeaFox/sail/archive/v0.9.4.tar.gz" + sha256: "9a8b93c15c4a1afe07c760d2087895a18626034f55917f333aaabe9c9704438f" "0.9.1": url: "https://github.com/HappySeaFox/sail/archive/v0.9.1.tar.gz" sha256: "d02ce889b70d9e237b64806df26b044753e3edf3e87c8af42c32ec9968133a88" diff --git a/recipes/sail/all/conanfile.py b/recipes/sail/all/conanfile.py index 7651e9b295a4e..13e75918fc7c2 100644 --- a/recipes/sail/all/conanfile.py +++ b/recipes/sail/all/conanfile.py @@ -56,7 +56,7 @@ def configure(self): def requirements(self): if self.options.with_highest_priority_codecs: - self.requires("giflib/5.2.1") + self.requires("giflib/5.2.2") self.requires("libjpeg/9e") self.requires("libpng/[>=1.6 <2]") self.requires("libtiff/4.6.0") @@ -64,12 +64,12 @@ def requirements(self): if Version(self.version) >= "0.9.1": self.requires("nanosvg/cci.20231025") if self.options.with_medium_priority_codecs: - self.requires("libavif/1.0.3") - self.requires("jasper/4.1.1") + self.requires("libavif/1.0.4") + self.requires("jasper/4.2.0") # TODO Re-enable JPEG XL after merging either of the following: # - https://github.com/conan-io/conan-center-index/pull/13898 # - https://github.com/conan-io/conan-center-index/pull/18812 - # self.requires("libjxl/0.6.1") + # self.requires("libjxl/0.10.2") self.requires("libwebp/1.3.2") def layout(self): diff --git a/recipes/sail/all/test_package/CMakeLists.txt b/recipes/sail/all/test_package/CMakeLists.txt index 79614592c76dc..cb86fe79928de 100644 --- a/recipes/sail/all/test_package/CMakeLists.txt +++ b/recipes/sail/all/test_package/CMakeLists.txt @@ -11,10 +11,8 @@ find_package(Sail REQUIRED CONFIG) # C API add_executable(test_package_c test_package.c) -target_compile_definitions(test_package_c PRIVATE SAIL_DEMO_FILE_PATH="${CMAKE_CURRENT_SOURCE_DIR}/bmp.bmp") target_link_libraries(test_package_c PRIVATE SAIL::Sail) # C++ API add_executable(test_package_cxx test_package.cpp) -target_compile_definitions(test_package_cxx PRIVATE SAIL_DEMO_FILE_PATH="${CMAKE_CURRENT_SOURCE_DIR}/bmp.bmp") target_link_libraries(test_package_cxx PRIVATE SAIL::SailC++) diff --git a/recipes/sail/all/test_package/bmp.bmp b/recipes/sail/all/test_package/bmp.bmp deleted file mode 100644 index 74d4973a3b13c..0000000000000 Binary files a/recipes/sail/all/test_package/bmp.bmp and /dev/null differ diff --git a/recipes/sail/all/test_package/conanfile.py b/recipes/sail/all/test_package/conanfile.py index 00e3064a021c0..fb321506e5e83 100644 --- a/recipes/sail/all/test_package/conanfile.py +++ b/recipes/sail/all/test_package/conanfile.py @@ -3,6 +3,7 @@ from conan.tools.cmake import CMake, cmake_layout import os + class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" diff --git a/recipes/sail/all/test_package/test_package.c b/recipes/sail/all/test_package/test_package.c index eba9d786722c4..59c23fda941fb 100644 --- a/recipes/sail/all/test_package/test_package.c +++ b/recipes/sail/all/test_package/test_package.c @@ -1,26 +1,9 @@ #include - +#include #include -int main(int argc, char *argv[]) -{ - (void)argc; - (void)argv; - +int main() { struct sail_image *image; - - SAIL_TRY_OR_EXECUTE(sail_load_from_file(SAIL_DEMO_FILE_PATH, &image), - /* on error */ return 1); - - printf("Size: %ux%u, bytes per line: %u, " - "pixel format: %s, pixels: %p\n", - image->width, - image->height, - image->bytes_per_line, - sail_pixel_format_to_string(image->pixel_format), - image->pixels); - - sail_destroy_image(image); - - return 0; + sail_status_t status = sail_load_from_file("binary-file.bmp", &image); + printf("Error - file not found generate: status %d\n", status); } diff --git a/recipes/sail/all/test_package/test_package.cpp b/recipes/sail/all/test_package/test_package.cpp index efad1f9a8c2e3..918cafc9fb33d 100644 --- a/recipes/sail/all/test_package/test_package.cpp +++ b/recipes/sail/all/test_package/test_package.cpp @@ -4,25 +4,13 @@ int main(int argc, char *argv[]) { - (void)argc; - (void)argv; - - const sail::image image(SAIL_DEMO_FILE_PATH); - - if (!image.is_valid()) { - return 1; + const char* filename = "my-binary.bmp"; + try { + const sail::image image(filename); + std::cout << "Size: " << image.width() << std::endl; // Never reached + } catch (const std::exception& e) { + std::cerr << "Error - file not found generate: " << e.what() << std::endl; } - std::cout - << "Size: " - << image.width() << 'x' << image.height() - << ", bytes per line: " - << image.bytes_per_line() - << ", pixel format: " - << sail::image::pixel_format_to_string(image.pixel_format()) - << ", pixels: " - << image.pixels() - << std::endl; - return 0; } diff --git a/recipes/sail/all/test_v1_package/bmp.bmp b/recipes/sail/all/test_v1_package/bmp.bmp deleted file mode 100644 index 74d4973a3b13c..0000000000000 Binary files a/recipes/sail/all/test_v1_package/bmp.bmp and /dev/null differ diff --git a/recipes/sail/config.yml b/recipes/sail/config.yml index 4f3643b98f32b..5d13176650afe 100644 --- a/recipes/sail/config.yml +++ b/recipes/sail/config.yml @@ -1,4 +1,8 @@ versions: + "0.9.5": + folder: all + "0.9.4": + folder: all "0.9.1": folder: all "0.9.0": diff --git a/recipes/samurai/all/conandata.yml b/recipes/samurai/all/conandata.yml index b4ff07102a673..a3cf7b7eb4b88 100644 --- a/recipes/samurai/all/conandata.yml +++ b/recipes/samurai/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.13.0": + url: "https://github.com/hpc-maths/samurai/archive/v0.13.0.tar.gz" + sha256: "f38e379218b1206fc5c5e157ee5e80687721a896f70b892623d9f30280529448" "0.9.0": url: "https://github.com/hpc-maths/samurai/archive/v0.9.0.tar.gz" sha256: "49f94a7451b1b50cab335a62e294e612fea27cbf5b131827eb69a8e228ad8010" diff --git a/recipes/samurai/all/conanfile.py b/recipes/samurai/all/conanfile.py index 9bbf83edd6985..a025722b58547 100644 --- a/recipes/samurai/all/conanfile.py +++ b/recipes/samurai/all/conanfile.py @@ -43,8 +43,8 @@ def requirements(self): self.requires("fmt/10.1.1") self.requires("highfive/2.7.1") self.requires("pugixml/1.14") - self.requires("xsimd/11.1.0") - self.requires("xtensor/0.24.6") + self.requires("xsimd/12.0.0") + self.requires("xtensor/0.24.7") def package_id(self): self.info.clear() diff --git a/recipes/samurai/config.yml b/recipes/samurai/config.yml index b54c9224b6c19..e6692765cde8a 100644 --- a/recipes/samurai/config.yml +++ b/recipes/samurai/config.yml @@ -1,4 +1,6 @@ versions: + "0.13.0": + folder: all "0.9.0": folder: all "0.8.0": diff --git a/recipes/sbepp/all/conandata.yml b/recipes/sbepp/all/conandata.yml index 2993d854f596e..e2b77352008d8 100644 --- a/recipes/sbepp/all/conandata.yml +++ b/recipes/sbepp/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.4.0": + url: "https://github.com/OleksandrKvl/sbepp/archive/refs/tags/1.4.0.tar.gz" + sha256: "64112ed22d6c82debc70a4c097f3fcd05a4bd280dca7e2013edbd6bebfd1da56" + "1.3.0": + url: "https://github.com/OleksandrKvl/sbepp/archive/refs/tags/1.3.0.tar.gz" + sha256: "44caa61681c7f94c840a2f2a247a0385e9e61c6e8639b9f7561c9d62125f9486" "1.2.0": url: "https://github.com/OleksandrKvl/sbepp/archive/refs/tags/1.2.0.tar.gz" sha256: "068cb8bc940316f8817af8da5c8de577ab49281308b2125c30f2f4e00431a68a" diff --git a/recipes/sbepp/all/conanfile.py b/recipes/sbepp/all/conanfile.py index f1cab17bf2649..85e391e2ff327 100644 --- a/recipes/sbepp/all/conanfile.py +++ b/recipes/sbepp/all/conanfile.py @@ -37,7 +37,7 @@ def _min_cppstd(self): def _compilers_minimum_version(self): if self.options.with_sbeppc: return { - "gcc": "9", + "gcc": "8", "clang": "9", "apple-clang": "11" } diff --git a/recipes/sbepp/config.yml b/recipes/sbepp/config.yml index be97eb7c8428b..60f8f892f1bc0 100644 --- a/recipes/sbepp/config.yml +++ b/recipes/sbepp/config.yml @@ -1,4 +1,8 @@ versions: + "1.4.0": + folder: all + "1.3.0": + folder: all "1.2.0": folder: all "1.1.0": diff --git a/recipes/scc/all/CMakeLists.txt b/recipes/scc/all/CMakeLists.txt deleted file mode 100644 index 19bdb7e7f5fb7..0000000000000 --- a/recipes/scc/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(scc C) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/scc/all/conandata.yml b/recipes/scc/all/conandata.yml index bd7433056072d..a492e239a4b1c 100644 --- a/recipes/scc/all/conandata.yml +++ b/recipes/scc/all/conandata.yml @@ -1,4 +1,13 @@ sources: - "2022.08": - url: "https://github.com/Minres/SystemC-Components/releases/download/2022.08/systemc-components.tar.gz" - sha256: "825dfc38e7b00df34330f01ba38f5913e1a88c5002344e433b972faf0e6c4501" + "2023.06": + url: "https://github.com/Minres/SystemC-Components/releases/download/2023.06/SCC-2023.06-full.tar.gz" + sha256: "6d1a842f474daa512030d61526e83182f9289b977a3a7cb88ed151050c33c4e9" +patches: + "2023.06": + - patch_file: "patches/2023.06-fix-conan-targets.patch" + patch_description: "add find_package()-s and disable automatic Conan setup" + patch_type: "conan" + - patch_file: "patches/2023.06-add-fmt-10-support.patch" + patch_description: "fix incompatibility with fmt 10.x and newer" + patch_type: "portability" + patch_source: "https://github.com/Minres/SystemC-Components/pull/51" diff --git a/recipes/scc/all/conanfile.py b/recipes/scc/all/conanfile.py index c95474718f1dd..5f82f6e023588 100644 --- a/recipes/scc/all/conanfile.py +++ b/recipes/scc/all/conanfile.py @@ -1,89 +1,166 @@ +import os + from conan import ConanFile -from conan.tools.scm import Version -from conan.tools.files import get -from conans import tools, CMake from conan.errors import ConanInvalidConfiguration -import functools +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.files import copy, get, export_conandata_patches, apply_conandata_patches, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.50.0" class SystemcComponentsConan(ConanFile): name = "scc" - description = """A light weight productivity library for SystemC and TLM 2.0""" - homepage = "https://minres.github.io/SystemC-Components" - url = "https://github.com/conan-io/conan-center-index" + description = "A light-weight productivity library for SystemC and TLM 2.0" license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://minres.github.io/SystemC-Components" topics = ("systemc", "modeling", "tlm", "scc") - settings = "os", "compiler", "build_type", "arch" + + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], "enable_phase_callbacks": [True, False], - "enable_phase_callbacks_tracing": [True, False] + "enable_phase_callbacks_tracing": [True, False], } default_options = { "fPIC": True, "enable_phase_callbacks": False, - "enable_phase_callbacks_tracing": False + "enable_phase_callbacks_tracing": False, } - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_subfolder" - - # no exports_sources attribute, but export_sources(self) method instead - # this allows finer grain exportation of patches per version def export_sources(self): - self.copy("CMakeLists.txt") - + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # https://github.com/Minres/SystemC-Components/blob/2023.06/src/sysc/scc/perf_estimator.h#L20 + self.requires("boost/1.83.0", transitive_headers=True, transitive_libs=True) + # https://github.com/Minres/SystemC-Components/blob/2023.06/src/sysc/scc/trace/vcd_trace.hh#L28 + self.requires("fmt/10.2.1", transitive_headers=True, transitive_libs=True) + # https://github.com/Minres/SystemC-Components/blob/2023.06/src/common/util/lz4_streambuf.h#L13 + self.requires("lz4/1.9.4", transitive_headers=True, transitive_libs=True) + self.requires("rapidjson/cci.20220822") + self.requires("spdlog/1.13.0") + # https://github.com/Minres/SystemC-Components/blob/2023.06/src/sysc/tlm/scc/lwtr/tlm2_lwtr.h + self.requires("systemc-cci/1.0.0", transitive_headers=True, transitive_libs=True) + self.requires("systemc/2.3.4", transitive_headers=True, transitive_libs=True) + # https://github.com/Minres/SystemC-Components/blob/2023.06/src/sysc/scc/trace/gz_writer.hh#L18 + self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True, transitive_libs=True) + self.requires("yaml-cpp/0.8.0") + def validate(self): + if is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.name} is not supported on {self.settings.os}.") + if is_msvc(self): + # Fails with + # src\sysc\tlm\scc\tlm_mm.h(116,114): error C2259: 'tlm::scc::tlm_gp_mm_t<16,false>': cannot instantiate abstract class + # (compiling source file '../../../src/src/sysc/tlm/scc/lwtr/tlm2_lwtr.cpp') + # src\sysc\tlm\scc\tlm_mm.h(116,48): + # see declaration of 'tlm::scc::tlm_gp_mm_t<16,false>' + # src\sysc\tlm\scc\tlm_mm.h(116,114): + # due to following members: + # src\sysc\tlm\scc\tlm_mm.h(116,114): + # 'void tlm::tlm_extension::copy_from(const tlm::tlm_extension_base &)': is abstract + # systemc-2.3.4\p\include\tlm_core\tlm_2\tlm_generic_payload\tlm_gp.h(78,18): + # see declaration of 'tlm::tlm_extension::copy_from' + # and + # src\sysc\tlm\scc\tlm_mm.h(31,20): error C2061: syntax error: identifier '__attribute__' + raise ConanInvalidConfiguration(f"{self.ref} recipe is not supported on MSVC. Contributions are welcome!") if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) - if self.settings.os == "Macos": - raise ConanInvalidConfiguration(f"{self.name} is not suppported on {self.settings.os}.") + check_min_cppstd(self, 11) if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": raise ConanInvalidConfiguration("GCC < version 7 is not supported") - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - def build_requirements(self): - self.tool_requires("cmake/3.24.0") + self.tool_requires("cmake/[>=3.24 <4]") - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["SC_WITH_PHASE_CALLBACKS"] = self.options.enable_phase_callbacks - cmake.definitions["SC_WITH_PHASE_CALLBACK_TRACING"] = self.options.enable_phase_callbacks_tracing - cmake.definitions["BUILD_SCC_DOCUMENTATION"] = False - cmake.definitions["SCC_LIB_ONLY"] = True + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["SC_WITH_PHASE_CALLBACKS"] = self.options.enable_phase_callbacks + tc.cache_variables["SC_WITH_PHASE_CALLBACK_TRACING"] = self.options.enable_phase_callbacks_tracing + tc.cache_variables["BUILD_SCC_DOCUMENTATION"] = False + tc.cache_variables["SCC_LIB_ONLY"] = True + tc.cache_variables["ENABLE_CONAN"] = False if self.settings.os == "Windows": - cmake.definitions["SCC_LIMIT_TRACE_TYPE_LIST"] = True - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.cache_variables["SCC_LIMIT_TRACE_TYPE_LIST"] = True + # Used at https://github.com/Minres/SystemC-Components/blob/2023.06/src/common/util/pool_allocator.h#L110 + # but is not set anywhere + tc.preprocessor_definitions["_GLIBCXX_USE_NOEXCEPT"] = "noexcept" + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("systemc", "cmake_file_name", "SystemC") + deps.set_property("systemc-cci", "cmake_target_name", "systemc-cci::systemc-cci") + deps.set_property("yaml-cpp", "cmake_target_name", "yaml-cpp::yaml-cpp") + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "third_party", "axi_chi", "CMakeLists.txt"), + " STATIC", "") def build(self): - cmake = self._configure_cmake() + self._patch_sources() + 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, "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")) def package_info(self): - self.cpp_info.components["busses"].libs = ["busses"] self.cpp_info.components["scc-sysc"].libs = ["scc-sysc"] + self.cpp_info.components["scc-sysc"].requires = [ + "fstapi", + "lwtr", + "scc-util", + "scv-tr", + "boost::date_time", + "fmt::fmt", + "lz4::lz4", + "rapidjson::rapidjson", + "spdlog::spdlog", + "systemc-cci::systemc-cci", + "systemc::systemc", + "yaml-cpp::yaml-cpp", + "zlib::zlib", + ] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["scc-sysc"].system_libs = ["pthread", "dl"] + + self.cpp_info.components["busses"].libs = ["busses"] + self.cpp_info.components["busses"].requires = ["tlm-interfaces", "scc-sysc"] + + self.cpp_info.components["fstapi"].libs = ["fstapi"] + self.cpp_info.components["fstapi"].requires = ["zlib::zlib", "lz4::lz4"] + + self.cpp_info.components["lwtr"].libs = ["lwtr"] + self.cpp_info.components["lwtr"].requires = ["zlib::zlib", "lz4::lz4", "systemc::systemc", "fmt::fmt"] + self.cpp_info.components["scc-util"].libs = ["scc-util"] + self.cpp_info.components["scc-util"].requires = ["lz4::lz4"] + self.cpp_info.components["scv-tr"].libs = ["scv-tr"] + self.cpp_info.components["scv-tr"].requires = ["fmt::fmt", "systemc::systemc"] + self.cpp_info.components["tlm-interfaces"].libs = ["tlm-interfaces"] + self.cpp_info.components["tlm-interfaces"].requires = ["scc-sysc", "systemc::systemc"] diff --git a/recipes/scc/all/patches/2023.06-add-fmt-10-support.patch b/recipes/scc/all/patches/2023.06-add-fmt-10-support.patch new file mode 100644 index 0000000000000..e07a125098cc9 --- /dev/null +++ b/recipes/scc/all/patches/2023.06-add-fmt-10-support.patch @@ -0,0 +1,11 @@ +--- src/sysc/scc/trace/vcd_trace.hh ++++ src/sysc/scc/trace/vcd_trace.hh +@@ -53,7 +53,7 @@ + + template + inline void vcdEmitValueChangeReal(FPTR os, std::string const& handle, unsigned bits, T val){ +- auto buf = fmt::format("r{:.16g} {}\n", val, handle); ++ auto buf = fmt::format("r{:.16g} {}\n", static_cast(val), handle); + FWRITE(buf.c_str(), 1, buf.size(), os); + } + diff --git a/recipes/scc/all/patches/2023.06-fix-conan-targets.patch b/recipes/scc/all/patches/2023.06-fix-conan-targets.patch new file mode 100644 index 0000000000000..052ef97ffbc9f --- /dev/null +++ b/recipes/scc/all/patches/2023.06-fix-conan-targets.patch @@ -0,0 +1,17 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -24,5 +24,13 @@ + include(Common) + +-if(CMAKE_PROJECT_NAME STREQUAL "scc") ++find_package(SystemC REQUIRED CONFIG) ++find_package(systemc-cci REQUIRED CONFIG) ++find_package(fmt REQUIRED CONFIG) ++find_package(spdlog REQUIRED CONFIG) ++find_package(Boost REQUIRED CONFIG) ++find_package(yaml-cpp REQUIRED CONFIG) ++find_package(lz4 REQUIRED CONFIG) ++if(TRUE) ++elseif(CMAKE_PROJECT_NAME STREQUAL "scc") + message(STATUS "Building SCC in standalone mode") + include(GNUInstallDirs) diff --git a/recipes/scc/all/test_package/CMakeLists.txt b/recipes/scc/all/test_package/CMakeLists.txt index b74b2d8e566a6..32a369fbfeb6a 100644 --- a/recipes/scc/all/test_package/CMakeLists.txt +++ b/recipes/scc/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(scc REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.cpp) diff --git a/recipes/scc/all/test_package/conanfile.py b/recipes/scc/all/test_package/conanfile.py index 48f7a8523a636..ef5d7042163ec 100644 --- a/recipes/scc/all/test_package/conanfile.py +++ b/recipes/scc/all/test_package/conanfile.py @@ -1,18 +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 -from conan.tools.build import cross_building -class SystemcComponentsTestConan(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) 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) + 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/scc/all/test_package/example.cpp b/recipes/scc/all/test_package/example.cpp index 2de9f26d9f75d..4f5ccf21b1e5c 100644 --- a/recipes/scc/all/test_package/example.cpp +++ b/recipes/scc/all/test_package/example.cpp @@ -1,7 +1,9 @@ +#include #include #include -int main(int argc, char* argv[]) { +int main() { + util::IoRedirector::get(); std::cout << "scc loaded successfully. Mini test: util::ilog2(32) = " << util::ilog2(32) << std::endl; return 0; } diff --git a/recipes/scc/config.yml b/recipes/scc/config.yml index f8b19962361c1..f334fc74322ea 100644 --- a/recipes/scc/config.yml +++ b/recipes/scc/config.yml @@ -1,3 +1,3 @@ versions: - "2022.08": - folder: "all" + "2023.06": + folder: all diff --git a/recipes/scip/all/conandata.yml b/recipes/scip/all/conandata.yml index aacd6d1a319fe..a8bf84f8787de 100644 --- a/recipes/scip/all/conandata.yml +++ b/recipes/scip/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "9.0.1": + url: "https://github.com/scipopt/scip/archive/refs/tags/v901.tar.gz" + sha256: "08ad3e7ad6f84f457d95bb70ab21fa7fc648dd43103099359ef8a8f30fcce32e" "8.1.0": url: "https://github.com/scipopt/scip/archive/refs/tags/v810.tar.gz" sha256: "b6daf54c37d02564b12fb32ec3bb7a105710eb0026adeafc602af4435fa94685" diff --git a/recipes/scip/all/conanfile.py b/recipes/scip/all/conanfile.py index 30a113fa5330e..0fea9f21ddc93 100644 --- a/recipes/scip/all/conanfile.py +++ b/recipes/scip/all/conanfile.py @@ -35,6 +35,7 @@ class SCIPConan(ConanFile): "with_sym": "bliss", } soplex_version_belonging_to_me = { + "9.0.1": "7.0.1", "8.1.0": "6.0.4", "8.0.4": "6.0.4", "8.0.3": "6.0.3" @@ -71,6 +72,9 @@ def validate(self): 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.") + if Version(self.version) >= "9.0.1" and is_msvc(self) and self.settings.build_type == "Debug": + # lpi_spx2.cpp : error C1128: number of sections exceeded object file format limit: compile with /bigobj + raise ConanInvalidConfiguration(f"{self.ref} can not be build in Debug with MSVC.") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -120,6 +124,7 @@ def generate(self): tc.variables["PAPILO"] = False # LGPL tc.variables["ZIMPL"] = False # LPGL tc.variables["IPOPT"] = False # no such coin package on conan center yet + tc.variables["BUILD_TESTING"] = False # do not build documentation and examples tc.generate() deps = CMakeDeps(self) deps.set_property("sopex", "cmake_file_name", "SOPEX") diff --git a/recipes/scip/config.yml b/recipes/scip/config.yml index f70b85bc6cf44..06d899dbf8431 100644 --- a/recipes/scip/config.yml +++ b/recipes/scip/config.yml @@ -1,4 +1,6 @@ versions: + "9.0.1": + folder: all "8.1.0": folder: all "8.0.4": diff --git a/recipes/scippp/all/conandata.yml b/recipes/scippp/all/conandata.yml index 88b2816d64354..39c343801470f 100644 --- a/recipes/scippp/all/conandata.yml +++ b/recipes/scippp/all/conandata.yml @@ -1,7 +1,14 @@ sources: + "1.2.0": + url: "https://github.com/scipopt/SCIPpp/archive/refs/tags/1.2.0.tar.gz" + sha256: "8fa4b819734b9841eda1ec1c9266fb07144be490c3f24be46271c538ab18da61" "1.1.0": url: "https://github.com/scipopt/SCIPpp/archive/refs/tags/1.1.0.tar.gz" sha256: "808b58e8ddd873ec403c021f9255004120e58d7ec6fb4b7d99ff6f21950ff8fb" "1.0.2": url: "https://github.com/scipopt/SCIPpp/archive/refs/tags/1.0.2.tar.gz" sha256: "d51dfd0f1ca1b57619f7c82e32d5390d99d5cdaee98ae1ace99ec05a394dcee3" +scip_mapping: + "1.2.0": "9.0.1" + "1.1.0": "8.0.4" + "1.0.2": "8.0.4" diff --git a/recipes/scippp/all/conanfile.py b/recipes/scippp/all/conanfile.py index 77b8d49bdb43c..55ee8105f9224 100644 --- a/recipes/scippp/all/conanfile.py +++ b/recipes/scippp/all/conanfile.py @@ -76,7 +76,7 @@ def configure(self): def requirements(self): # see https://github.com/scipopt/SCIPpp/blob/1.0.0/conanfile.py#L25 - self.requires("scip/8.0.4", transitive_headers=True) + self.requires(f"scip/{self.conan_data['scip_mapping'][self.version]}", transitive_headers=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/scippp/config.yml b/recipes/scippp/config.yml index a59308932f1d8..eb9a4f6036cd3 100644 --- a/recipes/scippp/config.yml +++ b/recipes/scippp/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.0": folder: all "1.0.2": diff --git a/recipes/scnlib/all/conandata.yml b/recipes/scnlib/all/conandata.yml index 6655f8d077d01..710d921dd9cb1 100644 --- a/recipes/scnlib/all/conandata.yml +++ b/recipes/scnlib/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.0.1": + url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v3.0.1.tar.gz" + sha256: "bc8a668873601d00cce6841c2d0f2c93f836f63f0fbc77997834dea12e951eb1" + "2.0.3": + url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v2.0.3.tar.gz" + sha256: "507ed0e988f1d9460a9c921fc21f5a5244185a4015942f235522fbe5c21e6a51" "2.0.2": url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v2.0.2.tar.gz" sha256: "a485076b8710576cf05fbc086d39499d16804575c0660b0dfaeeaf7823660a17" diff --git a/recipes/scnlib/all/conanfile.py b/recipes/scnlib/all/conanfile.py index c08cd042027e8..afbb228d4be7f 100644 --- a/recipes/scnlib/all/conanfile.py +++ b/recipes/scnlib/all/conanfile.py @@ -83,7 +83,7 @@ def layout(self): def requirements(self): self.requires("fast_float/6.1.0") - if Version(self.version) >= "2.0": + if "2.0" <= Version(self.version) < "3.0": self.requires("simdutf/4.0.5") if self.options.get_safe("regex_backend") in ["boost", "boost_icu"]: self.requires("boost/1.83.0") @@ -184,8 +184,9 @@ def package_info(self): self.cpp_info.components["_scnlib"].defines = ["SCN_HEADER_ONLY=0"] self.cpp_info.components["_scnlib"].libs = ["scn"] self.cpp_info.components["_scnlib"].requires.append("fast_float::fast_float") - if Version(self.version) >= "2.0": + if "2.0" <= Version(self.version) < "3.0": self.cpp_info.components["_scnlib"].requires.append("simdutf::simdutf") + if Version(self.version) >= "2.0": if self.options.get_safe("regex_backend") in ["boost", "boost_icu"]: self.cpp_info.components["_scnlib"].requires.append("boost::regex") elif self.options.get_safe("regex_backend") == "re2": diff --git a/recipes/scnlib/config.yml b/recipes/scnlib/config.yml index 9f31088bdf1c3..40bb839ac3cd3 100644 --- a/recipes/scnlib/config.yml +++ b/recipes/scnlib/config.yml @@ -1,4 +1,8 @@ versions: + "3.0.1": + folder: all + "2.0.3": + folder: all "2.0.2": folder: all "2.0.1": diff --git a/recipes/sdbus-cpp/all/conandata.yml b/recipes/sdbus-cpp/all/conandata.yml index 6379706780143..c7ec57d1ada42 100644 --- a/recipes/sdbus-cpp/all/conandata.yml +++ b/recipes/sdbus-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.0": + url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v2.0.0.tar.gz" + sha256: "88af4569161a0d0192f0f4a94582a1af4e75722499d06984fb7f91f638f5afb3" "1.5.0": url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.5.0.tar.gz" sha256: "577986929f911320fb9ef6a3e2badd464dc38411ebc25d2966f5cb85c39f0897" diff --git a/recipes/sdbus-cpp/all/conanfile.py b/recipes/sdbus-cpp/all/conanfile.py index b466198f4d0ea..4f55c042c482c 100644 --- a/recipes/sdbus-cpp/all/conanfile.py +++ b/recipes/sdbus-cpp/all/conanfile.py @@ -4,7 +4,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get, rmdir from conan.tools.scm import Version required_conan_version = ">=1.51.0" @@ -24,11 +24,13 @@ class SdbusCppConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_code_gen": [True, False], + "with_sdbus": ["systemd", "basu"], } default_options = { "shared": False, "fPIC": True, "with_code_gen": False, + "with_sdbus": "systemd", } generators = "PkgConfigDeps", "VirtualBuildEnv" @@ -38,15 +40,29 @@ def _minimum_cpp_standard(self): @property def _minimum_compilers_version(self): + # non-trivial designated initializers are not supported in gcc < 8 + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55606 return { - "gcc": "7", + "gcc": "7" if Version(self.version) < "2.0.0" else "8", "clang": "6", } + @property + def _supported_os(self): + return (["Linux"] if Version(self.version) < "1.4.0" + else ["Linux", "FreeBSD"]) + + @property + def _with_sdbus(self): + return ("basu" if self.settings.os == "FreeBSD" + else self.options.get_safe("with_sdbus", "systemd")) + def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, - self.export_sources_folder) + export_conandata_patches(self) + + def config_options(self): + if Version(self.version) < "1.4.0" or self.settings.os != "Linux": + del self.options.with_sdbus def configure(self): if Version(self.version) < "0.9.0": @@ -56,11 +72,15 @@ def configure(self): del self.options.fPIC def requirements(self): - self.requires("libsystemd/255.2") + if self._with_sdbus == "systemd": + self.requires("libsystemd/255.2") + elif self._with_sdbus == "basu": + self.requires("basu/0.2.1") def validate(self): - if self.info.settings.os != "Linux": - raise ConanInvalidConfiguration(f"{self.name} only supports Linux") + if self.settings.os not in self._supported_os: + raise ConanInvalidConfiguration( + f"{self.ref} does not support {self.settings.os}") if self.info.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._minimum_cpp_standard) @@ -76,7 +96,7 @@ def validate(self): def build_requirements(self): self.tool_requires("pkgconf/2.1.0") if self.options.with_code_gen: - self.tool_requires("expat/2.6.0") + self.tool_requires("expat/[>=2.6.2 <3]") def layout(self): cmake_layout(self, src_folder="src") @@ -90,6 +110,8 @@ def generate(self): tc.variables["BUILD_DOC"] = False tc.variables["BUILD_TESTS"] = False tc.variables["BUILD_LIBSYSTEMD"] = False + tc.variables["SDBUSCPP_BUILD_DOCS"] = False + tc.variables["SDBUSCPP_SDBUS_LIB"] = self._with_sdbus tc.generate() # workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/18150 @@ -131,9 +153,12 @@ def package_info(self): "cmake_target_name", "SDBusCpp::sdbus-c++") self.cpp_info.components["sdbus-c++"].set_property( "pkg_config_name", "sdbus-c++") - self.cpp_info.components["sdbus-c++"].requires.append( - "libsystemd::libsystemd") + if self._with_sdbus == "systemd": + self.cpp_info.components["sdbus-c++"].requires.append( + "libsystemd::libsystemd") + elif self._with_sdbus == "basu": + self.cpp_info.components["sdbus-c++"].requires.append( + "basu::basu") if self.options.with_code_gen: bin_path = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH env var with : {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/sdbus-cpp/config.yml b/recipes/sdbus-cpp/config.yml index 16a0828c0e1fc..b633474143962 100644 --- a/recipes/sdbus-cpp/config.yml +++ b/recipes/sdbus-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.0": + folder: all "1.5.0": folder: all "1.4.0": diff --git a/recipes/sdf/all/test_package/CMakeLists.txt b/recipes/sdf/all/test_package/CMakeLists.txt index afcf11bbd8776..0e0a1b879f436 100644 --- a/recipes/sdf/all/test_package/CMakeLists.txt +++ b/recipes/sdf/all/test_package/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) find_package(sdf REQUIRED CONFIG) -find_package(stb REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE sdf::sdf stb::stb) +target_link_libraries(${PROJECT_NAME} PRIVATE sdf::sdf) diff --git a/recipes/sdf/all/test_package/conanfile.py b/recipes/sdf/all/test_package/conanfile.py index ad5b8f9465ed6..0a6bc68712d90 100644 --- a/recipes/sdf/all/test_package/conanfile.py +++ b/recipes/sdf/all/test_package/conanfile.py @@ -14,7 +14,6 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("stb/cci.20210910") def build(self): cmake = CMake(self) @@ -24,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_path = os.path.join(self.source_folder, "test.png") - self.run(f"{bin_path} {img_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/sdf/all/test_package/test.png b/recipes/sdf/all/test_package/test.png deleted file mode 100644 index 568aa3449320a..0000000000000 Binary files a/recipes/sdf/all/test_package/test.png and /dev/null differ diff --git a/recipes/sdf/all/test_package/test_package.c b/recipes/sdf/all/test_package/test_package.c index 808fd873709a9..01f233e85fca3 100644 --- a/recipes/sdf/all/test_package/test_package.c +++ b/recipes/sdf/all/test_package/test_package.c @@ -3,35 +3,14 @@ #define SDF_IMPLEMENTATION #include "sdf.h" -#define STB_IMAGE_IMPLEMENTATION -#include "stb_image.h" - int main(int argc, char **argv) { - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return 1; - } - - int width, height, bpp; - unsigned char* img_data = stbi_load(argv[1], &width, &height, &bpp, 0); - if(img_data == NULL) - { - fprintf(stderr, "Could not load image: %s\n", stbi_failure_reason()); - return 1; - } - - unsigned char* dest_data = malloc(width * height * bpp); - if(dest_data == NULL) - { - stbi_image_free(img_data); - return 1; - } - - sdfBuildDistanceField(dest_data, width, 2.0f, img_data, width, height, width); + unsigned char* dest_data = malloc(0); + int result = sdfBuildDistanceField(dest_data, 0, 2.0f, NULL, 0, 0, 0); + printf("Result: %d\n", result); + printf("Test"); free(dest_data); - stbi_image_free(img_data); return 0; } diff --git a/recipes/sdf/all/test_v1_package/CMakeLists.txt b/recipes/sdf/all/test_v1_package/CMakeLists.txt index ee4e3e06a56c5..a27e3332baf0d 100644 --- a/recipes/sdf/all/test_v1_package/CMakeLists.txt +++ b/recipes/sdf/all/test_v1_package/CMakeLists.txt @@ -5,7 +5,6 @@ include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) find_package(sdf REQUIRED CONFIG) -find_package(stb REQUIRED CONFIG) add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE sdf::sdf stb::stb) +target_link_libraries(${PROJECT_NAME} PRIVATE sdf::sdf) diff --git a/recipes/sdf/all/test_v1_package/conanfile.py b/recipes/sdf/all/test_v1_package/conanfile.py index 855f0ca3462a1..38f4483872d47 100644 --- a/recipes/sdf/all/test_v1_package/conanfile.py +++ b/recipes/sdf/all/test_v1_package/conanfile.py @@ -6,9 +6,6 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package_multi" - def requirements(self): - self.requires("stb/cci.20210910") - def build(self): cmake = CMake(self) cmake.configure() @@ -17,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - img_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.png") - self.run(f"{bin_path} {img_path}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/sdl/all/conandata.yml b/recipes/sdl/all/conandata.yml index 5542cc7bb105c..f49cb33505aab 100644 --- a/recipes/sdl/all/conandata.yml +++ b/recipes/sdl/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "2.30.5": + url: "https://www.libsdl.org/release/SDL2-2.30.5.tar.gz" + sha256: "f374f3fa29c37dfcc20822d4a7d7dc57e58924d1a5f2ad511bfab4c8193de63b" + "2.30.4": + url: "https://www.libsdl.org/release/SDL2-2.30.4.tar.gz" + sha256: "59c89d0ed40d4efb23b7318aa29fe7039dbbc098334b14f17f1e7e561da31a26" + "2.30.3": + url: "https://www.libsdl.org/release/SDL2-2.30.3.tar.gz" + sha256: "820440072f8f5b50188c1dae104f2ad25984de268785be40c41a099a510f0aec" + "2.30.2": + url: "https://www.libsdl.org/release/SDL2-2.30.2.tar.gz" + sha256: "891d66ac8cae51361d3229e3336ebec1c407a8a2a063b61df14f5fdf3ab5ac31" + "2.30.1": + url: "https://www.libsdl.org/release/SDL2-2.30.1.tar.gz" + sha256: "01215ffbc8cfc4ad165ba7573750f15ddda1f971d5a66e9dcaffd37c587f473a" "2.28.5": url: "https://www.libsdl.org/release/SDL2-2.28.5.tar.gz" sha256: "332cb37d0be20cb9541739c61f79bae5a477427d79ae85e352089afdaf6666e4" diff --git a/recipes/sdl/all/conanfile.py b/recipes/sdl/all/conanfile.py index 97981518e1f52..cd55e0ceb1b78 100644 --- a/recipes/sdl/all/conanfile.py +++ b/recipes/sdl/all/conanfile.py @@ -79,12 +79,12 @@ class SDLConan(ConanFile): "libunwind": True, } generators = "CMakeDeps", "PkgConfigDeps", "VirtualBuildEnv" - + @property def _is_clang_cl(self): return self.settings.os == "Windows" and self.settings.compiler == "clang" and \ self.settings.compiler.get_safe("runtime") - + def layout(self): cmake_layout(self, src_folder="src") @@ -192,22 +192,23 @@ def source(self): def _patch_sources(self): apply_conandata_patches(self) - cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - if self.settings.os == "Macos": - if self.options.iconv: - # If using conan-provided iconv, search for the symbol "libiconv_open" - replace_check = "check_library_exists(iconv libiconv_open" - else: - # When no tusing conan-provided icon, don't check for iconv at all - replace_check = "#check_library_exists(iconv iconv_open" - replace_in_file(self, cmakelists, "check_library_exists(iconv iconv_open", - replace_check) - - # Avoid assuming iconv is available if it is provided by the C runtime, - # and let SDL build the fallback implementation - replace_in_file(self, cmakelists, - 'check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)', - '# check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)') + if Version(self.version) < "2.30.0": + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + if self.settings.os == "Macos": + if self.options.iconv: + # If using conan-provided iconv, search for the symbol "libiconv_open" + replace_check = "check_library_exists(iconv libiconv_open" + else: + # When no tusing conan-provided icon, don't check for iconv at all + replace_check = "#check_library_exists(iconv iconv_open" + replace_in_file(self, cmakelists, "check_library_exists(iconv iconv_open", + replace_check) + + # Avoid assuming iconv is available if it is provided by the C runtime, + # and let SDL build the fallback implementation + replace_in_file(self, cmakelists, + 'check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)', + '# check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)') # Ensure to find wayland-scanner from wayland recipe in build requirements (or requirements if 1 profile) if self.options.get_safe("wayland"): @@ -237,6 +238,7 @@ def define_toolchain(self): tc.variables["HAVE_LIBC"] = True tc.variables["SDL_SHARED"] = self.options.shared tc.variables["SDL_STATIC"] = not self.options.shared + tc.variables["SDL_TEST"] = False tc.variables["SDL_OPENGL"] = self.options.opengl tc.variables["SDL_OPENGLES"] = self.options.opengles tc.variables["SDL_VULKAN"] = self.options.vulkan @@ -313,6 +315,9 @@ def define_toolchain(self): if Version(self.version) >= "2.0.22": tc.variables["SDL2_DISABLE_SDL2MAIN"] = not self.options.sdl2main + if Version(self.version) >= "2.30.0": + tc.variables["SDL_LIBICONV"] = self.options.get_safe("iconv", False) + tc.variables["SDL_SYSTEM_ICONV"] = False # Add extra information collected from the deps tc.variables["EXTRA_LDFLAGS"] = ";".join(cmake_extra_ldflags) @@ -320,6 +325,7 @@ def define_toolchain(self): cmake_extra_cflags = ["-I{}".format(path) for _, dep in self.dependencies.items() for path in dep.cpp_info.includedirs] tc.variables["EXTRA_CFLAGS"] = ";".join(cmake_extra_cflags).replace(os.sep, '/') tc.variables["EXTRA_LIBS"] = ";".join(cmake_extra_libs) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() def build(self): @@ -334,6 +340,8 @@ def package(self): copy(self, pattern="LICENSE.txt", src=os.path.join(self.source_folder), dst=os.path.join(self.package_folder, "licenses")) rm(self, "sdl2-config", os.path.join(self.package_folder, "bin")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) rmdir(self, os.path.join(self.package_folder, "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) diff --git a/recipes/sdl/config.yml b/recipes/sdl/config.yml index e05c00ea2969e..bb02b66ecf2da 100644 --- a/recipes/sdl/config.yml +++ b/recipes/sdl/config.yml @@ -1,4 +1,14 @@ versions: + "2.30.5": + folder: all + "2.30.4": + folder: all + "2.30.3": + folder: all + "2.30.2": + folder: all + "2.30.1": + folder: all "2.28.5": folder: all "2.28.3": diff --git a/recipes/sdl_mixer/cmake/conandata.yml b/recipes/sdl_mixer/cmake/conandata.yml new file mode 100644 index 0000000000000..67acbdb598f69 --- /dev/null +++ b/recipes/sdl_mixer/cmake/conandata.yml @@ -0,0 +1,6 @@ +sources: + "2.8.0": + url: + - "https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.0/SDL2_mixer-2.8.0.tar.gz" + - "https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.8.0.tar.gz" + sha256: "1cfb34c87b26dbdbc7afd68c4f545c0116ab5f90bbfecc5aebe2a9cb4bb31549" diff --git a/recipes/sdl_mixer/cmake/conanfile.py b/recipes/sdl_mixer/cmake/conanfile.py new file mode 100644 index 0000000000000..4e5f82fa8bef5 --- /dev/null +++ b/recipes/sdl_mixer/cmake/conanfile.py @@ -0,0 +1,269 @@ +import os + +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.57.0" + + +class SDLMixerConan(ConanFile): + name = "sdl_mixer" + description = "SDL_mixer is a sample multi-channel audio mixer library" + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.libsdl.org/projects/SDL_mixer/" + topics = ("sdl2", "sdl", "mixer", "audio", "multimedia", "sound", "music") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "cmd": [True, False], + "wav": [True, False], + "flac": [True, False], + "gme": [True, False], + "minimp3": [True, False], + "mpg123": [True, False], + "opus": [True, False], + "modplug": [True, False], + "fluidsynth": [True, False], + "nativemidi": [True, False], + "tinymidi": [True, False], + "vorbis": [False, "vorbisfile", "tremor", "stb"], + "wavpack": [True, False], + "xmp": [False, "libxmp", "libxmp-lite"], + } + default_options = { + "shared": False, + "fPIC": True, + "cmd": False, + "wav": True, + "flac": True, + "gme": False, + "minimp3": False, + "mpg123": True, + "opus": True, + "modplug": True, + "fluidsynth": False, + "nativemidi": True, + "tinymidi": True, + "vorbis": "stb", + "wavpack": False, + "xmp": False + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.tinymidi + if not (self.settings.os == "Windows" or is_apple_os(self)): + del self.options.nativemidi + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if not self.options.flac and self.options.gme: + raise ConanInvalidConfiguration("gme is not yet available in CCI, contributions are welcome") + if self.options.vorbis == "tremor": + raise ConanInvalidConfiguration("tremor is not yet available in CCI, contributions are welcome") + if self.options.xmp == "libxmp": + raise ConanInvalidConfiguration("libxmp is not yet available in CCI, contributions are welcome") + if self.options.xmp == "libxmp-lite": + raise ConanInvalidConfiguration("libxmp-lite is not yet available in CCI, contributions are welcome") + if self.options.fluidsynth: + raise ConanInvalidConfiguration("fluidsynth is not yet available in CCI, contributions are welcome") + if self.options.wavpack: + raise ConanInvalidConfiguration("wavpack is not yet available in CCI, contributions are welcome") + + def requirements(self): + self.requires("sdl/2.28.5", transitive_headers=True, transitive_libs=True) + if self.options.flac: + self.requires("flac/1.4.2") + elif self.options.gme: + # TODO: not available on CCI + # self.requires("gme/x.y.z") + pass + if self.options.mpg123: + self.requires("mpg123/1.31.2") + if self.options.minimp3: + self.requires("minimp3/cci.20211201") + if self.options.vorbis == "stb": + self.requires("stb/cci.20230920") + elif self.options.vorbis == "vorbisfile": + self.requires("vorbis/1.3.7") + elif self.options.vorbis == "tremor": + # TODO: not available on CCI + # self.requires("tremor/1.2.1") + pass + if self.options.opus: + self.requires("opusfile/0.12") + if self.options.modplug: + self.requires("libmodplug/0.8.9.0") + if self.options.xmp == "libxmp": + # TODO: not available on CCI + # self.requires("libxmp/x.y.z") + pass + elif self.options.xmp == "libxmp-lite": + # TODO: not available on CCI + # self.requires("libxmp-lite/x.y.z") + pass + if self.options.fluidsynth: + # TODO: not available on CCI + # self.requires("fluidsynth/2.2") + pass + if self.options.get_safe("tinymidi"): + self.requires("tinymidi/cci.20130325") + # https://github.com/libsdl-org/SDL_mixer/blob/release-2.6.3/CMakeLists.txt#L148-L162 + if self.options.vorbis or self.options.flac or self.options.opus: + self.requires("ogg/1.3.5") + if self.options.wavpack: + # TODO: not available on CCI + # self.requires("wavpack/x.y.z") + pass + + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + rmdir(self, os.path.join(self.source_folder, "external")) + + def generate(self): + tc = CMakeToolchain(self) + # Disable debug postfix as it's not relevant to single-configuration Conan builds + # and will be removed in v3.0 anyway. + tc.variables["SDL2MIXER_DEBUG_POSTFIX"] = "" + tc.variables["SDL2MIXER_VENDORED"] = False + tc.variables["SDL2MIXER_SAMPLES"] = False + tc.variables["SDL2MIXER_CMD"] = self.options.cmd + # WAVE + tc.variables["SDL2MIXER_WAVE"] = self.options.wav + # FLAC + tc.variables["SDL2MIXER_FLAC"] = self.options.flac + # GME + tc.variables["SDL2MIXER_GME"] = self.options.gme + # MOD + tc.variables["SDL2MIXER_MOD"] = self.options.modplug or bool(self.options.xmp) + tc.variables["SDL2MIXER_MOD_MODPLUG"] = self.options.modplug + tc.variables["SDL2MIXER_MOD_XMP"] = self.options.xmp == "libxmp" + tc.variables["SDL2MIXER_MOD_XMP_LITE"] = self.options.xmp == "libxmp-lite" + # MP3 + tc.variables["SDL2MIXER_MP3"] = self.options.mpg123 or self.options.minimp3 + tc.variables["SDL2MIXER_MP3_MPG123"] = self.options.mpg123 + tc.variables["SDL2MIXER_MP3_MINIMP3"] = self.options.minimp3 + # MIDI + tc.variables["SDL2MIXER_MIDI"] = self.options.get_safe("nativemidi", False) or self.options.get_safe("tinymidi", False) or self.options.fluidsynth + tc.variables["SDL2MIXER_MIDI_FLUIDSYNTH"] = self.options.fluidsynth + tc.variables["SDL2MIXER_MIDI_TIMIDITY"] = self.options.get_safe("tinymidi", False) + tc.variables["SDL2MIXER_MIDI_NATIVE"] = self.options.get_safe("nativemidi", False) + # OPUS + tc.variables["SDL2MIXER_OPUS"] = self.options.opus + # VORBIS + if self.options.vorbis == "stb": + tc.variables["SDL2MIXER_VORBIS"] = "STB" + elif self.options.vorbis == "vorbisfile": + tc.variables["SDL2MIXER_VORBIS"] = "VORBISFILE" + elif self.options.vorbis == "tremor": + tc.variables["SDL2MIXER_VORBIS"] = "TREMOR" + else: + tc.variables["SDL2MIXER_VORBIS"] = False + # WavPack + tc.variables["SDL2MIXER_WAVPACK"] = self.options.wavpack + + # TODO: add support for dynamic loading of dependencies + tc.variables["SDL2MIXER_DEPS_SHARED"] = False + tc.variables["SDL2MIXER_FLAC_LIBFLAC_SHARED"] = False + tc.variables["SDL2MIXER_GME_SHARED"] = False + tc.variables["SDL2MIXER_MIDI_FLUIDSYNTH_SHARED"] = False + tc.variables["SDL2MIXER_MIDI_TIMIDITY_SHARED"] = False + tc.variables["SDL2MIXER_MOD_MODPLUG_SHARED"] = False + tc.variables["SDL2MIXER_MOD_XMP_SHARED"] = False + tc.variables["SDL2MIXER_MP3_MPG123_SHARED"] = False + tc.variables["SDL2MIXER_OGG_SHARED"] = False + tc.variables["SDL2MIXER_OPUS_SHARED"] = False + tc.variables["SDL2MIXER_SNDFILE_SHARED"] = False + tc.variables["SDL2MIXER_VORBIS_TREMOR_SHARED"] = False + tc.variables["SDL2MIXER_VORBIS_VORBISFILE_SHARED"] = False + tc.variables["SDL2MIXER_WAVPACK_SHARED"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("flac", "cmake_file_name", "FLAC") + deps.set_property("flac", "cmake_target_name", "FLAC::FLAC") + deps.set_property("fluidsynth", "cmake_file_name", "FluidSynth") + deps.set_property("fluidsynth", "cmake_target_name", "FluidSynth::libfluidsynth") + deps.set_property("gme", "cmake_file_name", "gme") + deps.set_property("gme", "cmake_target_name", "gme::gme") + deps.set_property("libxmp", "cmake_file_name", "libxmp") + deps.set_property("libxmp", "cmake_target_name", "libxmp::libxmp") + deps.set_property("libxmp-lite", "cmake_file_name", "libxmp-lite") + deps.set_property("libxmp-lite", "cmake_target_name", "libxmp-lite::libxmp-lite") + deps.set_property("libmodplug", "cmake_file_name", "modplug") + deps.set_property("libmodplug", "cmake_target_name", "modplug::modplug") + deps.set_property("mpg123", "cmake_file_name", "mpg123") + deps.set_property("mpg123", "cmake_target_name", "MPG123::libmpg123") + deps.set_property("opusfile", "cmake_file_name", "OpusFile") + deps.set_property("opusfile", "cmake_target_name", "OpusFile::opusfile") + deps.set_property("tremor", "cmake_file_name", "tremor") + deps.set_property("tremor", "cmake_target_name", "tremor::tremor") + deps.set_property("vorbis", "cmake_file_name", "Vorbis") + deps.set_property("vorbis::vorbisfile", "cmake_target_name", "Vorbis::vorbisfile") + deps.set_property("wavpack", "cmake_file_name", "wavpack") + deps.set_property("wavpack", "cmake_target_name", "WavPack::WavPack") + + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SDL2_mixer") + self.cpp_info.set_property("cmake_target_name", "SDL2_mixer::SDL2_mixer") + # https://github.com/libsdl-org/SDL_mixer/blob/release-2.6.3/CMakeLists.txt#L164-L172 + if not self.options.shared: + self.cpp_info.set_property("cmake_target_aliases", ["SDL2_mixer::SDL2_mixer-static"]) + # The project only creates a pkg-config file for a shared lib, but add it for static as well, unofficially + # https://github.com/libsdl-org/SDL_mixer/blob/release-2.6.3/CMakeLists.txt#L828 + self.cpp_info.set_property("pkg_config_name", "SDL2_mixer") + + if is_msvc(self) and not self.options.shared: + self.cpp_info.libs = ["SDL2_mixer-static"] + else: + self.cpp_info.libs = ["SDL2_mixer"] + self.cpp_info.includedirs.append(os.path.join("include", "SDL2")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + if self.settings.os == "Windows": + if self.options.nativemidi: + self.cpp_info.system_libs.append("winmm") + elif is_apple_os(self): + self.cpp_info.frameworks.extend(["AudioToolbox", "AudioUnit", "CoreServices", "CoreGraphics", "CoreFoundation"]) + if self.settings.os == "Macos": + self.cpp_info.frameworks.append("AppKit") + + self.cpp_info.names["cmake_find_package"] = "SDL2_mixer" + self.cpp_info.names["cmake_find_package_multi"] = "SDL2_mixer" diff --git a/recipes/sdl_mixer/cmake/test_package/CMakeLists.txt b/recipes/sdl_mixer/cmake/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d1c846300657f --- /dev/null +++ b/recipes/sdl_mixer/cmake/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(SDL2_mixer REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_mixer::SDL2_mixer) diff --git a/recipes/sdl_mixer/cmake/test_package/conanfile.py b/recipes/sdl_mixer/cmake/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/sdl_mixer/cmake/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sdl_mixer/cmake/test_package/test_package.c b/recipes/sdl_mixer/cmake/test_package/test_package.c new file mode 100644 index 0000000000000..c0bb50e718473 --- /dev/null +++ b/recipes/sdl_mixer/cmake/test_package/test_package.c @@ -0,0 +1,43 @@ +#include +#include + +#include +#include + +int main(int argc, char *argv[]) +{ + int audio_rate = MIX_DEFAULT_FREQUENCY; + int audio_format = MIX_DEFAULT_FORMAT; + int audio_channels = 2; + const SDL_version * version = Mix_Linked_Version(); + printf("%s", "SDL2_mixer version: "); + printf("%d.", (int)(version->major)); + printf("%d.", (int)(version->minor)); + printf("%d\n", (int)(version->patch)); + + if (SDL_Init(SDL_INIT_AUDIO) == 0) { + int initted = Mix_Init(MIX_INIT_FLAC | MIX_INIT_MOD | MIX_INIT_MP3 | MIX_INIT_OGG | MIX_INIT_MID | MIX_INIT_OPUS); + printf("%s %s\n", "Supported MIX_INIT_MOD: " , (initted & MIX_INIT_MOD ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_MP3: " , (initted & MIX_INIT_MP3 ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_OGG: " , (initted & MIX_INIT_OGG ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_FLAC: ", (initted & MIX_INIT_FLAC ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_MID: " , (initted & MIX_INIT_MID ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_OPUS: ", (initted & MIX_INIT_OPUS ? "Yes" : "No")); + + if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, 4096) == 0) { + int num_chunk_decoders = Mix_GetNumChunkDecoders(); + int num_music_decoders = Mix_GetNumMusicDecoders(); + int i = 0; + printf("%s\n", "chunk decoders:"); + for (i = 0; i < num_chunk_decoders; ++i) + printf("\t%s\n", Mix_GetChunkDecoder(i)); + printf("%s\n", "music decoders:"); + for (i = 0; i < num_music_decoders; ++i) + printf("\t%s\n", Mix_GetMusicDecoder(i)); + Mix_CloseAudio(); + Mix_Quit(); + } + } + + return 0; +} diff --git a/recipes/sdl_mixer/cmake/test_v1_package/CMakeLists.txt b/recipes/sdl_mixer/cmake/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/sdl_mixer/cmake/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/sdl_mixer/cmake/test_v1_package/conanfile.py b/recipes/sdl_mixer/cmake/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/sdl_mixer/cmake/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/sdl_mixer/config.yml b/recipes/sdl_mixer/config.yml index 303d89a72ec25..ddf82f5ad0c18 100644 --- a/recipes/sdl_mixer/config.yml +++ b/recipes/sdl_mixer/config.yml @@ -1,3 +1,5 @@ versions: + "2.8.0": + folder: "cmake" "2.0.4": folder: "all" diff --git a/recipes/sdl_net/all/conandata.yml b/recipes/sdl_net/all/conandata.yml index d051057513001..941ee319ca346 100644 --- a/recipes/sdl_net/all/conandata.yml +++ b/recipes/sdl_net/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.0": + url: "https://github.com/libsdl-org/SDL_net/releases/download/release-2.2.0/SDL2_net-2.2.0.tar.gz" + sha256: "4e4a891988316271974ff4e9585ed1ef729a123d22c08bd473129179dc857feb" "2.0.1": url: "https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.0.1.tar.gz" sha256: "15ce8a7e5a23dafe8177c8df6e6c79b6749a03fff1e8196742d3571657609d21" diff --git a/recipes/sdl_net/all/conanfile.py b/recipes/sdl_net/all/conanfile.py index ce2f6091ea9cd..6a4d6d8994d74 100644 --- a/recipes/sdl_net/all/conanfile.py +++ b/recipes/sdl_net/all/conanfile.py @@ -43,7 +43,7 @@ def layout(self): def requirements(self): # SDL_net.h includes SDL.h, SDL_endian.h and SDL_version.h - self.requires("sdl/2.28.2", transitive_headers=True) + self.requires("sdl/2.28.5", transitive_headers=True) def validate(self): if Version(self.version).major != Version(self.dependencies["sdl"].ref.version).major: @@ -65,7 +65,8 @@ def build(self): cmake.build() def package(self): - copy(self, "COPYING.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + license_file = "COPYING.txt" if Version(self.version) < "2.2.0" else "LICENSE.txt" + copy(self, license_file, self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() diff --git a/recipes/sdl_net/all/test_package/conanfile.py b/recipes/sdl_net/all/test_package/conanfile.py index 3a507f665d331..4c58e9c67e01f 100644 --- a/recipes/sdl_net/all/test_package/conanfile.py +++ b/recipes/sdl_net/all/test_package/conanfile.py @@ -14,7 +14,7 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("sdl/2.28.2") + self.requires("sdl/2.28.5") def build(self): cmake = CMake(self) diff --git a/recipes/sdl_net/config.yml b/recipes/sdl_net/config.yml index bb7eb85dfac49..0323e9f109615 100644 --- a/recipes/sdl_net/config.yml +++ b/recipes/sdl_net/config.yml @@ -1,3 +1,5 @@ versions: + "2.2.0": + folder: all "2.0.1": folder: all diff --git a/recipes/sdl_ttf/all/test_package/OpenSans-Bold.ttf b/recipes/sdl_ttf/all/test_package/OpenSans-Bold.ttf deleted file mode 100644 index fd79d43bea029..0000000000000 Binary files a/recipes/sdl_ttf/all/test_package/OpenSans-Bold.ttf and /dev/null differ diff --git a/recipes/sdl_ttf/all/test_package/conanfile.py b/recipes/sdl_ttf/all/test_package/conanfile.py index c4fdfb4dbdc98..0a6bc68712d90 100644 --- a/recipes/sdl_ttf/all/test_package/conanfile.py +++ b/recipes/sdl_ttf/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - ttf_path = os.path.join(self.source_folder, "OpenSans-Bold.ttf") - self.run(f"{bin_path} {ttf_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/sdl_ttf/all/test_package/test_package.c b/recipes/sdl_ttf/all/test_package/test_package.c index 2050bc43e4215..20d9fde4b5f07 100644 --- a/recipes/sdl_ttf/all/test_package/test_package.c +++ b/recipes/sdl_ttf/all/test_package/test_package.c @@ -4,23 +4,11 @@ #include int main(int argc, char **argv) { - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return 1; - } - if (TTF_Init() == -1) { fprintf(stderr, "Failed to initialize TTF: %s\n", SDL_GetError()); return 1; } - TTF_Font *font = TTF_OpenFont(argv[1], 16); - - if (font == NULL) { - fprintf(stderr, "Failed to load font: %s\n", SDL_GetError()); - return 1; - } - printf("SDL2_ttf is working!\n"); return 0; diff --git a/recipes/sdl_ttf/all/test_v1_package/conanfile.py b/recipes/sdl_ttf/all/test_v1_package/conanfile.py index 7b775db727c08..38f4483872d47 100644 --- a/recipes/sdl_ttf/all/test_v1_package/conanfile.py +++ b/recipes/sdl_ttf/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - ttf_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") - self.run(f"{bin_path} {ttf_path}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/sentry-native/all/conandata.yml b/recipes/sentry-native/all/conandata.yml index 6bde257712f1a..9e305b2ec5e67 100644 --- a/recipes/sentry-native/all/conandata.yml +++ b/recipes/sentry-native/all/conandata.yml @@ -1,23 +1,16 @@ sources: - "0.7.0": - url: "https://github.com/getsentry/sentry-native/releases/download/0.7.0/sentry-native.zip" - sha256: "4dfccc879a81771b9da1c335947ffc9e5987ca3d16b3035efa2c66a06f727543" + "0.7.6": + url: "https://github.com/getsentry/sentry-native/releases/download/0.7.6/sentry-native.zip" + sha256: "42180ad933a3a2bd86a1649ed0f1a41df20e783ce17c5cb1f86775f7caf06bc1" + "0.7.5": + url: "https://github.com/getsentry/sentry-native/releases/download/0.7.5/sentry-native.zip" + sha256: "d9f1b44753fae3e9462aa1e6fd3021cb0ff2f51c1a1fa02b34510e3bc311f429" + "0.7.4": + url: "https://github.com/getsentry/sentry-native/releases/download/0.7.4/sentry-native.zip" + sha256: "9d17961d91c845ad8eb6f5106b2f5930f24a6e64077d7432013d4b379a8db7ac" "0.6.6": url: "https://github.com/getsentry/sentry-native/releases/download/0.6.6/sentry-native.zip" sha256: "7a98467c0b2571380a3afc5e681cb13aa406a709529be12d74610b0015ccde0c" - "0.6.5": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.5/sentry-native.zip" - sha256: "5f74a5c5c3abc6e1e7825d3306be9e3b3fd4e0f586f3cf7e86607d6f56a71995" - "0.6.4": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.4/sentry-native.zip" - sha256: "e00278bf9a4821bb4008985a5a552a84aba6ebb06d3f9e828082fcbf06b04a38" "0.5.4": url: "https://github.com/getsentry/sentry-native/releases/download/0.5.4/sentry-native.zip" sha256: "e151bdc76894eb964ba4637361b2a96b7447fb04212053cf695fd7f72b636e4d" - -patches: - "0.6.5": - - patch_file: "patches/0.6.5-0001-fix-for-gcc13.patch" - patch_type: "backport" - patch_description: "Extra header required for gcc13" - patch_source: "https://chromium-review.googlesource.com/c/chromium/mini_chromium/+/4847514" diff --git a/recipes/sentry-native/all/conanfile.py b/recipes/sentry-native/all/conanfile.py index f783754fae680..2f31f5efdc35b 100644 --- a/recipes/sentry-native/all/conanfile.py +++ b/recipes/sentry-native/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.files import copy, get, rm, rmdir from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os @@ -66,9 +66,6 @@ def _minimum_compilers_version(self): "apple-clang": "5.1", } - def export_sources(self): - export_conandata_patches(self) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -162,7 +159,6 @@ def generate(self): CMakeDeps(self).generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/sentry-native/all/patches/0.6.5-0001-fix-for-gcc13.patch b/recipes/sentry-native/all/patches/0.6.5-0001-fix-for-gcc13.patch deleted file mode 100644 index b3a766009b3a7..0000000000000 --- a/recipes/sentry-native/all/patches/0.6.5-0001-fix-for-gcc13.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/external/crashpad/third_party/mini_chromium/mini_chromium/base/logging.h 2023-08-25 09:55:27.677142704 +0800 -+++ b/external/crashpad/third_party/mini_chromium/mini_chromium/base/logging.h 2023-08-25 10:06:01.654142494 +0800 -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - - #include "base/check.h" - #include "base/check_op.h" ---- a/external/crashpad/third_party/mini_chromium/mini_chromium/base/strings/utf_string_conversion_utils.h 2023-08-25 10:11:28.084886020 +0800 -+++ b/external/crashpad/third_party/mini_chromium/mini_chromium/base/strings/utf_string_conversion_utils.h 2023-08-25 11:06:37.044297949 +0800 -@@ -6,6 +6,7 @@ - #define MINI_CHROMIUM_BASE_STRINGS_UTF_STRING_CONVERSION_UTILS_H_ - - #include -+#include - - namespace base { - diff --git a/recipes/sentry-native/config.yml b/recipes/sentry-native/config.yml index 456ef7af835a5..5e508311ba38c 100644 --- a/recipes/sentry-native/config.yml +++ b/recipes/sentry-native/config.yml @@ -1,11 +1,11 @@ versions: - "0.7.0": + "0.7.6": folder: all - "0.6.6": + "0.7.5": folder: all - "0.6.5": + "0.7.4": folder: all - "0.6.4": + "0.6.6": folder: all "0.5.4": folder: all diff --git a/recipes/sfl/all/conandata.yml b/recipes/sfl/all/conandata.yml index b4d8ce3303e28..915488f13fa26 100644 --- a/recipes/sfl/all/conandata.yml +++ b/recipes/sfl/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "1.7.0": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.7.0.tar.gz" + sha256: "9e09bacc51cfb085c4a6030f90cbea45685de608900d6b7b3c0a9f4971682652" + "1.6.0": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.6.0.tar.gz" + sha256: "f5121d95c2f3922da4f1cec9bb6045d8733892ddc55ee3c47c99e761e5df5ec4" + "1.5.0": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.5.0.tar.gz" + sha256: "767d9b3627540071d2a80f18f034d80d6e9eaffc027876c7898c51aeebd3bf37" + "1.4.0": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.4.0.tar.gz" + sha256: "dcdc6c40a60116075910e3321fe12065142d78f4947826aac263ade1d84d449a" + "1.3.1": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.3.1.tar.gz" + sha256: "e541857067ae3e6c8d9933736e70ef92c1ce0a0e374872497328edd2e4e47ae9" "1.3.0": url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.3.0.tar.gz" sha256: "1d0e797c5e11bbc861f9f1ae8eb7d9378d456d6cd1c43e00cdec6d3664e745e6" diff --git a/recipes/sfl/config.yml b/recipes/sfl/config.yml index 5f304ccdf5f5a..1001b75a17a81 100644 --- a/recipes/sfl/config.yml +++ b/recipes/sfl/config.yml @@ -1,4 +1,14 @@ versions: + "1.7.0": + folder: "all" + "1.6.0": + folder: "all" + "1.5.0": + folder: "all" + "1.4.0": + folder: "all" + "1.3.1": + folder: "all" "1.3.0": folder: "all" "1.2.4": diff --git a/recipes/shaderc/all/CMakeLists.txt b/recipes/shaderc/all/CMakeLists.txt deleted file mode 100644 index 4d393c7a86c09..0000000000000 --- a/recipes/shaderc/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/shaderc/all/conandata.yml b/recipes/shaderc/all/conandata.yml index 36e3a9f3b6b76..f866b68a84277 100644 --- a/recipes/shaderc/all/conandata.yml +++ b/recipes/shaderc/all/conandata.yml @@ -1,16 +1,28 @@ sources: + "2023.6": + url: "https://github.com/google/shaderc/archive/refs/tags/v2023.6.tar.gz" + sha256: "e40fd4a87a56f6610e223122179f086d5c4f11a7e0e2aa461f0325c3a0acc6ae" "2021.1": url: "https://github.com/google/shaderc/archive/v2021.1.tar.gz" sha256: "047113bc4628da164a3cb845efc20d442728873f6054a68ab56d04a053f2c32b" - "2019.0": - url: "https://github.com/google/shaderc/archive/v2019.0.tar.gz" - sha256: "1018cd02be52295272fdbffa056ee24b881be277c83d039ad554d91230f4e11b" patches: + "2023.6": + - patch_file: "patches/2023.6/use-conan-dependencies.patch" + patch_description: "Replace third_party with Conan dependencies" + patch_type: "conan" + - patch_file: "patches/2021.1/adapt-update_build_version.py.patch" + patch_description: "Adapt update_build_version.py for Conan" + patch_type: "conan" + - patch_file: "patches/2021.1/install-shaderc_util.patch" + patch_description: "install() shaderc_util" + patch_type: "conan" "2021.1": - - patch_file: "patches/2021.1/fix-cmake.patch" - base_path: "source_subfolder" - "2019.0": - - patch_file: "patches/2019.0/fix-cmake.patch" - base_path: "source_subfolder" - - patch_file: "patches/2019.0/fix-spvc.patch" - base_path: "source_subfolder" + - patch_file: "patches/2021.1/use-conan-dependencies.patch" + patch_description: "Replace third_party with Conan dependencies" + patch_type: "conan" + - patch_file: "patches/2021.1/adapt-update_build_version.py.patch" + patch_description: "Adapt update_build_version.py for Conan" + patch_type: "conan" + - patch_file: "patches/2021.1/install-shaderc_util.patch" + patch_description: "install() shaderc_util" + patch_type: "conan" diff --git a/recipes/shaderc/all/conanfile.py b/recipes/shaderc/all/conanfile.py index 431f1292c6d2f..80efeb3ed4b4e 100644 --- a/recipes/shaderc/all/conanfile.py +++ b/recipes/shaderc/all/conanfile.py @@ -1,131 +1,136 @@ -from conans import ConanFile, CMake, tools import os -required_conan_version = ">=1.36.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime + +required_conan_version = ">=1.53.0" class ShadercConan(ConanFile): name = "shaderc" description = "A collection of tools, libraries and tests for shader compilation." license = "Apache-2.0" - topics = ("glsl", "hlsl", "msl", "spirv", "spir-v", "glslc", "spvc") - homepage = "https://github.com/google/shaderc" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/shaderc" + topics = ("glsl", "hlsl", "msl", "spirv", "spir-v", "glslc") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "spvc": [True, False], } default_options = { "shared": False, "fPIC": True, - "spvc": False, } - generators = "cmake" - _cmake = None - - @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": del self.options.fPIC - if tools.Version(self.version) >= "2020.4": - del self.options.spvc def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") - @property - def _get_compatible_spirv_tools_version(self): - return { - "2021.1": "2021.2", - "2019.0": "2020.5" - }.get(str(self.version), False) + def layout(self): + cmake_layout(self, src_folder="src") @property - def _get_compatible_glslang_version(self): + def _spirv_version(self): return { - "2021.1": "11.5.0", - "2019.0": "8.13.3559" - }.get(str(self.version), False) + # TODO: bump me once newer versions are available on CCI + # "2023.6": "1.3.261.1", + "2023.6": "1.3.239.0", + "2021.1": "1.3.224.0", + }[str(self.version)] def requirements(self): - self.requires("glslang/{}".format(self._get_compatible_glslang_version)) - self.requires("spirv-tools/{}".format(self._get_compatible_spirv_tools_version)) - if self.options.get_safe("spvc", False): - self.requires("spirv-cross/20210115") + # transitive_headers=True is not required for any of the dependencies + self.requires(f"glslang/{self._spirv_version}") + self.requires(f"spirv-tools/{self._spirv_version}") + self.requires(f"spirv-headers/{self._spirv_version}") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.17.2 <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 generate(self): + venv = VirtualBuildEnv(self) + venv.generate() + + tc = CMakeToolchain(self) + tc.cache_variables["SHADERC_SKIP_INSTALL"] = False + tc.cache_variables["SHADERC_SKIP_EXAMPLES"] = True + tc.cache_variables["SHADERC_SKIP_TESTS"] = True + tc.cache_variables["ENABLE_CODE_COVERAGE"] = False + tc.cache_variables["SHADERC_ENABLE_WERROR_COMPILE"] = False + if is_msvc(self): + tc.cache_variables["SHADERC_ENABLE_SHARED_CRT"] = not is_msvc_static_runtime(self) + tc.generate() + + self.dependencies["glslang"].cpp_info.components["glslang-core"].includedirs.append( + os.path.join(self.dependencies["glslang"].package_folder, "include", "glslang") + ) + + deps = CMakeDeps(self) + deps.set_property("glslang::glslang-core", "cmake_target_name", "glslang") + deps.set_property("glslang::osdependent", "cmake_target_name", "OSDependent") + deps.set_property("glslang::oglcompiler", "cmake_target_name", "OGLCompiler") + deps.set_property("glslang::hlsl", "cmake_target_name", "HLSL") + deps.set_property("glslang::spirv", "cmake_target_name", "SPIRV") + 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 _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) - self._cmake.definitions["SHADERC_ENABLE_SPVC"] = self.options.get_safe("spvc", False) - self._cmake.definitions["SHADERC_SKIP_INSTALL"] = False - self._cmake.definitions["SHADERC_SKIP_TESTS"] = True - self._cmake.definitions["SHADERC_SPVC_ENABLE_DIRECT_LOGGING"] = False - self._cmake.definitions["SHADERC_SPVC_DISABLE_CONTEXT_LOGGING"] = False - self._cmake.definitions["SHADERC_ENABLE_WERROR_COMPILE"] = False - if self.settings.compiler == "Visual Studio": - self._cmake.definitions["SHADERC_ENABLE_SHARED_CRT"] = str(self.settings.compiler.runtime).startswith("MD") - self._cmake.definitions["ENABLE_CODE_COVERAGE"] = False - if tools.is_apple_os(self.settings.os): - self._cmake.definitions["CMAKE_MACOSX_BUNDLE"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.set_property("pkg_config_name", "shaderc" if self.options.shared else "shaderc_static") - self.cpp_info.libs = self._get_ordered_libs() - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") - if not self.options.shared and tools.stdcpp_library(self): - self.cpp_info.system_libs.append(tools.stdcpp_library(self)) if self.options.shared: + self.cpp_info.set_property("pkg_config_name", "shaderc") + self.cpp_info.libs = ["shaderc_shared"] self.cpp_info.defines.append("SHADERC_SHAREDLIB") + else: + self.cpp_info.set_property("pkg_config_name", "shaderc_static") + self.cpp_info.libs = ["shaderc", "shaderc_util"] + if stdcpp_library(self): + self.cpp_info.system_libs.append(stdcpp_library(self)) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + self.cpp_info.requires = [ + "glslang::glslang-core", + "glslang::osdependent", + "glslang::oglcompiler", + "glslang::hlsl", + "glslang::spirv", + "spirv-tools::spirv-tools-core", + "spirv-tools::spirv-tools-opt", + "spirv-headers::spirv-headers" + ] + + # TODO: to remove in conan v2 bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) self.env_info.PATH.append(bin_path) - - def _get_ordered_libs(self): - libs = ["shaderc_shared" if self.options.shared else "shaderc"] - if not self.options.shared: - libs.append("shaderc_util") - if self.options.get_safe("spvc", False): - libs.append("shaderc_spvc_shared" if self.options.shared else "shaderc_spvc") - return libs diff --git a/recipes/shaderc/all/patches/2019.0/fix-cmake.patch b/recipes/shaderc/all/patches/2019.0/fix-cmake.patch deleted file mode 100644 index 1fee3bf35ecf3..0000000000000 --- a/recipes/shaderc/all/patches/2019.0/fix-cmake.patch +++ /dev/null @@ -1,402 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -70,7 +70,6 @@ endif(MSVC) - - # Configure subdirectories. - # We depend on these for later projects, so they should come first. --add_subdirectory(third_party) - - if(SHADERC_ENABLE_SPVC) - add_subdirectory(libshaderc_spvc) -@@ -79,12 +78,11 @@ endif() - add_subdirectory(libshaderc_util) - add_subdirectory(libshaderc) - add_subdirectory(glslc) --add_subdirectory(examples) - - add_custom_target(build-version - ${PYTHON_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/utils/update_build_version.py -- ${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR} -+ ${shaderc_SOURCE_DIR} - COMMENT "Update build-version.inc in the Shaderc build directory (if necessary).") - - function(define_pkg_config_file NAME LIBS) ---- a/cmake/utils.cmake -+++ b/cmake/utils.cmake -@@ -11,7 +11,6 @@ function(shaderc_default_c_compile_options TARGET) - if (NOT "${MSVC}") - target_compile_options(${TARGET} PRIVATE -Wall -Werror -fvisibility=hidden) - if (NOT "${MINGW}") -- target_compile_options(${TARGET} PRIVATE -fPIC) - endif() - if (ENABLE_CODE_COVERAGE) - # The --coverage option is a synonym for -fprofile-arcs -ftest-coverage -@@ -24,10 +23,6 @@ function(shaderc_default_c_compile_options TARGET) - endif() - if (NOT SHADERC_ENABLE_SHARED_CRT) - if (WIN32) -- # For MinGW cross compile, statically link to the libgcc runtime. -- # But it still depends on MSVCRT.dll. -- set_target_properties(${TARGET} PROPERTIES -- LINK_FLAGS "-static -static-libgcc") - endif(WIN32) - endif(NOT SHADERC_ENABLE_SHARED_CRT) - else() -@@ -40,13 +35,8 @@ endfunction(shaderc_default_c_compile_options) - function(shaderc_default_compile_options TARGET) - shaderc_default_c_compile_options(${TARGET}) - if (NOT "${MSVC}") -- target_compile_options(${TARGET} PRIVATE -std=c++11) - if (NOT SHADERC_ENABLE_SHARED_CRT) - if (WIN32) -- # For MinGW cross compile, statically link to the C++ runtime. -- # But it still depends on MSVCRT.dll. -- set_target_properties(${TARGET} PROPERTIES -- LINK_FLAGS "-static -static-libgcc -static-libstdc++") - endif(WIN32) - endif(NOT SHADERC_ENABLE_SHARED_CRT) - endif() ---- a/glslc/CMakeLists.txt -+++ b/glslc/CMakeLists.txt -@@ -16,31 +16,19 @@ add_library(glslc STATIC - ) - - shaderc_default_compile_options(glslc) --target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR}) --target_link_libraries(glslc PRIVATE glslang OSDependent OGLCompiler -- HLSL glslang SPIRV ${CMAKE_THREAD_LIBS_INIT}) --target_link_libraries(glslc PRIVATE shaderc_util shaderc) -+target_link_libraries(glslc PRIVATE ${CMAKE_THREAD_LIBS_INIT}) -+target_link_libraries(glslc PUBLIC shaderc_util shaderc) - - add_executable(glslc_exe src/main.cc) - shaderc_default_compile_options(glslc_exe) --target_include_directories(glslc_exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/.. ${spirv-tools_SOURCE_DIR}/include) -+target_include_directories(glslc_exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/..) - set_target_properties(glslc_exe PROPERTIES OUTPUT_NAME glslc) --target_link_libraries(glslc_exe PRIVATE glslc shaderc_util shaderc) -+target_link_libraries(glslc_exe PRIVATE glslc shaderc_util shaderc CONAN_PKG::spirv-tools) - add_dependencies(glslc_exe build-version) - --shaderc_add_tests( -- TEST_PREFIX glslc -- LINK_LIBS glslc shaderc_util shaderc -- TEST_NAMES -- file -- resource_parse -- stage) -- - shaderc_add_asciidoc(glslc_doc_README README) - - if(SHADERC_ENABLE_INSTALL) - install(TARGETS glslc_exe - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif(SHADERC_ENABLE_INSTALL) -- --add_subdirectory(test) ---- a/libshaderc/CMakeLists.txt -+++ b/libshaderc/CMakeLists.txt -@@ -10,18 +10,16 @@ set(SHADERC_SOURCES - src/shaderc_private.h - ) - --add_library(shaderc STATIC ${SHADERC_SOURCES}) -+add_library(shaderc ${SHADERC_SOURCES}) - shaderc_default_compile_options(shaderc) --target_include_directories(shaderc PUBLIC include PRIVATE ${glslang_SOURCE_DIR}) -- --add_library(shaderc_shared SHARED ${SHADERC_SOURCES}) --shaderc_default_compile_options(shaderc_shared) --target_include_directories(shaderc_shared PUBLIC include PRIVATE ${glslang_SOURCE_DIR}) --target_compile_definitions(shaderc_shared -- PRIVATE SHADERC_IMPLEMENTATION -- PUBLIC SHADERC_SHAREDLIB --) --set_target_properties(shaderc_shared PROPERTIES SOVERSION 1) -+target_include_directories(shaderc PUBLIC include) -+if(BUILD_SHARED_LIBS) -+ target_compile_definitions(shaderc -+ PRIVATE SHADERC_IMPLEMENTATION -+ PUBLIC SHADERC_SHAREDLIB -+ ) -+ set_target_properties(shaderc PROPERTIES OUTPUT_NAME "shaderc_shared" SOVERSION 1) -+endif() - - if(SHADERC_ENABLE_INSTALL) - install( -@@ -34,70 +32,19 @@ if(SHADERC_ENABLE_INSTALL) - DESTINATION - ${CMAKE_INSTALL_INCLUDEDIR}/shaderc) - -- install(TARGETS shaderc shaderc_shared -+ install(TARGETS shaderc - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(SHADERC_ENABLE_INSTALL) - --find_package(Threads) - set(SHADERC_LIBS -- glslang OSDependent OGLCompiler glslang ${CMAKE_THREAD_LIBS_INIT} - shaderc_util -- SPIRV # from glslang -- SPIRV-Tools -+ "CONAN_PKG::glslang" -+ "CONAN_PKG::spirv-tools" - ) - - target_link_libraries(shaderc PRIVATE ${SHADERC_LIBS}) --target_link_libraries(shaderc_shared PRIVATE ${SHADERC_LIBS}) -- --shaderc_add_tests( -- TEST_PREFIX shaderc -- LINK_LIBS shaderc -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- TEST_NAMES -- shaderc -- shaderc_cpp -- shaderc_private) -- --shaderc_add_tests( -- TEST_PREFIX shaderc_shared -- LINK_LIBS shaderc_shared SPIRV-Tools -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- TEST_NAMES -- shaderc -- shaderc_cpp -- shaderc_private) -- --shaderc_combine_static_lib(shaderc_combined shaderc) -- --if(SHADERC_ENABLE_INSTALL) -- # Since shaderc_combined is defined as an imported library, we cannot use the -- # install() directive to install it. Install it like a normal file. -- get_target_property(generated_location shaderc_combined LOCATION) -- string(REGEX MATCH "Visual Studio .*" vs_generator "${CMAKE_GENERATOR}") -- if (NOT "${vs_generator}" STREQUAL "") -- # With Visual Studio generators, the LOCATION property is not properly -- # expanded according to the current build configuration. We need to work -- # around this problem by manually substitution. -- string(REPLACE "$(Configuration)" "\${CMAKE_INSTALL_CONFIG_NAME}" -- install_location "${generated_location}") -- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${install_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- else() -- install(FILES ${generated_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- endif() --endif(SHADERC_ENABLE_INSTALL) -- --shaderc_add_tests( -- TEST_PREFIX shaderc_combined -- LINK_LIBS shaderc_combined ${CMAKE_THREAD_LIBS_INIT} -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- TEST_NAMES -- shaderc -- shaderc_cpp) - - if(${SHADERC_ENABLE_TESTS}) - add_executable(shaderc_c_smoke_test ./src/shaderc_c_smoke_test.c) ---- a/libshaderc_spvc/CMakeLists.txt -+++ b/libshaderc_spvc/CMakeLists.txt -@@ -9,26 +9,22 @@ set(SPVC_SOURCES - src/spvc.cc - ) - --add_library(shaderc_spvc STATIC ${SPVC_SOURCES}) -+add_library(shaderc_spvc ${SPVC_SOURCES}) - shaderc_default_compile_options(shaderc_spvc) --target_include_directories(shaderc_spvc PUBLIC include PRIVATE ${shaderc_SOURCE_DIR}/libshaderc/include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${spirv-tools_SOURCE_DIR}/include ${SPIRV-Cross_SOURCE_DIR}/..) -- --add_library(shaderc_spvc_shared SHARED ${SPVC_SOURCES}) --shaderc_default_compile_options(shaderc_spvc_shared) --target_include_directories(shaderc_spvc_shared PUBLIC include PRIVATE ${shaderc_SOURCE_DIR}/libshaderc/include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${spirv-tools_SOURCE_DIR}/include ${SPIRV-Cross_SOURCE_DIR}/..) -- --target_compile_definitions(shaderc_spvc_shared -- PRIVATE SHADERC_IMPLEMENTATION -- PUBLIC SHADERC_SHAREDLIB --) -+target_include_directories(shaderc_spvc -+ PUBLIC include ${shaderc_SOURCE_DIR}/libshaderc/include PRIVATE ${shaderc_SOURCE_DIR}/libshaderc_util/include) -+if(BUILD_SHARED_LIBS) -+ target_compile_definitions(shaderc_spvc -+ PRIVATE SHADERC_IMPLEMENTATION -+ PUBLIC SHADERC_SHAREDLIB -+ ) -+ set_target_properties(shaderc_spvc PROPERTIES OUTPUT_NAME "shaderc_spvc_shared" SOVERSION 1) -+endif() - - if (DISABLE_EXCEPTIONS) - target_compile_definitions(shaderc_spvc PRIVATE SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS) -- target_compile_definitions(shaderc_spvc_shared PRIVATE SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS) - endif (DISABLE_EXCEPTIONS) - --set_target_properties(shaderc_spvc_shared PROPERTIES SOVERSION 1) -- - if(SHADERC_ENABLE_INSTALL) - install( - FILES -@@ -37,71 +33,18 @@ if(SHADERC_ENABLE_INSTALL) - DESTINATION - ${CMAKE_INSTALL_INCLUDEDIR}/shaderc) - -- install(TARGETS shaderc_spvc shaderc_spvc_shared -+ install(TARGETS shaderc_spvc - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(SHADERC_ENABLE_INSTALL) - --find_package(Threads) - set(SPVC_LIBS -- ${CMAKE_THREAD_LIBS_INIT} -- SPIRV-Tools -- SPIRV-Tools-opt -- spirv-cross-glsl -- spirv-cross-hlsl -- spirv-cross-msl -+ "CONAN_PKG::spirv-cross" -+ "CONAN_PKG::spirv-tools" - ) - - target_link_libraries(shaderc_spvc PRIVATE ${SPVC_LIBS}) --target_link_libraries(shaderc_spvc_shared PRIVATE ${SPVC_LIBS}) -- --shaderc_add_tests( -- TEST_PREFIX shaderc -- LINK_LIBS shaderc_spvc -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc/include ${SPIRV-Cross_SOURCE_DIR}/.. -- TEST_NAMES -- spvc -- spvc_cpp -- spvc_webgpu -- spvc_webgpu_cpp) -- --shaderc_add_tests( -- TEST_PREFIX shaderc_shared -- LINK_LIBS shaderc_spvc_shared SPIRV-Tools SPIRV-Tools-opt -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc/include ${SPIRV-Cross_SOURCE_DIR}/.. -- TEST_NAMES -- spvc -- spvc_cpp -- spvc_webgpu -- spvc_webgpu_cpp) -- --shaderc_combine_static_lib(shaderc_spvc_combined shaderc_spvc) -- --if(SHADERC_ENABLE_INSTALL) -- # Since shaderc_combined is defined as an imported library, we cannot use the -- # install() directive to install it. Install it like a normal file. -- get_target_property(generated_location shaderc_spvc_combined LOCATION) -- string(REGEX MATCH "Visual Studio .*" vs_generator "${CMAKE_GENERATOR}") -- if (NOT "${vs_generator}" STREQUAL "") -- # With Visual Studio generators, the LOCATION property is not properly -- # expanded according to the current build configuration. We need to work -- # around this problem by manually substitution. -- string(REPLACE "$(Configuration)" "\${CMAKE_INSTALL_CONFIG_NAME}" -- install_location "${generated_location}") -- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${install_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- else() -- install(FILES ${generated_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- endif() --endif(SHADERC_ENABLE_INSTALL) -- --shaderc_add_tests( -- TEST_PREFIX shaderc_spvc_combined -- LINK_LIBS shaderc_spvc_combined ${CMAKE_THREAD_LIBS_INIT} shaderc_util -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc/include ${spirv-tools_SOURCE_DIR}/include -- TEST_NAMES -- spvc -- spvc_cpp) - - if(${SHADERC_ENABLE_TESTS}) - add_executable(spvc_c_smoke_test ./src/spvc_smoke_test_util.c ./src/spvc_c_smoke_test.c) ---- a/libshaderc_util/CMakeLists.txt -+++ b/libshaderc_util/CMakeLists.txt -@@ -24,25 +24,20 @@ add_library(shaderc_util STATIC - - shaderc_default_compile_options(shaderc_util) - target_include_directories(shaderc_util -- PUBLIC include PRIVATE ${glslang_SOURCE_DIR}) -+ PUBLIC include) - - find_package(Threads) --target_link_libraries(shaderc_util PRIVATE -- glslang OSDependent OGLCompiler HLSL glslang SPIRV -- SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT}) -- --shaderc_add_tests( -- TEST_PREFIX shaderc_util -- LINK_LIBS shaderc_util -- TEST_NAMES -- counting_includer -- string_piece -- format -- file_finder -- io -- message -- mutex -- version_profile) -+target_link_libraries(shaderc_util PUBLIC -+ CONAN_PKG::glslang -+ CONAN_PKG::spirv-tools -+ ${CMAKE_THREAD_LIBS_INIT}) -+ -+if(SHADERC_ENABLE_INSTALL AND NOT BUILD_SHARED_LIBS) -+ install(TARGETS shaderc_util -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+endif(SHADERC_ENABLE_INSTALL) - - if(${SHADERC_ENABLE_TESTS}) - target_include_directories(shaderc_util_counting_includer_test -@@ -51,15 +46,6 @@ if(${SHADERC_ENABLE_TESTS}) - PRIVATE ${glslang_SOURCE_DIR}) - endif() - --shaderc_add_tests( -- TEST_PREFIX shaderc_util -- LINK_LIBS shaderc_util -- INCLUDE_DIRS -- ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- TEST_NAMES -- compiler) -- - # This target copies content of testdata into the build directory. - add_custom_target(testdata COMMAND - ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/testdata/copy-to-build.cmake ---- a/spvc/CMakeLists.txt -+++ b/spvc/CMakeLists.txt -@@ -1,8 +1,8 @@ - add_executable(spvc_exe src/main.cc) - shaderc_default_compile_options(spvc_exe) --target_include_directories(spvc_exe PRIVATE ${shaderc_SOURCE_DIR}/libshaderc/include ${spirv-tools_SOURCE_DIR}/include) -+target_include_directories(spvc_exe PRIVATE ${shaderc_SOURCE_DIR}/libshaderc/include) - set_target_properties(spvc_exe PROPERTIES OUTPUT_NAME spvc) --target_link_libraries(spvc_exe PRIVATE shaderc_spvc shaderc_util) -+target_link_libraries(spvc_exe PRIVATE shaderc_spvc shaderc_util CONAN_PKG::spirv-tools) - add_dependencies(spvc_exe build-version) - - shaderc_add_asciidoc(spvc_doc_README README) ---- a/utils/update_build_version.py -+++ b/utils/update_build_version.py -@@ -114,12 +114,12 @@ def get_version_string(project, directory): - - - def main(): -- if len(sys.argv) != 4: -- print('usage: {} '.format( -+ if len(sys.argv) != 2: -+ print('usage: {} '.format( - sys.argv[0])) - sys.exit(1) - -- projects = ['shaderc', 'spirv-tools', 'glslang'] -+ projects = ['shaderc'] - new_content = ''.join([ - '"{}\\n"\n'.format(get_version_string(p, d)) - for (p, d) in zip(projects, sys.argv[1:]) diff --git a/recipes/shaderc/all/patches/2019.0/fix-spvc.patch b/recipes/shaderc/all/patches/2019.0/fix-spvc.patch deleted file mode 100644 index 682a95ac5deb9..0000000000000 --- a/recipes/shaderc/all/patches/2019.0/fix-spvc.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/libshaderc_spvc/src/spvc.cc -+++ b/libshaderc_spvc/src/spvc.cc -@@ -15,9 +15,9 @@ - #include "shaderc/spvc.h" - - #include "libshaderc_util/exceptions.h" --#include "spirv-cross/spirv_glsl.hpp" --#include "spirv-cross/spirv_hlsl.hpp" --#include "spirv-cross/spirv_msl.hpp" -+#include "spirv_glsl.hpp" -+#include "spirv_hlsl.hpp" -+#include "spirv_msl.hpp" - #include "spirv-tools/libspirv.hpp" - #include "spirv-tools/optimizer.hpp" - -@@ -169,7 +169,7 @@ size_t shaderc_spvc_compile_options_set_for_fuzzing( - shaderc_spvc_compile_options_t options, const uint8_t* data, size_t size) { - if (!data || size < sizeof(*options)) return 0; - -- memcpy(options, data, sizeof(*options)); -+ memcpy(static_cast(options), data, sizeof(*options)); - return sizeof(*options); - } - diff --git a/recipes/shaderc/all/patches/2021.1/adapt-update_build_version.py.patch b/recipes/shaderc/all/patches/2021.1/adapt-update_build_version.py.patch new file mode 100644 index 0000000000000..a53d4b7300f53 --- /dev/null +++ b/recipes/shaderc/all/patches/2021.1/adapt-update_build_version.py.patch @@ -0,0 +1,25 @@ +diff --git a/utils/update_build_version.py b/utils/update_build_version.py +--- a/utils/update_build_version.py ++++ b/utils/update_build_version.py +@@ -128,18 +128,18 @@ + + + def main(): +- if len(sys.argv) != 5: ++ if len(sys.argv) < 5: + print(('usage: {} '.format( + sys.argv[0]))) + sys.exit(1) + +- projects = ['shaderc', 'spirv-tools', 'glslang'] ++ projects = ['shaderc'] + new_content = ''.join([ + '"{}\\n"\n'.format(get_version_string(p, d)) + for (p, d) in zip(projects, sys.argv[1:]) + ]) + +- output_file = sys.argv[4] ++ output_file = sys.argv[-1] + mkdir_p(os.path.dirname(output_file)) + + if os.path.isfile(output_file): diff --git a/recipes/shaderc/all/patches/2021.1/fix-cmake.patch b/recipes/shaderc/all/patches/2021.1/fix-cmake.patch deleted file mode 100644 index ac2fd7ef1015f..0000000000000 --- a/recipes/shaderc/all/patches/2021.1/fix-cmake.patch +++ /dev/null @@ -1,324 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0c8d1ae..4f4e6e0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -112,19 +112,16 @@ endif(MSVC) - - # Configure subdirectories. - # We depend on these for later projects, so they should come first. --add_subdirectory(third_party) -+ - - add_subdirectory(libshaderc_util) - add_subdirectory(libshaderc) - add_subdirectory(glslc) --if(${SHADERC_ENABLE_EXAMPLES}) -- add_subdirectory(examples) --endif() - - add_custom_target(build-version - ${PYTHON_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/utils/update_build_version.py -- ${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/build-version.inc -+ ${shaderc_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/build-version.inc - COMMENT "Update build-version.inc in the Shaderc build directory (if necessary).") - - function(define_pkg_config_file NAME LIBS) -diff --git a/cmake/utils.cmake b/cmake/utils.cmake -index d64757d..0adc008 100644 ---- a/cmake/utils.cmake -+++ b/cmake/utils.cmake -@@ -41,14 +41,6 @@ function(shaderc_default_c_compile_options TARGET) - # requires clang to be built with compiler-rt. - target_link_libraries(${TARGET} PRIVATE --coverage) - endif() -- if (NOT SHADERC_ENABLE_SHARED_CRT) -- if (WIN32) -- # For MinGW cross compile, statically link to the libgcc runtime. -- # But it still depends on MSVCRT.dll. -- set_target_properties(${TARGET} PROPERTIES -- LINK_FLAGS "-static -static-libgcc") -- endif(WIN32) -- endif(NOT SHADERC_ENABLE_SHARED_CRT) - else() - # disable warning C4800: 'int' : forcing value to bool 'true' or 'false' - # (performance warning) -@@ -58,17 +50,6 @@ endfunction(shaderc_default_c_compile_options) - - function(shaderc_default_compile_options TARGET) - shaderc_default_c_compile_options(${TARGET}) -- if (NOT "${MSVC}") -- target_compile_options(${TARGET} PRIVATE -std=c++11) -- if (NOT SHADERC_ENABLE_SHARED_CRT) -- if (WIN32) -- # For MinGW cross compile, statically link to the C++ runtime. -- # But it still depends on MSVCRT.dll. -- set_target_properties(${TARGET} PROPERTIES -- LINK_FLAGS "-static -static-libgcc -static-libstdc++") -- endif(WIN32) -- endif(NOT SHADERC_ENABLE_SHARED_CRT) -- endif() - endfunction(shaderc_default_compile_options) - - # Build an asciidoc file; additional arguments past the base filename specify -diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt -index 31664d1..a962c2e 100644 ---- a/glslc/CMakeLists.txt -+++ b/glslc/CMakeLists.txt -@@ -30,7 +30,6 @@ add_library(glslc STATIC - ) - - shaderc_default_compile_options(glslc) --target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR}) - - if (SHADERC_ENABLE_WGSL_OUTPUT) - if (IS_DIRECTORY "${tint_SOURCE_DIR}/include") -@@ -43,26 +42,17 @@ if (SHADERC_ENABLE_WGSL_OUTPUT) - endif(SHADERC_ENABLE_WGSL_OUTPUT) - - target_link_libraries(glslc PRIVATE -- glslang OSDependent OGLCompiler HLSL glslang SPIRV # Glslang libraries - $<$:libtint> # Tint libraries, optional - shaderc_util shaderc # internal Shaderc libraries - ${CMAKE_THREAD_LIBS_INIT}) - - add_executable(glslc_exe src/main.cc) - shaderc_default_compile_options(glslc_exe) --target_include_directories(glslc_exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/.. ${spirv-tools_SOURCE_DIR}/include) -+target_include_directories(glslc_exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/.. ${CONAN_INCLUDE_DIRS}) - set_target_properties(glslc_exe PROPERTIES OUTPUT_NAME glslc) --target_link_libraries(glslc_exe PRIVATE glslc shaderc_util shaderc) -+target_link_libraries(glslc_exe PRIVATE glslc shaderc_util shaderc CONAN_PKG::spirv-tools) - add_dependencies(glslc_exe build-version) - --shaderc_add_tests( -- TEST_PREFIX glslc -- LINK_LIBS glslc shaderc_util shaderc -- TEST_NAMES -- file -- resource_parse -- stage) -- - shaderc_add_asciidoc(glslc_doc_README README) - - if(SHADERC_ENABLE_INSTALL) -@@ -70,4 +60,3 @@ if(SHADERC_ENABLE_INSTALL) - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif(SHADERC_ENABLE_INSTALL) - --add_subdirectory(test) -diff --git a/libshaderc/CMakeLists.txt b/libshaderc/CMakeLists.txt -index 3ada419..08cf265 100644 ---- a/libshaderc/CMakeLists.txt -+++ b/libshaderc/CMakeLists.txt -@@ -24,24 +24,19 @@ set(SHADERC_SOURCES - src/shaderc_private.h - ) - --add_library(shaderc STATIC ${SHADERC_SOURCES}) -+add_library(shaderc ${SHADERC_SOURCES}) - shaderc_default_compile_options(shaderc) - target_include_directories(shaderc -- PUBLIC include -- PRIVATE ${glslang_SOURCE_DIR} -- ${SPIRV-Headers_SOURCE_DIR}/include) -+ PUBLIC include) - --add_library(shaderc_shared SHARED ${SHADERC_SOURCES}) --shaderc_default_compile_options(shaderc_shared) --target_include_directories(shaderc_shared -- PUBLIC include -- PRIVATE ${glslang_SOURCE_DIR} -- ${SPIRV-Headers_SOURCE_DIR}/include) --target_compile_definitions(shaderc_shared -- PRIVATE SHADERC_IMPLEMENTATION -- PUBLIC SHADERC_SHAREDLIB --) --set_target_properties(shaderc_shared PROPERTIES SOVERSION 1) -+target_include_directories(shaderc PUBLIC include) -+if(BUILD_SHARED_LIBS) -+ target_compile_definitions(shaderc -+ PRIVATE SHADERC_IMPLEMENTATION -+ PUBLIC SHADERC_SHAREDLIB -+ ) -+ set_target_properties(shaderc PROPERTIES OUTPUT_NAME "shaderc_shared" SOVERSION 1) -+endif() - - if(SHADERC_ENABLE_INSTALL) - install( -@@ -54,73 +49,21 @@ if(SHADERC_ENABLE_INSTALL) - DESTINATION - ${CMAKE_INSTALL_INCLUDEDIR}/shaderc) - -- install(TARGETS shaderc shaderc_shared -+ install(TARGETS shaderc - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(SHADERC_ENABLE_INSTALL) - --find_package(Threads) - set(SHADERC_LIBS -- glslang OSDependent OGLCompiler glslang ${CMAKE_THREAD_LIBS_INIT} - shaderc_util -- SPIRV # from glslang -- SPIRV-Tools -+ "CONAN_PKG::glslang" -+ "CONAN_PKG::spirv-tools" - ) - - target_link_libraries(shaderc PRIVATE ${SHADERC_LIBS}) --target_link_libraries(shaderc_shared PRIVATE ${SHADERC_LIBS}) -- --shaderc_add_tests( -- TEST_PREFIX shaderc -- LINK_LIBS shaderc -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- ${SPIRV-Headers_SOURCE_DIR}/include -- TEST_NAMES -- shaderc -- shaderc_cpp -- shaderc_private) -- --shaderc_add_tests( -- TEST_PREFIX shaderc_shared -- LINK_LIBS shaderc_shared SPIRV-Tools -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- ${SPIRV-Headers_SOURCE_DIR}/include -- TEST_NAMES -- shaderc -- shaderc_cpp -- shaderc_private) - --shaderc_combine_static_lib(shaderc_combined shaderc) -- --if(SHADERC_ENABLE_INSTALL) -- # Since shaderc_combined is defined as an imported library, we cannot use the -- # install() directive to install it. Install it like a normal file. -- get_target_property(generated_location shaderc_combined LOCATION) -- string(REGEX MATCH "Visual Studio .*" vs_generator "${CMAKE_GENERATOR}") -- if (NOT "${vs_generator}" STREQUAL "") -- # With Visual Studio generators, the LOCATION property is not properly -- # expanded according to the current build configuration. We need to work -- # around this problem by manually substitution. -- string(REPLACE "$(Configuration)" "\${CMAKE_INSTALL_CONFIG_NAME}" -- install_location "${generated_location}") -- install(FILES ${install_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- else() -- install(FILES ${generated_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- endif() --endif(SHADERC_ENABLE_INSTALL) - --shaderc_add_tests( -- TEST_PREFIX shaderc_combined -- LINK_LIBS shaderc_combined ${CMAKE_THREAD_LIBS_INIT} -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- ${SPIRV-Headers_SOURCE_DIR}/include -- TEST_NAMES -- shaderc -- shaderc_cpp) - - if(${SHADERC_ENABLE_TESTS}) - add_executable(shaderc_c_smoke_test ./src/shaderc_c_smoke_test.c) -diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt -index 99ce3c4..3eb57d5 100644 ---- a/libshaderc_util/CMakeLists.txt -+++ b/libshaderc_util/CMakeLists.txt -@@ -39,28 +39,23 @@ add_library(shaderc_util STATIC - - shaderc_default_compile_options(shaderc_util) - target_include_directories(shaderc_util -- PUBLIC include PRIVATE ${glslang_SOURCE_DIR}) -+ PUBLIC include) - # We use parts of Glslang's HLSL compilation interface, which - # now requires this preprocessor definition. - add_definitions(-DENABLE_HLSL) - - find_package(Threads) - target_link_libraries(shaderc_util PRIVATE -- glslang OSDependent OGLCompiler HLSL glslang SPIRV -- SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT}) -+ CONAN_PKG::glslang -+ CONAN_PKG::spirv-tools -+ ${CMAKE_THREAD_LIBS_INIT}) - --shaderc_add_tests( -- TEST_PREFIX shaderc_util -- LINK_LIBS shaderc_util -- TEST_NAMES -- counting_includer -- string_piece -- format -- file_finder -- io_shaderc -- message -- mutex -- version_profile) -+if(SHADERC_ENABLE_INSTALL AND NOT BUILD_SHARED_LIBS) -+ install(TARGETS shaderc_util -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+endif(SHADERC_ENABLE_INSTALL) - - if(${SHADERC_ENABLE_TESTS}) - target_include_directories(shaderc_util_counting_includer_test -@@ -69,15 +64,6 @@ if(${SHADERC_ENABLE_TESTS}) - PRIVATE ${glslang_SOURCE_DIR}) - endif() - --shaderc_add_tests( -- TEST_PREFIX shaderc_util -- LINK_LIBS shaderc_util -- INCLUDE_DIRS -- ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- TEST_NAMES -- compiler) -- - # This target copies content of testdata into the build directory. - add_custom_target(testdata COMMAND - ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/testdata/copy-to-build.cmake -diff --git a/libshaderc_util/src/compiler.cc b/libshaderc_util/src/compiler.cc -index 8a8d12b..92d8279 100644 ---- a/libshaderc_util/src/compiler.cc -+++ b/libshaderc_util/src/compiler.cc -@@ -20,7 +20,7 @@ - #include - #include - --#include "SPIRV/GlslangToSpv.h" -+#include "glslang/SPIRV/GlslangToSpv.h" - #include "libshaderc_util/format.h" - #include "libshaderc_util/io_shaderc.h" - #include "libshaderc_util/message.h" -diff --git a/utils/update_build_version.py b/utils/update_build_version.py -index 5785390..7801a02 100755 ---- a/utils/update_build_version.py -+++ b/utils/update_build_version.py -@@ -128,18 +128,18 @@ def get_version_string(project, directory): - - - def main(): -- if len(sys.argv) != 5: -- print(('usage: {} '.format( -+ if len(sys.argv) != 3: -+ print(('usage: {} '.format( - sys.argv[0]))) - sys.exit(1) - -- projects = ['shaderc', 'spirv-tools', 'glslang'] -+ projects = ['shaderc'] - new_content = ''.join([ - '"{}\\n"\n'.format(get_version_string(p, d)) - for (p, d) in zip(projects, sys.argv[1:]) - ]) - -- output_file = sys.argv[4] -+ output_file = sys.argv[2] - mkdir_p(os.path.dirname(output_file)) - - if os.path.isfile(output_file): diff --git a/recipes/shaderc/all/patches/2021.1/install-shaderc_util.patch b/recipes/shaderc/all/patches/2021.1/install-shaderc_util.patch new file mode 100644 index 0000000000000..c2806270e883d --- /dev/null +++ b/recipes/shaderc/all/patches/2021.1/install-shaderc_util.patch @@ -0,0 +1,14 @@ +diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt +--- a/libshaderc_util/CMakeLists.txt ++++ b/libshaderc_util/CMakeLists.txt +@@ -87,3 +87,10 @@ + add_dependencies(shaderc_util_file_finder_test testdata) + add_dependencies(shaderc_util_io_shaderc_test testdata) + endif() ++ ++if(SHADERC_ENABLE_INSTALL AND NOT BUILD_SHARED_LIBS) ++ install(TARGETS shaderc_util ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++endif() diff --git a/recipes/shaderc/all/patches/2021.1/use-conan-dependencies.patch b/recipes/shaderc/all/patches/2021.1/use-conan-dependencies.patch new file mode 100644 index 0000000000000..667cfb6d0a4fb --- /dev/null +++ b/recipes/shaderc/all/patches/2021.1/use-conan-dependencies.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -112,7 +112,12 @@ + + # Configure subdirectories. + # We depend on these for later projects, so they should come first. +-add_subdirectory(third_party) ++find_package(glslang REQUIRED CONFIG) ++find_package(SPIRV-Headers REQUIRED CONFIG) ++find_package(SPIRV-Tools REQUIRED CONFIG) ++set(glslang_SOURCE_DIR ${glslang_INCLUDE_DIRS}) ++set(SPIRV-Headers_SOURCE_DIR ${SPIRV-Headers_INCLUDE_DIR}/..) ++set(spirv-tools_SOURCE_DIR ${SPIRV-Tools_INCLUDE_DIR}/..) + + add_subdirectory(libshaderc_util) + add_subdirectory(libshaderc) diff --git a/recipes/shaderc/all/patches/2023.6/use-conan-dependencies.patch b/recipes/shaderc/all/patches/2023.6/use-conan-dependencies.patch new file mode 100644 index 0000000000000..b28517493c7a8 --- /dev/null +++ b/recipes/shaderc/all/patches/2023.6/use-conan-dependencies.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -120,7 +120,12 @@ + + # Configure subdirectories. + # We depend on these for later projects, so they should come first. +-add_subdirectory(third_party) ++find_package(glslang REQUIRED CONFIG) ++find_package(SPIRV-Headers REQUIRED CONFIG) ++find_package(SPIRV-Tools REQUIRED CONFIG) ++set(glslang_SOURCE_DIR ${glslang_INCLUDE_DIRS}) ++set(SPIRV-Headers_SOURCE_DIR ${SPIRV-Headers_INCLUDE_DIR}/..) ++set(spirv-tools_SOURCE_DIR ${SPIRV-Tools_INCLUDE_DIR}/..) + + add_subdirectory(libshaderc_util) + add_subdirectory(libshaderc) diff --git a/recipes/shaderc/all/test_package/CMakeLists.txt b/recipes/shaderc/all/test_package/CMakeLists.txt index 492695489b31c..e88a76ff2e432 100644 --- a/recipes/shaderc/all/test_package/CMakeLists.txt +++ b/recipes/shaderc/all/test_package/CMakeLists.txt @@ -1,21 +1,11 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(shaderc REQUIRED CONFIG) add_executable(${PROJECT_NAME}_shaderc_c test_package_shaderc.c) -target_link_libraries(${PROJECT_NAME}_shaderc_c ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME}_shaderc_c PRIVATE shaderc::shaderc) add_executable(${PROJECT_NAME}_shaderc_cpp test_package_shaderc.cpp) -target_link_libraries(${PROJECT_NAME}_shaderc_cpp ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME}_shaderc_cpp PRIVATE shaderc::shaderc) set_property(TARGET ${PROJECT_NAME}_shaderc_cpp PROPERTY CXX_STANDARD 11) - -if(SHADERC_WITH_SPVC) - add_executable(${PROJECT_NAME}_spvc_c test_package_spvc.c) - target_link_libraries(${PROJECT_NAME}_spvc_c ${CONAN_LIBS}) - - add_executable(${PROJECT_NAME}_spvc_cpp test_package_spvc.cpp) - target_link_libraries(${PROJECT_NAME}_spvc_cpp ${CONAN_LIBS}) - set_property(TARGET ${PROJECT_NAME}_spvc_cpp PROPERTY CXX_STANDARD 11) -endif() diff --git a/recipes/shaderc/all/test_package/conanfile.py b/recipes/shaderc/all/test_package/conanfile.py index e6ac9a4c93682..4613db3f59c9f 100644 --- a/recipes/shaderc/all/test_package/conanfile.py +++ b/recipes/shaderc/all/test_package/conanfile.py @@ -1,32 +1,34 @@ -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", "arch", "compiler", "build_type" - generators = "cmake" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) - cmake.definitions["SHADERC_WITH_SPVC"] = self.options["shaderc"].spvc if "spvc" in self.options["shaderc"] else False cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): # Test programs consuming shaderc lib - bin_path_shaderc_c = os.path.join("bin", "test_package_shaderc_c") - self.run(bin_path_shaderc_c, run_environment=True) - bin_path_shaderc_cpp = os.path.join("bin", "test_package_shaderc_cpp") - self.run(bin_path_shaderc_cpp, run_environment=True) + bin_path_shaderc_c = os.path.join(self.cpp.build.bindir, "test_package_shaderc_c") + self.run(bin_path_shaderc_c, env="conanrun") + + bin_path_shaderc_cpp = os.path.join(self.cpp.build.bindir, "test_package_shaderc_cpp") + self.run(bin_path_shaderc_cpp, env="conanrun") + # Test glslc executable - in_glsl_name = os.path.join(self.source_folder, "test_package.vert") - spv_name = "test_package.spv" - self.run("glslc \"{0}\" -o {1}".format(in_glsl_name, spv_name), run_environment=True) - - if "spvc" in self.options["shaderc"] and self.options["shaderc"].spvc: - # Test programs consuming shaderc_spvc lib - bin_path_spvc_c = os.path.join("bin", "test_package_spvc_c") - self.run(bin_path_spvc_c, run_environment=True) - bin_path_spvc_cpp = os.path.join("bin", "test_package_spvc_cpp") - self.run(bin_path_spvc_cpp, run_environment=True) + self.run(f"glslc -h", env="conanrun") diff --git a/recipes/shaderc/all/test_package/test_package.vert b/recipes/shaderc/all/test_package/test_package.vert deleted file mode 100644 index 8f349eebab57e..0000000000000 --- a/recipes/shaderc/all/test_package/test_package.vert +++ /dev/null @@ -1,8 +0,0 @@ -#version 450 -#extension GL_ARB_separate_shader_objects : enable - -layout(location = 0) in vec2 inPosition; - -void main() { - gl_Position = vec4(inPosition, 0.0, 1.0); -} diff --git a/recipes/shaderc/all/test_package/test_package_spvc.c b/recipes/shaderc/all/test_package/test_package_spvc.c deleted file mode 100644 index c9fc709f30096..0000000000000 --- a/recipes/shaderc/all/test_package/test_package_spvc.c +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main() { - shaderc_spvc_compiler_t shaderc_spvc_compiler = shaderc_spvc_compiler_initialize(); - shaderc_spvc_compiler_release(shaderc_spvc_compiler); - - return 0; -} diff --git a/recipes/shaderc/all/test_package/test_package_spvc.cpp b/recipes/shaderc/all/test_package/test_package_spvc.cpp deleted file mode 100644 index 40978d50d1c6c..0000000000000 --- a/recipes/shaderc/all/test_package/test_package_spvc.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main() { - shaderc_spvc::Compiler compiler; - shaderc_spvc::CompileOptions compile_options; - - return 0; -} diff --git a/recipes/shaderc/all/test_v1_package/CMakeLists.txt b/recipes/shaderc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/shaderc/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/shaderc/all/test_v1_package/conanfile.py b/recipes/shaderc/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..fdb8622025dbc --- /dev/null +++ b/recipes/shaderc/all/test_v1_package/conanfile.py @@ -0,0 +1,22 @@ +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): + # Test programs consuming shaderc lib + bin_path_shaderc_c = os.path.join("bin", "test_package_shaderc_c") + self.run(bin_path_shaderc_c, run_environment=True) + bin_path_shaderc_cpp = os.path.join("bin", "test_package_shaderc_cpp") + self.run(bin_path_shaderc_cpp, run_environment=True) + + self.run(f"glslc -h", run_environment=True) diff --git a/recipes/shaderc/config.yml b/recipes/shaderc/config.yml index 15d431909e594..272340ffeadfd 100644 --- a/recipes/shaderc/config.yml +++ b/recipes/shaderc/config.yml @@ -1,5 +1,5 @@ versions: - "2021.1": + "2023.6": folder: all - "2019.0": + "2021.1": folder: all diff --git a/recipes/shield/all/conandata.yml b/recipes/shield/all/conandata.yml index 76d8f2a0a392d..7719bd88959d1 100644 --- a/recipes/shield/all/conandata.yml +++ b/recipes/shield/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.6": + url: "https://github.com/holoplot/shield/archive/0.6.tar.gz" + sha256: "9ed05e2be8268dc634367ce87aff8b4878b481353eacfdbd8d1f303888c9e3bb" "0.5": url: "https://github.com/holoplot/shield/archive/0.5.tar.gz" sha256: "f6494b1c95aeddb23fe507ab8da17234ecd7ca6aff97a92112e1e6459b343ff3" diff --git a/recipes/shield/config.yml b/recipes/shield/config.yml index ab08cd3e58a8c..0afee7e4b4830 100644 --- a/recipes/shield/config.yml +++ b/recipes/shield/config.yml @@ -1,4 +1,6 @@ versions: + "0.6": + folder: all "0.5": folder: all "0.4": diff --git a/recipes/simd/all/conandata.yml b/recipes/simd/all/conandata.yml new file mode 100644 index 0000000000000..93a1a396f05ce --- /dev/null +++ b/recipes/simd/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "6.1.138": + url: "https://github.com/ermig1979/Simd/archive/refs/tags/v6.1.138.tar.gz" + sha256: "5090e4879d48851d5d7d9605485f517dea9a27d9431ec2d54a74a6f04cf3ba00" diff --git a/recipes/simd/all/conanfile.py b/recipes/simd/all/conanfile.py new file mode 100644 index 0000000000000..f5a7dce572f35 --- /dev/null +++ b/recipes/simd/all/conanfile.py @@ -0,0 +1,125 @@ +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, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rmdir, replace_in_file, collect_libs +from conan.tools.microsoft import is_msvc, MSBuild, MSBuildToolchain, is_msvc_static_runtime, msvs_toolset + +required_conan_version = ">=1.59.0" + + +class SimdConan(ConanFile): + name = "simd" + description = "C++ image processing and machine learning library with SIMD" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ermig1979/Simd" + topics = ("sse", "avx", "avx-512", "amx", "vmx", "vsx", "neon") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + + @property + def _min_cppstd(self): + return 11 + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if self.settings.os == "Windows" and self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration("Windows only supports x86/x64 architectures.") + if is_msvc(self) and self.settings.arch == "armv8": + raise ConanInvalidConfiguration("ARM64 building with MSVC is not supported.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.generate() + else: + tc = CMakeToolchain(self) + tc.variables["SIMD_TEST"] = False + tc.variables["SIMD_SHARED"] = self.options.shared + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + @property + def vs_proj_folder(self): + """Return the vsXXXX/ folder given the MSVC compiler version""" + toolset = msvs_toolset(self) + # By default, v2022 folder + return {"v140": "vs2015", + "v141": "vs2017", + "v142": "vs2019"}.get(toolset, "vs2022") + + def _patch_sources(self): + if is_msvc(self): + if not self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "src", "Simd", "SimdConfig.h"), "//#define SIMD_STATIC", "#define SIMD_STATIC") + replace_in_file(self, os.path.join(self.source_folder, "prj", self.vs_proj_folder, "Simd.vcxproj"), + "DynamicLibrary", + "StaticLibrary") + for prj in ("AmxBf16", "Avx2", "Avx512bw", "Avx512vnni", "Base", "Neon", "Simd", "Sse41"): + replace_in_file(self, os.path.join(self.source_folder, "prj", self.vs_proj_folder, f"{prj}.vcxproj"), + " ", + " OldStyle\n ") + + if not is_msvc_static_runtime(self): + for prj in ("AmxBf16", "Avx2", "Avx512bw", "Avx512vnni", "Base", "Neon", "Simd", "Sse41"): + replace_in_file(self, os.path.join(self.source_folder, "prj", self.vs_proj_folder, f"{prj}.vcxproj"), + " ", + " MultiThreadedDebugDLL\n" + " MultiThreadedDLL\n" + " ") + + def build(self): + self._patch_sources() + if is_msvc(self): + msbuild = MSBuild(self) + msbuild.build(os.path.join(self.source_folder, "prj", self.vs_proj_folder, "Simd.vcxproj")) + else: + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "prj", "cmake")) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if is_msvc(self): + copy(self, pattern="*.h*", dst=os.path.join(self.package_folder, "include", "Simd"), src=os.path.join(self.source_folder, "src", "Simd"), keep_path=True) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) + copy(self, pattern="*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder, keep_path=False) + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + self.cpp_info.set_property("cmake_file_name", "Simd") + self.cpp_info.set_property("cmake_target_name", "Simd::Simd") + if not self.options.shared and is_msvc(self): + self.cpp_info.defines.append("SIMD_STATIC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "m"]) diff --git a/recipes/simd/all/test_package/CMakeLists.txt b/recipes/simd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..eef0ed5180fa2 --- /dev/null +++ b/recipes/simd/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Simd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Simd::Simd) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/simd/all/test_package/conanfile.py b/recipes/simd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d7de1f914ce42 --- /dev/null +++ b/recipes/simd/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + + +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/simd/all/test_package/test_package.cpp b/recipes/simd/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9618b4bc617e4 --- /dev/null +++ b/recipes/simd/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include +#include "Simd/SimdLib.hpp" + +int main(void) { + Simd::PrintInfo(std::cout); +} diff --git a/recipes/simd/config.yml b/recipes/simd/config.yml new file mode 100644 index 0000000000000..cade1c07e0823 --- /dev/null +++ b/recipes/simd/config.yml @@ -0,0 +1,3 @@ +versions: + "6.1.138": + folder: all diff --git a/recipes/simde/all/conandata.yml b/recipes/simde/all/conandata.yml index 2710ad3ab19c8..4819243883706 100644 --- a/recipes/simde/all/conandata.yml +++ b/recipes/simde/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8.2": + url: "https://github.com/simd-everywhere/simde/archive/refs/tags/v0.8.2.tar.gz" + sha256: "ed2a3268658f2f2a9b5367628a85ccd4cf9516460ed8604eed369653d49b25fb" "0.8.0": # same as 0.7.6 url: "https://github.com/simd-everywhere/simde/archive/refs/tags/v0.8.0.tar.gz" diff --git a/recipes/simde/config.yml b/recipes/simde/config.yml index 82cc9014779ef..63dd232920b7f 100644 --- a/recipes/simde/config.yml +++ b/recipes/simde/config.yml @@ -1,4 +1,6 @@ versions: + "0.8.2": + folder: all "0.8.0": folder: all "0.7.6": diff --git a/recipes/simdjson/all/conandata.yml b/recipes/simdjson/all/conandata.yml index a13784e72fcfe..b9b9a0dfe167a 100644 --- a/recipes/simdjson/all/conandata.yml +++ b/recipes/simdjson/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "3.9.3": + url: "https://github.com/simdjson/simdjson/archive/v3.9.3.tar.gz" + sha256: "2e3d10abcde543d3dd8eba9297522cafdcebdd1db4f51b28f3bc95bf1d6ad23c" + "3.9.2": + url: "https://github.com/simdjson/simdjson/archive/v3.9.2.tar.gz" + sha256: "79fbe700f4ac3dd69c4f08275af58399daabd612bca0c0465aea959c60256651" + "3.9.1": + url: "https://github.com/simdjson/simdjson/archive/v3.9.1.tar.gz" + sha256: "a4b6e7cd83176e0ccb107ce38521da40a8df41c2d3c90566f2a0af05b0cd05c4" "3.8.0": url: "https://github.com/simdjson/simdjson/archive/v3.8.0.tar.gz" sha256: "e28e3f46f0012d405b67de6c0a75e8d8c9a612b0548cb59687822337d73ca78b" @@ -8,36 +17,12 @@ sources: "3.6.4": url: "https://github.com/simdjson/simdjson/archive/v3.6.4.tar.gz" sha256: "7e93d5094a47180a3d451cb261ba29ac66f3f6ceb7c2a0884955e9a2bb06d818" - "3.6.1": - url: "https://github.com/simdjson/simdjson/archive/v3.6.1.tar.gz" - sha256: "76601d1701232a212b62d25d3a6518219b2504ff84e8073c6df7393b2ead3176" - "3.6.0": - url: "https://github.com/simdjson/simdjson/archive/v3.6.0.tar.gz" - sha256: "9eab3197231382b8b99d14d8ca647d6ab6bea1b40008df086d25e6f687309bf6" "3.5.0": url: "https://github.com/simdjson/simdjson/archive/v3.5.0.tar.gz" sha256: "942c9462b3c046e12b898cbf5e198f31a377ab40bb2bde5be98440d1f9212ee0" "3.3.0": url: "https://github.com/simdjson/simdjson/archive/v3.3.0.tar.gz" sha256: "a8c9feff2f19c3ff281d42f0b6b4b18f02236513b99229756fa9a1b14787a58a" - "3.2.3": - url: "https://github.com/simdjson/simdjson/archive/v3.2.3.tar.gz" - sha256: "ab72701b8560c4f93a5de525657b3bf34094f99a1e63bd9db3195d1bcb90aa09" - "3.2.2": - url: "https://github.com/simdjson/simdjson/archive/v3.2.2.tar.gz" - sha256: "13a702536e051db612cdca82bf8585f2c69d9c6fd156ef291b170f13202c1b4c" - "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" - "3.1.8": - url: "https://github.com/simdjson/simdjson/archive/v3.1.8.tar.gz" - sha256: "99e7eeb0a0038e0213da68f099e6a8b67bcaeea1586385ec5f752bea85d902d8" - "3.0.1": - url: "https://github.com/simdjson/simdjson/archive/v3.0.1.tar.gz" - sha256: "156b1bc5eb0561b2bd166b46d191fd3d95a3e709cc63761477d3b7aec2b6e9ed" - "2.2.3": - url: "https://github.com/simdjson/simdjson/archive/v2.2.3.tar.gz" - sha256: "4c62f2d82edec3dbc63650c10453dc471de9f1be689eb5b4bde89efed89db5d8" diff --git a/recipes/simdjson/all/conanfile.py b/recipes/simdjson/all/conanfile.py index 7b42a92cdbbc8..2f8062c7b4ea4 100644 --- a/recipes/simdjson/all/conanfile.py +++ b/recipes/simdjson/all/conanfile.py @@ -72,13 +72,6 @@ def loose_lt_semver(v1, v2): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not fully support." ) - if self.settings.compiler == "gcc" and \ - Version(self.settings.compiler.version).major == "9": - if self.settings.compiler.get_safe("libcxx") == "libstdc++11": - raise ConanInvalidConfiguration(f"{self.ref} doesn't support GCC 9 with libstdc++11.") - if self.settings.build_type == "Debug": - raise ConanInvalidConfiguration(f"{self.ref} doesn't support GCC 9 with Debug build type.") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/simdjson/config.yml b/recipes/simdjson/config.yml index 76ac101fa502f..a10abda6a7a1a 100644 --- a/recipes/simdjson/config.yml +++ b/recipes/simdjson/config.yml @@ -1,29 +1,20 @@ versions: + "3.9.3": + folder: all + "3.9.2": + folder: all + "3.9.1": + folder: all "3.8.0": folder: all "3.7.0": folder: all "3.6.4": folder: all - "3.6.1": - folder: all - "3.6.0": - folder: all "3.5.0": folder: all "3.3.0": folder: all - "3.2.3": - folder: all - "3.2.2": - folder: all - "3.2.1": - folder: all + # fastgltf requires simdjson/3.2.0 "3.2.0": folder: all - "3.1.8": - folder: all - "3.0.1": - folder: all - "2.2.3": - folder: all diff --git a/recipes/simdutf/all/conandata.yml b/recipes/simdutf/all/conandata.yml index 043f57d573076..fe77b0830484e 100644 --- a/recipes/simdutf/all/conandata.yml +++ b/recipes/simdutf/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "5.2.8": + url: "https://github.com/simdutf/simdutf/archive/v5.2.8.tar.gz" + sha256: "2706f1bef85a6d8598f82defd3848f1c5100e2e065c5d416d993118b53ea8d77" + "5.2.6": + url: "https://github.com/simdutf/simdutf/archive/v5.2.6.tar.gz" + sha256: "ab9e56facf7cf05f4e9d062a0adef310fc6a0f82a8132e8ec1e1bb7ab5e234df" + "5.2.3": + url: "https://github.com/simdutf/simdutf/archive/v5.2.3.tar.gz" + sha256: "dfa55d85c3ee51e9b52e55c02701b16f83dcf1921e1075b67f99b1036df5adb8" + "5.2.2": + url: "https://github.com/simdutf/simdutf/archive/v5.2.2.tar.gz" + sha256: "6cd905ac7fcf6293e34d7acaa9d5af901d85f182f82ec6ec3ee9f9273881791d" "5.0.0": url: "https://github.com/simdutf/simdutf/archive/v5.0.0.tar.gz" sha256: "088d750466bf3487117cce7f828eb94a0a3474d7e76b45d4902c99a2387212b7" @@ -17,57 +29,8 @@ sources: "3.2.17": url: "https://github.com/simdutf/simdutf/archive/v3.2.17.tar.gz" sha256: "c24e3eec1e08522a09b33e603352e574f26d367a7701bf069a65881f64acd519" - "3.2.15": - url: "https://github.com/simdutf/simdutf/archive/v3.2.15.tar.gz" - sha256: "c26d2e2e9124e1c20335d3880d74c8b0d74a5e247ba82ef82d15df4ccc413bcd" - "3.2.14": - url: "https://github.com/simdutf/simdutf/archive/v3.2.14.tar.gz" - sha256: "6bd6cd41e0e588312c3ae24adb297454bd9bd9622ed7443f41300d7201f233a1" - "3.2.2": - url: "https://github.com/simdutf/simdutf/archive/v3.2.2.tar.gz" - sha256: "5a5c84c05bf30d681126d1dcbde903615f2c927e201e0c6d489f74a91b7f506f" - "3.2.0": - url: "https://github.com/simdutf/simdutf/archive/v3.2.0.tar.gz" - sha256: "0d9f63e2f308b6b54f399ebbe3a02776b902a2670c88c28de2d75ea2197dc4e9" - "3.1.0": - url: "https://github.com/simdutf/simdutf/archive/v3.1.0.tar.gz" - sha256: "9757a04085ad3ebab9fe933d9198ec6b84a857632a540418b6cfeb7b889a8017" - "3.0.0": - url: "https://github.com/simdutf/simdutf/archive/v3.0.0.tar.gz" - sha256: "cc23b47fd0caf9018fc0dcf49ebeff2676654fff997f9f6ce50fa93cd36f661f" - "2.2.0": - url: "https://github.com/simdutf/simdutf/archive/v2.2.0.tar.gz" - sha256: "b0b8527e194700363cc47e75a7b8d58c88798b0dc31671f5ae5c8803d8678fe6" patches: "3.2.17": - patch_file: "patches/3.2.17-0001-fix-cmake.patch" patch_description: "remove static build, enable rpath on macOS" patch_type: "conan" - "3.2.15": - - patch_file: "patches/3.2.14-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "3.2.14": - - patch_file: "patches/3.2.14-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "3.2.2": - - patch_file: "patches/2.0.3-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "3.2.0": - - patch_file: "patches/2.0.3-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "3.1.0": - - patch_file: "patches/2.0.3-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "3.0.0": - - patch_file: "patches/2.0.3-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "2.2.0": - - patch_file: "patches/2.0.3-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" diff --git a/recipes/simdutf/all/conanfile.py b/recipes/simdutf/all/conanfile.py index 6e0a2cc78bceb..69d83bcb2ced4 100644 --- a/recipes/simdutf/all/conanfile.py +++ b/recipes/simdutf/all/conanfile.py @@ -62,10 +62,7 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["SIMDUTF_BENCHMARKS"] = False - if Version(self.version) >= "3.2.3": - tc.variables["SIMDUTF_TESTS"] = False - else: - tc.variables["BUILD_TESTING"] = False + tc.variables["SIMDUTF_TESTS"] = False if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) == "8": tc.variables["CMAKE_CXX_FLAGS"] = " -mavx512f" tc.variables["SIMDUTF_TOOLS"] = False diff --git a/recipes/simdutf/all/patches/2.0.3-0001-fix-cmake.patch b/recipes/simdutf/all/patches/2.0.3-0001-fix-cmake.patch deleted file mode 100644 index 6bedd6c48eb5d..0000000000000 --- a/recipes/simdutf/all/patches/2.0.3-0001-fix-cmake.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/cmake/simdutf-flags.cmake b/cmake/simdutf-flags.cmake -index 9263a7f..39f5a8c 100644 ---- a/cmake/simdutf-flags.cmake -+++ b/cmake/simdutf-flags.cmake -@@ -16,4 +16,4 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake") - set(CMAKE_CXX_STANDARD 11) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) --set(CMAKE_MACOSX_RPATH OFF) -+set(CMAKE_MACOSX_RPATH ON) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index f3ede1e..91a1bdd 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -3,6 +3,6 @@ target_include_directories(simdutf-include-source INTERFACE $/simdutf.cpp) - target_link_libraries(simdutf-source INTERFACE simdutf-include-source) --add_library(simdutf STATIC simdutf.cpp) -+add_library(simdutf simdutf.cpp) - target_include_directories(simdutf PRIVATE $ ) - target_include_directories(simdutf PUBLIC "$") - diff --git a/recipes/simdutf/all/patches/3.2.14-0001-fix-cmake.patch b/recipes/simdutf/all/patches/3.2.14-0001-fix-cmake.patch deleted file mode 100644 index 2fa471fee1dfb..0000000000000 --- a/recipes/simdutf/all/patches/3.2.14-0001-fix-cmake.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/cmake/simdutf-flags.cmake b/cmake/simdutf-flags.cmake -index 4844fa0..801e2b3 100644 ---- a/cmake/simdutf-flags.cmake -+++ b/cmake/simdutf-flags.cmake -@@ -24,4 +24,4 @@ set(SIMDUTF_CXX_STANDARD 11 CACHE STRING "the C++ standard to use for simdutf") - set(CMAKE_CXX_STANDARD ${SIMDUTF_CXX_STANDARD}) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) --set(CMAKE_MACOSX_RPATH OFF) -+set(CMAKE_MACOSX_RPATH ON) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index f42e310..80ce35c 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -3,7 +3,7 @@ target_include_directories(simdutf-include-source INTERFACE $/simdutf.cpp) - target_link_libraries(simdutf-source INTERFACE simdutf-include-source) --add_library(simdutf STATIC simdutf.cpp) -+add_library(simdutf simdutf.cpp) - target_include_directories(simdutf PRIVATE $ ) - target_include_directories(simdutf PUBLIC "$") - -@@ -38,4 +38,4 @@ if(SIMDUTF_SANITIZE_UNDEFINED) - endif() - if(MSVC AND BUILD_SHARED_LIBS) - set(SIMDUTF_WINDOWS_DLL TRUE) --endif() -\ No newline at end of file -+endif() diff --git a/recipes/simdutf/config.yml b/recipes/simdutf/config.yml index 1753ee45a4882..5931b0efb2f62 100644 --- a/recipes/simdutf/config.yml +++ b/recipes/simdutf/config.yml @@ -1,4 +1,12 @@ versions: + "5.2.8": + folder: all + "5.2.6": + folder: all + "5.2.3": + folder: all + "5.2.2": + folder: all "5.0.0": folder: all "4.0.9": @@ -11,17 +19,3 @@ versions: folder: all "3.2.17": folder: all - "3.2.15": - folder: all - "3.2.14": - folder: all - "3.2.2": - folder: all - "3.2.0": - folder: all - "3.1.0": - folder: all - "3.0.0": - folder: all - "2.2.0": - folder: all diff --git a/recipes/simfil/all/conandata.yml b/recipes/simfil/all/conandata.yml index f6fc491607eb0..322f4f504eca0 100644 --- a/recipes/simfil/all/conandata.yml +++ b/recipes/simfil/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.2.1": + url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.2.1.tar.gz" + sha256: "d3114900f121013cbffe42b0a70c66a47846c9326f6327d2ce0dd2e841919fd9" + "0.1.3": + url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.1.3.tar.gz" + sha256: "e42004b46118950e95b22430e4580fb89d1e6d2a1399e209d1aa4310944962e5" + "0.1.2": + url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.1.2.tar.gz" + sha256: "a903658ff37fa304dc6d8cb65e7923b6857b825ce2ac205522b84e4785d80e8d" "0.1.1": url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.1.1.tar.gz" sha256: "e82a9d92ec65b7e27776d5507c78571cecc234f2b6fcdacc7ffcece6198f7f9a" diff --git a/recipes/simfil/all/conanfile.py b/recipes/simfil/all/conanfile.py index 7f51c69a00ce9..66a16c329cfe6 100644 --- a/recipes/simfil/all/conanfile.py +++ b/recipes/simfil/all/conanfile.py @@ -16,6 +16,7 @@ class SimfilRecipe(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Klebert-Engineering/simfil" license = "BSD-3-Clause" + package_type = "library" topics = ["query-language", "json", "data-model"] # Binary configuration diff --git a/recipes/simfil/config.yml b/recipes/simfil/config.yml index b893ff21f7c23..c6da95529c7e5 100644 --- a/recipes/simfil/config.yml +++ b/recipes/simfil/config.yml @@ -1,3 +1,9 @@ versions: + "0.2.1": + folder: all + "0.1.3": + folder: all + "0.1.2": + folder: all "0.1.1": folder: all diff --git a/recipes/sioclient/all/conandata.yml b/recipes/sioclient/all/conandata.yml new file mode 100644 index 0000000000000..ae83b98849ee1 --- /dev/null +++ b/recipes/sioclient/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20240405": + url: "https://github.com/socketio/socket.io-client-cpp/archive/c6be96b226f0fe3853beaeaa99c06834342a78db.zip" + sha256: "7c68117185dbc49579bba09a3e877f2a716cc331c28b3d8b6d3f867c4346b639" diff --git a/recipes/sioclient/all/conanfile.py b/recipes/sioclient/all/conanfile.py new file mode 100644 index 0000000000000..28f6a1a4ad91a --- /dev/null +++ b/recipes/sioclient/all/conanfile.py @@ -0,0 +1,112 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.microsoft import is_msvc +from conan.tools.files import copy, get, replace_in_file, rm, rmdir, save + +required_conan_version = ">=1.53.0" + + +class SioclientConan(ConanFile): + name = "sioclient" + description = "C++11 implementation of Socket.IO client" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/socketio/socket.io-client-cpp" + topics = ("websocket", "client") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openssl": 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") + if is_msvc(self): + self.options.rm_safe("shared") + self.package_type = "static-library" + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("websocketpp/0.8.2") + self.requires("asio/1.30.2") + self.requires("rapidjson/cci.20230929") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_SUBMODULES"] = False + tc.variables["BUILD_UNIT_TESTS"] = False + tc.variables["BUILD_TESTING"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "asio asio::asio", "asio::asio") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "sioclient") + + self.cpp_info.components["sioclient_"].set_property("cmake_target_name", "sioclient::sioclient") + self.cpp_info.components["sioclient_"].libs = ["sioclient"] + self.cpp_info.components["sioclient_"].requires = [ + "websocketpp::websocketpp", + "asio::asio", + "rapidjson::rapidjson", + ] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["sioclient_"].system_libs.extend(["m", "pthread"]) + + if self.options.with_openssl: + self.cpp_info.components["sioclient_tls"].set_property("cmake_target_name", "sioclient::sioclient_tls") + self.cpp_info.components["sioclient_tls"].libs = ["sioclient_tls"] + self.cpp_info.components["sioclient_tls"].requires = [ + "websocketpp::websocketpp", + "asio::asio", + "rapidjson::rapidjson", + "openssl::openssl", + ] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["sioclient_tls"].system_libs.extend(["m", "pthread"]) diff --git a/recipes/sioclient/all/test_package/CMakeLists.txt b/recipes/sioclient/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4985d53cb13ca --- /dev/null +++ b/recipes/sioclient/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(sioclient REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sioclient::sioclient) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sioclient/all/test_package/conanfile.py b/recipes/sioclient/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/sioclient/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/sioclient/all/test_package/test_package.cpp b/recipes/sioclient/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..646e232b2bda0 --- /dev/null +++ b/recipes/sioclient/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + sio::client h; + h.socket(); +} diff --git a/recipes/sioclient/config.yml b/recipes/sioclient/config.yml new file mode 100644 index 0000000000000..f1cb71fea7cad --- /dev/null +++ b/recipes/sioclient/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20240405": + folder: all diff --git a/recipes/snappy/all/conandata.yml b/recipes/snappy/all/conandata.yml index 1488c7a2baf50..501018a1c4174 100644 --- a/recipes/snappy/all/conandata.yml +++ b/recipes/snappy/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.2.1": + url: "https://github.com/google/snappy/archive/1.2.1.tar.gz" + sha256: "736aeb64d86566d2236ddffa2865ee5d7a82d26c9016b36218fcc27ea4f09f86" + "1.2.0": + url: "https://github.com/google/snappy/archive/1.2.0.tar.gz" + sha256: "9b8f10fbb5e3bc112f2e5e64f813cb73faea42ec9c533a5023b5ae08aedef42e" "1.1.10": url: "https://github.com/google/snappy/archive/1.1.10.tar.gz" sha256: "49d831bffcc5f3d01482340fe5af59852ca2fe76c3e05df0e67203ebbe0f1d90" @@ -12,6 +18,32 @@ sources: url: "https://github.com/google/snappy/archive/1.1.7.tar.gz" sha256: "3dfa02e873ff51a11ee02b9ca391807f0c8ea0529a4924afa645fbf97163f9d4" patches: + "1.2.1": + - patch_file: "patches/1.1.10-0001-fix-inlining-failure.patch" + patch_description: "disable inlining for compilation error" + patch_type: "portability" + - patch_file: "patches/1.1.9-0002-no-Werror.patch" + patch_description: "disable 'warning as error' options" + patch_type: "portability" + - patch_file: "patches/1.2.0-0003-fix-clobber-list-older-llvm.patch" + patch_description: "disable inline asm on apple-clang" + patch_type: "portability" + - patch_file: "patches/1.2.0-0004-rtti-by-default.patch" + patch_description: "remove 'disable rtti'" + patch_type: "conan" + "1.2.0": + - patch_file: "patches/1.1.10-0001-fix-inlining-failure.patch" + patch_description: "disable inlining for compilation error" + patch_type: "portability" + - patch_file: "patches/1.1.9-0002-no-Werror.patch" + patch_description: "disable 'warning as error' options" + patch_type: "portability" + - patch_file: "patches/1.2.0-0003-fix-clobber-list-older-llvm.patch" + patch_description: "disable inline asm on apple-clang" + patch_type: "portability" + - patch_file: "patches/1.2.0-0004-rtti-by-default.patch" + patch_description: "remove 'disable rtti'" + patch_type: "conan" "1.1.10": - patch_file: "patches/1.1.10-0001-fix-inlining-failure.patch" patch_description: "disable inlining for compilation error" diff --git a/recipes/snappy/all/patches/1.2.0-0003-fix-clobber-list-older-llvm.patch b/recipes/snappy/all/patches/1.2.0-0003-fix-clobber-list-older-llvm.patch new file mode 100644 index 0000000000000..05accb60abfba --- /dev/null +++ b/recipes/snappy/all/patches/1.2.0-0003-fix-clobber-list-older-llvm.patch @@ -0,0 +1,13 @@ +diff --git a/snappy.cc b/snappy.cc +index 08c2a98..151de55 100644 +--- a/snappy.cc ++++ b/snappy.cc +@@ -1311,7 +1311,7 @@ inline size_t AdvanceToNextTagX86Optimized(const uint8_t** ip_p, size_t* tag) { + size_t literal_len = *tag >> 2; + size_t tag_type = *tag; + bool is_literal; +-#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) ++#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) && ( (!defined(__clang__) && !defined(__APPLE__)) || (!defined(__APPLE__) && defined(__clang__) && (__clang_major__ >= 9)) || (defined(__APPLE__) && defined(__clang__) && (__clang_major__ > 11)) ) + // TODO clang misses the fact that the (c & 3) already correctly + // sets the zero flag. + asm("and $3, %k[tag_type]\n\t" diff --git a/recipes/snappy/all/patches/1.2.0-0004-rtti-by-default.patch b/recipes/snappy/all/patches/1.2.0-0004-rtti-by-default.patch new file mode 100644 index 0000000000000..7ca0e721fadea --- /dev/null +++ b/recipes/snappy/all/patches/1.2.0-0004-rtti-by-default.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 01eb2d7..fb4e6bf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,8 +53,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_definitions(-D_HAS_EXCEPTIONS=0) + + # Disable RTTI. +- string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") ++# string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") ++# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") + else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Use -Wall for clang and gcc. + if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") +@@ -83,8 +83,8 @@ endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") + + # Disable RTTI. +- string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") ++# string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") ++# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") + endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + + # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make diff --git a/recipes/snappy/config.yml b/recipes/snappy/config.yml index 521a59e91e109..4059143be6e19 100644 --- a/recipes/snappy/config.yml +++ b/recipes/snappy/config.yml @@ -1,4 +1,8 @@ versions: + "1.2.1": + folder: all + "1.2.0": + folder: all "1.1.10": folder: all "1.1.9": diff --git a/recipes/sonic-cpp/all/conandata.yml b/recipes/sonic-cpp/all/conandata.yml index d309d05a897b8..1b94133aa026e 100644 --- a/recipes/sonic-cpp/all/conandata.yml +++ b/recipes/sonic-cpp/all/conandata.yml @@ -1,8 +1,15 @@ sources: + "1.0.1": + url: "https://github.com/bytedance/sonic-cpp/archive/refs/tags/v1.0.1.tar.gz" + sha256: "c78fb90c56ba235e8867888c0b1af0e96d7b0b86829381b3cca94f61f83d41e5" "1.0.0": url: "https://github.com/bytedance/sonic-cpp/archive/refs/tags/v1.0.0.tar.gz" sha256: "78af626fa070a2702fe9586d90617292b421d97d7ab1fe27a02cc20434467a80" patches: + "1.0.1": + - patch_file: "patches/1.0.0-0001-use-cci.patch" + patch_description: "use cci recipes" + patch_type: "conan" "1.0.0": - patch_file: "patches/1.0.0-0001-use-cci.patch" patch_description: "use cci recipes" diff --git a/recipes/sonic-cpp/all/conanfile.py b/recipes/sonic-cpp/all/conanfile.py index 8490a3d80c51b..533e9e8146a77 100644 --- a/recipes/sonic-cpp/all/conanfile.py +++ b/recipes/sonic-cpp/all/conanfile.py @@ -4,6 +4,7 @@ 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 +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -50,8 +51,11 @@ 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.") + supported_archs = ["x86", "x86_64"] + if Version(self.version) >= "1.0.1": + supported_archs.extend(["armv8", "armv8.3"]) + if self.settings.arch not in supported_archs: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support {self.settings.arch}.") if is_msvc(self): raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC now.") diff --git a/recipes/sonic-cpp/config.yml b/recipes/sonic-cpp/config.yml index 40341aa3db6cd..af3bb0714e65c 100644 --- a/recipes/sonic-cpp/config.yml +++ b/recipes/sonic-cpp/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.1": + folder: all "1.0.0": folder: all diff --git a/recipes/soplex/all/conandata.yml b/recipes/soplex/all/conandata.yml index b034a63a75693..45d267e534138 100644 --- a/recipes/soplex/all/conandata.yml +++ b/recipes/soplex/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "7.1.0": + url: "https://github.com/scipopt/soplex/archive/refs/tags/release-710.tar.gz" + sha256: "ec177fdb688346287d5f211dd7ec4a0195c8ec9b3a5314d38aca383b6fa1418e" + "7.0.1": + url: "https://github.com/scipopt/soplex/archive/refs/tags/release-701.tar.gz" + sha256: "80cce994dcbe45fd52b60e31a3aeb5d2c60a7ddbaae495e0ce6bf58481675696" + "7.0.0": + url: "https://github.com/scipopt/soplex/archive/refs/tags/release-700.tar.gz" + sha256: "ab1906d3afb1793a6f129a5baef9dd8eee929ee945aade427cb9f0b17888239c" "6.0.4": url: "https://github.com/scipopt/soplex/archive/refs/tags/release-604.tar.gz" sha256: "691f5b593cb85c2586522d5de5a5a7692958d22ff1ddffb4fc395f4696590b6f" diff --git a/recipes/soplex/all/conanfile.py b/recipes/soplex/all/conanfile.py index 047f359f2bb4b..9dc99e1409055 100644 --- a/recipes/soplex/all/conanfile.py +++ b/recipes/soplex/all/conanfile.py @@ -73,7 +73,7 @@ def requirements(self): # see https://github.com/conan-io/conan-center-index/pull/16017#issuecomment-1495688452 self.requires("gmp/6.3.0", transitive_headers=True, transitive_libs=True) if self.options.with_boost: - self.requires("boost/1.83.0", transitive_headers=True) # also update Boost_VERSION_MACRO below! + self.requires("boost/1.84.0", transitive_headers=True) # also update Boost_VERSION_MACRO below! def validate(self): if self.settings.compiler.cppstd: @@ -90,9 +90,11 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + tc.variables["MPFR"] = False tc.variables["GMP"] = self.options.with_gmp tc.variables["BOOST"] = self.options.with_boost - tc.variables["Boost_VERSION_MACRO"] = "108300" + tc.variables["Boost_VERSION_MACRO"] = "108400" + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) if self.options.with_gmp: diff --git a/recipes/soplex/all/test_package/CMakeLists.txt b/recipes/soplex/all/test_package/CMakeLists.txt index e74edd1950d7a..f734804072478 100644 --- a/recipes/soplex/all/test_package/CMakeLists.txt +++ b/recipes/soplex/all/test_package/CMakeLists.txt @@ -9,5 +9,9 @@ if(TARGET soplex::soplex) set_target_properties(soplex PROPERTIES INTERFACE_LINK_LIBRARIES soplex::soplex) endif() +if (MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") +endif () + add_executable(${PROJECT_NAME} main.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE soplex) diff --git a/recipes/soplex/config.yml b/recipes/soplex/config.yml index 73bcf839da618..bce9fdb6e5c4d 100644 --- a/recipes/soplex/config.yml +++ b/recipes/soplex/config.yml @@ -1,4 +1,10 @@ versions: + "7.1.0": + folder: all + "7.0.1": + folder: all + "7.0.0": + folder: all "6.0.4": folder: all "6.0.3": diff --git a/recipes/spdlog/all/conandata.yml b/recipes/spdlog/all/conandata.yml index be20cdd979110..b8131b03e011e 100644 --- a/recipes/spdlog/all/conandata.yml +++ b/recipes/spdlog/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.14.1": + url: "https://github.com/gabime/spdlog/archive/v1.14.1.tar.gz" + sha256: "1586508029a7d0670dfcb2d97575dcdc242d3868a259742b69f100801ab4e16b" + "1.14.0": + url: "https://github.com/gabime/spdlog/archive/v1.14.0.tar.gz" + sha256: "429a6b73ade8285cb21f83bacf89e2821dd1720ea7faa3cb518ffe04b4e00efc" "1.13.0": url: "https://github.com/gabime/spdlog/archive/v1.13.0.tar.gz" sha256: "534f2ee1a4dcbeb22249856edfb2be76a1cf4f708a20b0ac2ed090ee24cfdbc9" diff --git a/recipes/spdlog/config.yml b/recipes/spdlog/config.yml index 86f1d33d1c720..c6637b62befb2 100644 --- a/recipes/spdlog/config.yml +++ b/recipes/spdlog/config.yml @@ -1,4 +1,8 @@ versions: + "1.14.1": + folder: "all" + "1.14.0": + folder: "all" "1.13.0": folder: "all" "1.12.0": diff --git a/recipes/speedb/all/conandata.yml b/recipes/speedb/all/conandata.yml new file mode 100644 index 0000000000000..63a7ae1e28120 --- /dev/null +++ b/recipes/speedb/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "2.8.0": + url: "https://github.com/speedb-io/speedb/archive/refs/tags/speedb/v2.8.0.tar.gz" + sha256: "ee7a55942a23d9589e5d3527364a2f9ae552ef7d52f6fd303dda25e4f27786ba" +patches: + "2.8.0": + - patch_file: "patches/2.8.0-0001-use-cci.patch" + patch_description: "use cci's package" + patch_type: "conan" + - patch_file: "patches/2.8.0-0002-fix-install.patch" + patch_description: "disable static lib installation on shared build" + patch_type: "conan" diff --git a/recipes/speedb/all/conanfile.py b/recipes/speedb/all/conanfile.py new file mode 100644 index 0000000000000..043f01899c023 --- /dev/null +++ b/recipes/speedb/all/conanfile.py @@ -0,0 +1,141 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + +class SpeedbConan(ConanFile): + name = "speedb" + description = "A RocksDB compliant high performance scalable embedded key-value store" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/speedb-io/speedb" + topics = ("rocksdb", "embedded", "key-value-store", "kvs", "storage-engine") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_snappy": [True, False], + "with_lz4": [True, False], + "with_zlib": [True, False], + "with_zstd": [True, False], + "with_core_tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_snappy": True, + "with_lz4": True, + "with_zlib": True, + "with_zstd": True, + "with_core_tools": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # TODO: support jemalloc, liburing + if self.options.with_snappy: + self.requires("snappy/1.1.10") + if self.options.with_lz4: + self.requires("lz4/1.9.4") + if self.options.with_zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_zstd: + self.requires("zstd/1.5.5") + if self.options.with_core_tools: + self.requires("gflags/2.2.2") + self.requires("readline/8.2") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_JEMALLOC"] = False + tc.variables["WITH_LIBURING"] = False + tc.variables["WITH_SNAPPY"] = self.options.with_snappy + tc.variables["WITH_LZ4"] = self.options.with_lz4 + tc.variables["WITH_ZLIB"] = self.options.with_zlib + tc.variables["WITH_ZSTD"] = self.options.with_zstd + tc.variables["WITH_TESTS"] = False + tc.variables["WITH_BENCHMARK_TOOLS"] = False + tc.variables["WITH_CORE_TOOLS"] = self.options.with_core_tools + tc.variables["WITH_GFLAGS"] = self.options.with_core_tools + tc.variables["WITH_TOOLS"] = False + tc.variables["ROCKSDB_BUILD_SHARED"] = self.options.shared + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # to avoid wrong CPU detection, modify not to use "-march=native" in apple-clang + if cross_building(self) and self.settings.compiler == "apple-clang": + replace_in_file(self, + os.path.join(self.source_folder, "CMakeLists.txt"), + """elseif(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64" AND NOT HAS_ARMV8_CRC)""", + "elseif(FALSE)" + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["speedb"] + self.cpp_info.set_property("pkg_config_name", "speedb") + self.cpp_info.set_property("cmake_file_name", "Speedb") + self.cpp_info.set_property("cmake_target_name", "Speedb::speedb") diff --git a/recipes/speedb/all/patches/2.8.0-0001-use-cci.patch b/recipes/speedb/all/patches/2.8.0-0001-use-cci.patch new file mode 100644 index 0000000000000..0c321d827ce99 --- /dev/null +++ b/recipes/speedb/all/patches/2.8.0-0001-use-cci.patch @@ -0,0 +1,35 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a579792..62299e9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -195,7 +195,11 @@ else() + find_package(zstd REQUIRED) + add_definitions(-DZSTD) + include_directories(${ZSTD_INCLUDE_DIR}) +- list(APPEND THIRDPARTY_LIBS zstd::zstd) ++ if (TARGET zstd::libzstd_shared) ++ list(APPEND THIRDPARTY_LIBS zstd::libzstd_shared) ++ else() ++ list(APPEND THIRDPARTY_LIBS zstd::libzstd_static) ++ endif() + endif() + endif() + +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index 90e76e2..96180cc 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -2,11 +2,12 @@ set(CORE_TOOLS + sst_dump.cc + ldb.cc + beezcli.cc) ++find_package(readline REQUIRED) + foreach(src ${CORE_TOOLS}) + get_filename_component(exename ${src} NAME_WE) + add_executable(${exename}${ARTIFACT_SUFFIX} + ${src}) +- target_link_libraries(${exename}${ARTIFACT_SUFFIX} ${ROCKSDB_LIB} readline) ++ target_link_libraries(${exename}${ARTIFACT_SUFFIX} ${ROCKSDB_LIB} readline::readline) + list(APPEND core_tool_deps ${exename}) + endforeach() + diff --git a/recipes/speedb/all/patches/2.8.0-0002-fix-install.patch b/recipes/speedb/all/patches/2.8.0-0002-fix-install.patch new file mode 100644 index 0000000000000..8306a64425750 --- /dev/null +++ b/recipes/speedb/all/patches/2.8.0-0002-fix-install.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 62299e9..43fe51d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1290,7 +1290,7 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS) + endforeach() + + install(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/modules" COMPONENT devel DESTINATION ${package_config_destination}) +- ++ if(NOT ROCKSDB_BUILD_SHARED) + install( + TARGETS ${ROCKSDB_STATIC_LIB} + EXPORT SpeedbTargets +@@ -1298,7 +1298,7 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS) + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) +- ++ endif() + if(ROCKSDB_BUILD_SHARED) + install( + TARGETS ${ROCKSDB_SHARED_LIB} diff --git a/recipes/speedb/all/test_package/CMakeLists.txt b/recipes/speedb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4353233f81e9a --- /dev/null +++ b/recipes/speedb/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Speedb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Speedb::speedb) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/speedb/all/test_package/conanfile.py b/recipes/speedb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/speedb/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/speedb/all/test_package/test_package.cpp b/recipes/speedb/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2d49c4d14da21 --- /dev/null +++ b/recipes/speedb/all/test_package/test_package.cpp @@ -0,0 +1,93 @@ +// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. +// This source code is licensed under both the GPLv2 (found in the +// COPYING file in the root directory) and Apache 2.0 License +// (found in the LICENSE.Apache file in the root directory). + +#include +#include + +#include "rocksdb/db.h" +#include "rocksdb/options.h" +#include "rocksdb/slice.h" + +using ROCKSDB_NAMESPACE::DB; +using ROCKSDB_NAMESPACE::Options; +using ROCKSDB_NAMESPACE::PinnableSlice; +using ROCKSDB_NAMESPACE::ReadOptions; +using ROCKSDB_NAMESPACE::Status; +using ROCKSDB_NAMESPACE::WriteBatch; +using ROCKSDB_NAMESPACE::WriteOptions; + +#if defined(OS_WIN) +std::string kDBPath = "C:\\Windows\\TEMP\\rocksdb_simple_example"; +#else +std::string kDBPath = "/tmp/rocksdb_simple_example"; +#endif + +int main() { + DB* db; + Options options; + // Optimize RocksDB. This is the easiest way to get RocksDB to perform well + options.IncreaseParallelism(); + options.OptimizeLevelStyleCompaction(); + // create the DB if it's not already present + options.create_if_missing = true; + + // open DB + Status s = DB::Open(options, kDBPath, &db); + assert(s.ok()); + + // Put key-value + s = db->Put(WriteOptions(), "key1", "value"); + assert(s.ok()); + std::string value; + // get value + s = db->Get(ReadOptions(), "key1", &value); + assert(s.ok()); + assert(value == "value"); + + // atomically apply a set of updates + { + WriteBatch batch; + batch.Delete("key1"); + batch.Put("key2", value); + s = db->Write(WriteOptions(), &batch); + } + + s = db->Get(ReadOptions(), "key1", &value); + assert(s.IsNotFound()); + + db->Get(ReadOptions(), "key2", &value); + assert(value == "value"); + + { + PinnableSlice pinnable_val; + db->Get(ReadOptions(), db->DefaultColumnFamily(), "key2", &pinnable_val); + assert(pinnable_val == "value"); + } + + { + std::string string_val; + // If it cannot pin the value, it copies the value to its internal buffer. + // The intenral buffer could be set during construction. + PinnableSlice pinnable_val(&string_val); + db->Get(ReadOptions(), db->DefaultColumnFamily(), "key2", &pinnable_val); + assert(pinnable_val == "value"); + // If the value is not pinned, the internal buffer must have the value. + assert(pinnable_val.IsPinned() || string_val == "value"); + } + + PinnableSlice pinnable_val; + s = db->Get(ReadOptions(), db->DefaultColumnFamily(), "key1", &pinnable_val); + assert(s.IsNotFound()); + // Reset PinnableSlice after each use and before each reuse + pinnable_val.Reset(); + db->Get(ReadOptions(), db->DefaultColumnFamily(), "key2", &pinnable_val); + assert(pinnable_val == "value"); + pinnable_val.Reset(); + // The Slice pointed by pinnable_val is not valid after this point + + delete db; + + return 0; +} diff --git a/recipes/speedb/config.yml b/recipes/speedb/config.yml new file mode 100644 index 0000000000000..64a500c0f05d7 --- /dev/null +++ b/recipes/speedb/config.yml @@ -0,0 +1,3 @@ +versions: + "2.8.0": + folder: all diff --git a/recipes/sqlcipher/all/conandata.yml b/recipes/sqlcipher/all/conandata.yml index b9d316e874757..3d9822ef95d64 100644 --- a/recipes/sqlcipher/all/conandata.yml +++ b/recipes/sqlcipher/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "4.6.0": + url: "https://github.com/sqlcipher/sqlcipher/archive/v4.6.0.zip" + sha256: "2d41ba2bf09c74a488f546551f65f0fa8517413307a0509dd2c87d66df6bff95" + "4.5.7": + url: "https://github.com/sqlcipher/sqlcipher/archive/v4.5.7.zip" + sha256: "4f7e00e4b485d162d638094daba354d04aabb0ca68b72cc1826f082b40c9fd7d" "4.5.6": url: "https://github.com/sqlcipher/sqlcipher/archive/v4.5.6.zip" sha256: "5d269166c33c39c4dc6fc14be4ac8cd78b022f8bd59b0775becf0c896331a539" @@ -21,6 +27,14 @@ sources: url: "https://github.com/sqlcipher/sqlcipher/archive/v4.3.0.zip" sha256: "41e1408465488e9c478ca5b7c5f8410405a10caa73b82db60ac115a76c563c05" patches: + "4.6.0": + - patch_file: patches/Makefile.in-v4.5.7.patch + - patch_file: patches/Makefile.msc-v4.5.7.patch + - patch_file: patches/fix_configure-v4.5.7.patch + "4.5.7": + - patch_file: patches/Makefile.in-v4.5.7.patch + - patch_file: patches/Makefile.msc-v4.5.7.patch + - patch_file: patches/fix_configure-v4.5.7.patch "4.5.6": - patch_file: patches/Makefile.in-v4.5.6.patch - patch_file: patches/Makefile.msc-v4.5.6.patch diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.5.7.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.5.7.patch new file mode 100644 index 0000000000000..63b0b52972962 --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.in-v4.5.7.patch @@ -0,0 +1,43 @@ +diff --git a/Makefile.in b/Makefile.in +index ce2617c..77242fc 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -677,8 +677,7 @@ SQLITE3_SHELL_TARGET = $(SQLITE3_SHELL_TARGET_@HAVE_WASI_SDK@) + # This is the default Makefile target. The objects listed here + # are what get build when you type just "make" with no arguments. + # +-all: sqlite3.h libsqlcipher.la $(SQLITE3_SHELL_TARGET) \ +- $(HAVE_TCL:1=libtclsqlite3.la) ++all: sqlite3.h libsqlcipher.la + + Makefile: $(TOP)/Makefile.in + ./config.status +@@ -1367,7 +1366,7 @@ fulltestonly: $(TESTPROGS) fuzztest + # Fuzz testing + # + # WARNING: When the "fuzztest" target is run by the testrunner.tcl script, +-# it does not actually run this code. Instead, it schedules equivalent ++# it does not actually run this code. Instead, it schedules equivalent + # commands. Therefore, if this target is updated, then code in + # testrunner_data.tcl (search for "trd_fuzztest_data") must also be updated. + # +@@ -1579,9 +1578,8 @@ lib_install: libsqlcipher.la + $(INSTALL) -d $(DESTDIR)$(libdir) + $(LTINSTALL) libsqlcipher.la $(DESTDIR)$(libdir) + +-install: sqlcipher$(TEXE) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install} ++install: lib_install sqlite3.h sqlcipher.pc + $(INSTALL) -d $(DESTDIR)$(bindir) +- $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir) + $(INSTALL) -d $(DESTDIR)$(includedir) + $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir) + $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir) +@@ -1596,7 +1594,7 @@ tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl + rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a + $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR) + +-clean: ++clean: + rm -f *.lo *.la *.o sqlcipher$(TEXE) libsqlcipher.la + rm -f sqlite3.h opcodes.* + rm -rf .libs .deps diff --git a/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.7.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.7.patch new file mode 100644 index 0000000000000..78ff7f03e70eb --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.7.patch @@ -0,0 +1,170 @@ +diff --git a/Makefile.msc b/Makefile.msc +index eb6461c..0e8907b 100644 +--- a/Makefile.msc ++++ b/Makefile.msc +@@ -299,9 +299,9 @@ SQLITE3H = sqlite3.h + # + !IFNDEF SQLITE3DLL + !IF $(FOR_WIN10)!=0 +-SQLITE3DLL = winsqlite3.dll ++SQLITE3DLL = sqlcipher.dll + !ELSE +-SQLITE3DLL = sqlite3.dll ++SQLITE3DLL = sqlcipher.dll + !ENDIF + !ENDIF + +@@ -309,9 +309,9 @@ SQLITE3DLL = sqlite3.dll + # + !IFNDEF SQLITE3LIB + !IF $(FOR_WIN10)!=0 +-SQLITE3LIB = winsqlite3.lib ++SQLITE3LIB = sqlcipher.lib + !ELSE +-SQLITE3LIB = sqlite3.lib ++SQLITE3LIB = sqlcipher.lib + !ENDIF + !ENDIF + +@@ -696,7 +696,7 @@ SHELL_CORE_SRC = $(SQLITE3C) + SHELL_CORE_DEP = $(SQLITE3DLL) + # <> + !ELSEIF $(USE_AMALGAMATION)==0 +-SHELL_CORE_DEP = libsqlite3.lib ++SHELL_CORE_DEP = sqlcipher.lib + # <> + !ELSE + SHELL_CORE_DEP = +@@ -719,7 +719,7 @@ TESTFIXTURE_DEP = zlib $(TESTFIXTURE_DEP) + SHELL_CORE_LIB = $(SQLITE3LIB) + # <> + !ELSEIF $(USE_AMALGAMATION)==0 +-SHELL_CORE_LIB = libsqlite3.lib ++SHELL_CORE_LIB = sqlcipher.lib + # <> + !ELSE + SHELL_CORE_LIB = +@@ -754,8 +754,9 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP + # C compiler options for the Windows 10 platform (needs MSVC 2015). + # + !IF $(FOR_WIN10)!=0 +-TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE +-BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE ++# /d2guard4 requires /guard:cf to be present as well, but it doesn't work with /Zi (Debug builds) ++TCC = $(TCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE ++BCC = $(BCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + !ENDIF + + # Also, we need to dynamically link to the correct MSVC runtime +@@ -1039,8 +1040,9 @@ TLIBS = + # default to file, 2 to default to memory, and 3 to force temporary + # tables to always be in memory. + # +-TCC = $(TCC) -DSQLITE_TEMP_STORE=1 +-RCC = $(RCC) -DSQLITE_TEMP_STORE=1 ++# Allow overriding the value ++TCC = $(TCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) ++RCC = $(RCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) + + # Enable/disable loadable extensions, and other optional features + # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). +@@ -1206,14 +1208,15 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)" + !ENDIF + LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE + LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib +-LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib ++# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL + !ENDIF + + # When compiling for UWP or the Windows 10 platform, some extra linker + # options are also required. + # + !IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0 +-LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib ++# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL ++LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE + LTLINKOPTS = $(LTLINKOPTS) mincore.lib + !IFDEF PSDKLIBPATH + LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)" +@@ -1268,7 +1271,7 @@ LTLIBS = $(LTLIBS) $(LIBICU) + # + LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \ + backup.lo bitvec.lo btmutex.lo btree.lo build.lo \ +- callback.lo complete.lo ctime.lo \ ++ callback.lo complete.lo crypto.lo crypto_impl.lo crypto_openssl.lo ctime.lo \ + date.lo dbpage.lo dbstat.lo delete.lo \ + expr.lo fault.lo fkey.lo \ + fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \ +@@ -1603,7 +1606,7 @@ TESTEXT = \ + $(TOP)\ext\rtree\test_rtreedoc.c \ + $(TOP)\ext\recover\sqlite3recover.c \ + $(TOP)\ext\recover\test_recover.c \ +- $(TOP)\ext\recover\dbdata.c ++ $(TOP)\ext\recover\dbdata.c + + # If use of zlib is enabled, add the "zipfile.c" source file. + # +@@ -1779,7 +1782,7 @@ ALL_TCL_TARGETS = + # This is the default Makefile target. The objects listed here + # are what get build when you type just "make" with no arguments. + # +-core: dll libsqlite3.lib shell ++core: dll sqlcipher.lib shell + + # Targets that require the Tcl library. + # +@@ -1798,11 +1801,13 @@ dll: $(SQLITE3DLL) + shell: $(SQLITE3EXE) + + # <> +-libsqlite3.lib: $(LIBOBJ) +- $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) ++# LTLIBPATHS is required to find the openssl/libressl libs ++sqlcipher.lib: $(LIBOBJ) ++ $(LTLIB) $(LTLIBPATHS) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) ++ ++libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib ++ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) + +-libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib +- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) + + tclsqlite3.def: tclsqlite.lo + echo EXPORTS > tclsqlite3.def +@@ -1824,9 +1829,9 @@ $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP) + $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) + + # <> +-sqlite3.def: libsqlite3.lib ++sqlite3.def: sqlcipher.lib + echo EXPORTS > sqlite3.def +- dumpbin /all libsqlite3.lib \ ++ dumpbin /all sqlcipher.lib \ + | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \ + | sort >> sqlite3.def + # <> +@@ -2013,6 +2018,15 @@ callback.lo: $(TOP)\src\callback.c $(HDR) + complete.lo: $(TOP)\src\complete.c $(HDR) + $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c + ++crypto.lo: $(TOP)\src\crypto.c $(HDR) ++ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto.c ++ ++crypto_impl.lo: $(TOP)\src\crypto_impl.c $(HDR) ++ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_impl.c ++ ++crypto_openssl.lo: $(TOP)\src\crypto_openssl.c $(HDR) ++ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_openssl.c ++ + ctime.lo: $(TOP)\src\ctime.c $(HDR) + $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c + +@@ -2432,7 +2446,7 @@ sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR) + # Rules to build the 'testfixture' application. + # + # If using the amalgamation, use sqlite3.c directly to build the test +-# fixture. Otherwise link against libsqlite3.lib. (This distinction is ++# fixture. Otherwise link against sqlcipher.lib. (This distinction is + # necessary because the test fixture requires non-API symbols which are + # hidden when the library is built via the amalgamation). + # diff --git a/recipes/sqlcipher/all/patches/fix_configure-v4.5.7.patch b/recipes/sqlcipher/all/patches/fix_configure-v4.5.7.patch new file mode 100644 index 0000000000000..902782af36686 --- /dev/null +++ b/recipes/sqlcipher/all/patches/fix_configure-v4.5.7.patch @@ -0,0 +1,20 @@ +diff --git a/configure b/configure +index 2ee4143..753e9b1 100755 +--- a/configure ++++ b/configure +@@ -12732,7 +12732,6 @@ then : + printf %s "(cached) " >&6 + else $as_nop + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lcrypto $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -12764,7 +12763,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes + then : + printf "%s\n" "#define HAVE_LIBCRYPTO 1" >>confdefs.h + +- LIBS="-lcrypto $LIBS" + + else $as_nop + as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5 diff --git a/recipes/sqlcipher/config.yml b/recipes/sqlcipher/config.yml index e679e5bd0c0e9..05e71e5640551 100644 --- a/recipes/sqlcipher/config.yml +++ b/recipes/sqlcipher/config.yml @@ -1,4 +1,8 @@ versions: + "4.6.0": + folder: all + "4.5.7": + folder: all "4.5.6": folder: all "4.5.1": diff --git a/recipes/sqlite3/all/conandata.yml b/recipes/sqlite3/all/conandata.yml index 1f5bb786d1767..ac208fb3cac3a 100644 --- a/recipes/sqlite3/all/conandata.yml +++ b/recipes/sqlite3/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.46.0": + url: "https://sqlite.org/2024/sqlite-amalgamation-3460000.zip" + sha256: "712a7d09d2a22652fb06a49af516e051979a3984adb067da86760e60ed51a7f5" + "3.45.3": + url: "https://sqlite.org/2024/sqlite-amalgamation-3450300.zip" + sha256: "ea170e73e447703e8359308ca2e4366a3ae0c4304a8665896f068c736781c651" "3.45.2": url: "https://sqlite.org/2024/sqlite-amalgamation-3450200.zip" sha256: "65230414820d43a6d1445d1d98cfe57e8eb9f7ac0d6a96ad6932e0647cce51db" diff --git a/recipes/sqlite3/config.yml b/recipes/sqlite3/config.yml index 97c45a94fa443..8482b7cd3dae3 100644 --- a/recipes/sqlite3/config.yml +++ b/recipes/sqlite3/config.yml @@ -1,4 +1,8 @@ versions: + "3.46.0": + folder: all + "3.45.3": + folder: all "3.45.2": folder: all "3.45.1": diff --git a/recipes/sqlite3mc/all/conandata.yml b/recipes/sqlite3mc/all/conandata.yml new file mode 100644 index 0000000000000..b6bf8601df3b1 --- /dev/null +++ b/recipes/sqlite3mc/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.8.6": + url: "https://github.com/utelle/SQLite3MultipleCiphers/archive/refs/tags/v1.8.6.tar.gz" + sha256: "7250e3d9ca4368df00d0ebfaa744add66b458a5de318728b95369d621ebf2028" + "1.8.4": + url: "https://github.com/utelle/SQLite3MultipleCiphers/archive/refs/tags/v1.8.4.tar.gz" + sha256: "453e1938a02c91796a013169d56f746f153d7c7a77b59894bf8462b341a343ca" + "1.8.0": + url: "https://github.com/utelle/SQLite3MultipleCiphers/archive/refs/tags/v1.8.0.tar.gz" + sha256: "13D9B939BEF7C7371D58A3874F83B18CF330EB2171205B3680ACDDB2215BE0E5" diff --git a/recipes/sqlite3mc/all/conanfile.py b/recipes/sqlite3mc/all/conanfile.py new file mode 100644 index 0000000000000..f99b4eebdebe5 --- /dev/null +++ b/recipes/sqlite3mc/all/conanfile.py @@ -0,0 +1,226 @@ +import os +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMakeDeps, CMakeToolchain, CMake +from conan.tools.files import get, copy +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class sqlite3mc(ConanFile): + name = "sqlite3mc" + package_type = "library" + + license = "MIT" + homepage = "https://github.com/utelle/SQLite3MultipleCiphers" + url = "https://github.com/conan-io/conan-center-index" + description = "The project SQLite3 Multiple Ciphers implements an encryption extension for SQLite with support for multiple ciphers." + topics = ("sqlite", "sqlite3", "sqlite3-encryption", "database-encryption", "sqlite3-extension") + + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "require_zlib": [True, False], + "static_runtime_link": [True, False], + "build_shell": [True, False], + "with_icu": [True, False], + "enable_debug": [True, False], + "soundex": [True, False], + "enable_column_metadata": [True, False], + "secure_delete": [True, False], + "enable_fts3": [True, False], + "enable_fts3_paranthesis": [True, False], + "enable_fts4": [True, False], + "enable_fts5": [True, False], + "enable_carray": [True, False], + "enable_csv": [True, False], + "enable_extfunc": [True, False], + "enable_geopoly": [True, False], + "enable_rtree": [True, False], + "enable_uuid": [True, False], + "use_uri": [True, False], + "user_authentication": [True, False], + "enable_preupdate_hook": [True, False], + "enable_session": [True, False], + "shell_is_utf8": [True, False], + "enable_fileio": [True, False], + "enable_regexp": [True, False], + "enable_series": [True, False], + "enable_sha3": [True, False], + "enable_explain_comments": [True, False], + "enable_dbpage_vtab": [True, False], + "enable_dbstat_vtab": [True, False], + "enable_stmtvtab": [True, False], + "enable_unknown_sql_function": [True, False], + "use_miniz": [True, False], + "enable_compress": [True, False], + "enable_sqlar": [True, False], + "enable_zipfile": [True, False], + "use_sqleet_legacy": [True, False], + "use_sqlcipher_legacy": [True, False], + "secure_memory": [True, False], + "use_random_fill_memory": [True, False], + "omit_aes_hardware_support": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "require_zlib": False, + "static_runtime_link": False, + "build_shell": False, + "with_icu": False, + "enable_debug": False, + "soundex": True, + "enable_column_metadata": True, + "secure_delete": True, + "enable_fts3": True, + "enable_fts3_paranthesis": True, + "enable_fts4": True, + "enable_fts5": True, + "enable_carray": True, + "enable_csv": True, + "enable_extfunc": True, + "enable_geopoly": True, + "enable_rtree": True, + "enable_uuid": True, + "use_uri": True, + "user_authentication": False, + "enable_preupdate_hook": False, + "enable_session": False, + "shell_is_utf8": True, + "enable_fileio": True, + "enable_regexp": True, + "enable_series": True, + "enable_sha3": True, + "enable_explain_comments": True, + "enable_dbpage_vtab": True, + "enable_dbstat_vtab": True, + "enable_stmtvtab": True, + "enable_unknown_sql_function": True, + "use_miniz": False, + "enable_compress": False, + "enable_sqlar": False, + "enable_zipfile": False, + "use_sqleet_legacy": False, + "use_sqlcipher_legacy": False, + "secure_memory": False, + "use_random_fill_memory": False, + "omit_aes_hardware_support": False + } + + def build_requirements(self): + self.tool_requires("cmake/[>=3.24 <4]") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "1.8.4": + # INFO: https://github.com/utelle/SQLite3MultipleCiphers/commit/3bb033956816b3301f026abb5e83087799de5bee + self.options.user_authentication = True + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.require_zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_icu: + self.requires("icu/74.1") + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + + tc = CMakeToolchain(self) + tc.variables["_SQLITE3MC_REQUIRE_ZLIB"] = self.options.require_zlib + tc.variables["SQLITE3MC_STATIC_RUNTIME_LINK"] = self.options.static_runtime_link + tc.variables["SQLITE3MC_STATIC"] = not self.options.shared + tc.variables["SQLITE3MC_BUILD_SHELL"] = self.options.build_shell + tc.variables["SQLITE3MC_WITH_ICU"] = self.options.with_icu + + tc.variables["SQLITE_ENABLE_DEBUG"] = self.options.enable_debug + tc.variables["SQLITE_SOUNDEX"] = self.options.soundex + tc.variables["SQLITE_ENABLE_COLUMN_METADATA"] = self.options.enable_column_metadata + tc.variables["SQLITE_SECURE_DELETE"] = self.options.secure_delete + tc.variables["SQLITE_ENABLE_FTS3"] = self.options.enable_fts3 + tc.variables["SQLITE_ENABLE_FTS3_PARENTHESIS"] = self.options.enable_fts3_paranthesis + tc.variables["SQLITE_ENABLE_FTS4"] = self.options.enable_fts4 + tc.variables["SQLITE_ENABLE_FTS5"] = self.options.enable_fts5 + + tc.variables["SQLITE_ENABLE_CARRAY"] = self.options.enable_carray + tc.variables["SQLITE_ENABLE_CSV"] = self.options.enable_csv + tc.variables["SQLITE_ENABLE_EXTFUNC"] = self.options.enable_extfunc + tc.variables["SQLITE_ENABLE_GEOPOLY"] = self.options.enable_geopoly + tc.variables["SQLITE_ENABLE_RTREE"] = self.options.enable_rtree + tc.variables["SQLITE_ENABLE_UUID"] = self.options.enable_uuid + tc.variables["SQLITE_USE_URI"] = self.options.use_uri + tc.variables["SQLITE_USER_AUTHENTICATION"] = self.options.user_authentication + tc.variables["SQLITE_ENABLE_PREUPDATE_HOOK"] = self.options.enable_preupdate_hook + tc.variables["SQLITE_ENABLE_SESSION"] = self.options.enable_session + tc.variables["SQLITE_SHELL_IS_UTF8"] = self.options.shell_is_utf8 + + # Options for library only + tc.variables["SQLITE_ENABLE_FILEIO"] = self.options.enable_fileio + tc.variables["SQLITE_ENABLE_REGEXP"] = self.options.enable_regexp + tc.variables["SQLITE_ENABLE_SERIES"] = self.options.enable_series + tc.variables["SQLITE_ENABLE_SHA3"] = self.options.enable_sha3 + + # Options for shell only (compatibility with official SQLite shell) + tc.variables["SQLITE_ENABLE_EXPLAIN_COMMENTS"] = self.options.enable_explain_comments + tc.variables["SQLITE_ENABLE_DBPAGE_VTAB"] = self.options.enable_dbpage_vtab + tc.variables["SQLITE_ENABLE_DBSTAT_VTAB"] = self.options.enable_dbstat_vtab + tc.variables["SQLITE_ENABLE_STMTVTAB"] = self.options.enable_stmtvtab + tc.variables["SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION"] = self.options.enable_unknown_sql_function + + # Embedded Compression + tc.variables["SQLITE3MC_USE_MINIZ"] = self.options.use_miniz + + # Compression/Options that require ZLIB + tc.variables["SQLITE_ENABLE_COMPRESS"] = self.options.enable_compress + tc.variables["SQLITE_ENABLE_SQLAR"] = self.options.enable_sqlar + tc.variables["SQLITE_ENABLE_ZIPFILE"] = self.options.enable_zipfile + + # Legacy Encryption Extensions + tc.variables["SQLITE3MC_USE_SQLEET_LEGACY"] = self.options.use_sqleet_legacy + tc.variables["SQLITE3MC_USE_SQLCIPHER_LEGACY"] = self.options.use_sqlcipher_legacy + + # Additional memory security (filling freed memory allocations with zeros or random data) + tc.variables["SQLITE3MC_SECURE_MEMORY"] = self.options.secure_memory + tc.variables["SQLITE3MC_USE_RANDOM_FILL_MEMORY"] = self.options.use_random_fill_memory + + # Omit AES hardware support + tc.variables["SQLITE3MC_OMIT_AES_HARDWARE_SUPPORT"] = self.options.omit_aes_hardware_support + + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), keep_path=False) + + def package_info(self): + if self.options.shared: + self.cpp_info.libs = ["sqlite3mc"] + else: + self.cpp_info.libs = ["sqlite3mc_static"] + if self.settings.os in ("Linux", "FreeBSD", "Macos"): + self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.append("dl") + self.cpp_info.system_libs.append("m") + if self.settings.os == "Macos": + self.cpp_info.frameworks.append("Security") diff --git a/recipes/sqlite3mc/all/test_package/CMakeLists.txt b/recipes/sqlite3mc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..79301e1094eb1 --- /dev/null +++ b/recipes/sqlite3mc/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_sqlite3mc C) + +find_package(sqlite3mc REQUIRED) + +add_executable(${PROJECT_NAME} + main.c +) + +target_link_libraries(${PROJECT_NAME} + sqlite3mc::sqlite3mc +) diff --git a/recipes/sqlite3mc/all/test_package/conanfile.py b/recipes/sqlite3mc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1b70bb597a5da --- /dev/null +++ b/recipes/sqlite3mc/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class sqlite3mcTest(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def layout(self): + cmake_layout(self) + + def test(self): + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "test_sqlite3mc") + self.run(cmd, env="conanrun") diff --git a/recipes/sqlite3mc/all/test_package/main.c b/recipes/sqlite3mc/all/test_package/main.c new file mode 100644 index 0000000000000..efb9f3b4c701d --- /dev/null +++ b/recipes/sqlite3mc/all/test_package/main.c @@ -0,0 +1,73 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + sqlite3 *db; + const char *key = "password"; + const char *wrongKey = "wrongPassword"; + + // Create database + int rc = sqlite3_open("test.db", &db); + if (rc != SQLITE_OK) + { + fprintf(stderr, "Failed to open database: %s\n", sqlite3_errmsg(db)); + sqlite3_close(db); + return 1; + } + + // Encrypt + sqlite3_key(db, key, strlen(key)); + + // Fill db with some data and close it + rc = sqlite3_exec(db, "CREATE TABLE users (name TEXT NOT NULL, ID INTEGER PRIMARY KEY UNIQUE)", NULL, NULL, NULL); + if (rc != SQLITE_OK) + { + fprintf(stderr, "SQL error: %s\n", sqlite3_errmsg(db)); + sqlite3_close(db); + return 1; + } + rc = sqlite3_exec(db, "INSERT INTO users (name, ID) VALUES ('testUser', '12345')", NULL, NULL, NULL); + if (rc != SQLITE_OK) + { + fprintf(stderr, "SQL error: %s\n", sqlite3_errmsg(db)); + sqlite3_close(db); + return 1; + } + rc = sqlite3_close(db); + if (rc != SQLITE_OK) + { + fprintf(stderr, "Failed to close database: %s\n", sqlite3_errmsg(db)); + return 1; + } + + // Reopen and provide wrong key + rc = sqlite3_open("test.db", &db); + if (rc != SQLITE_OK) + { + fprintf(stderr, "Failed to open database: %s\n", sqlite3_errmsg(db)); + sqlite3_close(db); + return 1; + } + sqlite3_key(db, wrongKey, strlen(wrongKey)); + + // Try to access the database, should fail + rc = sqlite3_exec(db, "SELECT name FROM users WHERE ID = '12345'", NULL, NULL, NULL); + if (rc == SQLITE_OK) + { + fprintf(stderr, "Access was provided without the proper key\n"); + sqlite3_close(db); + return 1; + } + rc = sqlite3_close(db); + if (rc != SQLITE_OK) + { + fprintf(stderr, "Failed to close database: %s\n", sqlite3_errmsg(db)); + return 1; + } + + + fprintf(stdout, "Test successful\n"); + return 0; +} diff --git a/recipes/sqlite3mc/config.yml b/recipes/sqlite3mc/config.yml new file mode 100644 index 0000000000000..fe83104a79e5b --- /dev/null +++ b/recipes/sqlite3mc/config.yml @@ -0,0 +1,7 @@ +versions: + "1.8.6": + folder: all + "1.8.4": + folder: all + "1.8.0": + folder: all diff --git a/recipes/stb/all/conandata.yml b/recipes/stb/all/conandata.yml index c0c0739831fe0..475c92e1a56fd 100644 --- a/recipes/stb/all/conandata.yml +++ b/recipes/stb/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20240213": + url: "https://github.com/nothings/stb/archive/ae721c50eaf761660b4f90cc590453cdb0c2acd0.zip" + sha256: "5d075769721e676746d0c25b698a0f00741f68252f9ab4b7ee245c513aeec3de" "cci.20230920": url: "https://github.com/nothings/stb/archive/5736b15f7ea0ffb08dd38af21067c314d6a3aae9.zip" sha256: "b6601f182fa4bc04dd0f135e38231e8a2c6c9e7901c66a942871f03285713b05" diff --git a/recipes/stb/config.yml b/recipes/stb/config.yml index a0248de0acece..6df647ee3d6a7 100644 --- a/recipes/stb/config.yml +++ b/recipes/stb/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20240213": + folder: all "cci.20230920": folder: all "cci.20220909": diff --git a/recipes/stella-cv-fbow/all/conandata.yml b/recipes/stella-cv-fbow/all/conandata.yml new file mode 100644 index 0000000000000..54c56ba718ab0 --- /dev/null +++ b/recipes/stella-cv-fbow/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20240508": + url: "https://github.com/stella-cv/FBoW/archive/c6e3c29e3332a0b0834021797e2aa4e8eb66a3c1.zip" + sha256: "23d866d86eaca6a85da8fe3e542b94324d5f6be4b37691cf82cd74a6cfd838bd" diff --git a/recipes/stella-cv-fbow/all/conanfile.py b/recipes/stella-cv-fbow/all/conanfile.py new file mode 100644 index 0000000000000..14eb8529d8c92 --- /dev/null +++ b/recipes/stella-cv-fbow/all/conanfile.py @@ -0,0 +1,127 @@ +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, replace_in_file + +required_conan_version = ">=1.53.0" + + +class StellaCvFbowConan(ConanFile): + name = "stella-cv-fbow" + description = "FBoW (Fast Bag of Words) is an extremely optimized version of the DBoW2/DBoW3 libraries." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/stella-cv/FBoW" + topics = ("bag-of-words", "computer-vision", "visual-slam", "dbow") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "fast_math": [True, False], + "avx": [True, False], + "mmx": [True, False], + "sse": [True, False], + "sse2": [True, False], + "sse3": [True, False], + "sse4": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "fast_math": True, + "avx": True, + "mmx": True, + "sse": True, + "sse2": True, + "sse3": True, + "sse4": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.arch not in ["x86", "x86_64"] or self.settings.compiler not in ["gcc", "clang", "apple-clang"]: + del self.options.avx + del self.options.mmx + del self.options.sse + del self.options.sse2 + del self.options.sse3 + del self.options.sse4 + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # https://github.com/stella-cv/FBoW/blob/master/include/fbow/vocabulary.h#L35 + self.requires("opencv/4.9.0", transitive_headers=True, transitive_libs=True) + self.requires("llvm-openmp/17.0.6") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_FAST_MATH"] = self.options.fast_math + tc.variables["USE_AVX"] = self.options.get_safe("avx", False) + tc.variables["USE_MMX"] = self.options.get_safe("mmx", False) + tc.variables["USE_SSE"] = self.options.get_safe("sse", False) + tc.variables["USE_SSE2"] = self.options.get_safe("sse2", False) + tc.variables["USE_SSE3"] = self.options.get_safe("sse3", False) + tc.variables["USE_SSE4"] = self.options.get_safe("sse4", False) + tc.variables["BUILD_UTILS"] = False + tc.variables["BUILD_TESTS"] = False + tc.variables["USE_CONTRIB"] = self.dependencies["opencv"].options.xfeatures2d + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + # Let Conan set the C++ standard + if self.settings.compiler.cppstd: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_CXX_STANDARD 11)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "fbow") + self.cpp_info.set_property("cmake_target_name", "fbow::fbow") + # unofficial + self.cpp_info.set_property("pkg_config_name", "fbow") + + self.cpp_info.libs = ["fbow"] + self.cpp_info.requires = [ + "opencv::opencv_core", + "opencv::opencv_features2d", + "opencv::opencv_highgui", + "llvm-openmp::llvm-openmp", + ] + if self.dependencies["opencv"].options.xfeatures2d: + self.cpp_info.requires.append("opencv::opencv_xfeatures2d") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/stella-cv-fbow/all/test_package/CMakeLists.txt b/recipes/stella-cv-fbow/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..825104df78ead --- /dev/null +++ b/recipes/stella-cv-fbow/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(fbow REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fbow::fbow) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/stella-cv-fbow/all/test_package/conanfile.py b/recipes/stella-cv-fbow/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/stella-cv-fbow/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/stella-cv-fbow/all/test_package/test_package.cpp b/recipes/stella-cv-fbow/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f51d557796902 --- /dev/null +++ b/recipes/stella-cv-fbow/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include +#include + +int main() { + auto features = fbow::cpu(); + features.detect_host(); + std::cout << "CPU Vendor String: " << fbow::cpu::get_vendor_string() << '\n'; + std::cout << "64-bit = " << features.OS_x64 << '\n'; +} diff --git a/recipes/stella-cv-fbow/config.yml b/recipes/stella-cv-fbow/config.yml new file mode 100644 index 0000000000000..ea26172cf981e --- /dev/null +++ b/recipes/stella-cv-fbow/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20240508": + folder: all diff --git a/recipes/strawberryperl/all/conanfile.py b/recipes/strawberryperl/all/conanfile.py index e5d600869e82f..f6b47f3dd18e0 100644 --- a/recipes/strawberryperl/all/conanfile.py +++ b/recipes/strawberryperl/all/conanfile.py @@ -14,6 +14,7 @@ class StrawberryPerlConan(ConanFile): homepage = "http://strawberryperl.com" url = "https://github.com/conan-io/conan-center-index" topics = ("perl", "interpreter", "windows") + package_type = "application" settings = "os", "arch", "compiler", "build_type" def layout(self): @@ -24,8 +25,10 @@ def package_id(self): del self.info.settings.build_type def validate(self): - if self.info.settings.os != "Windows": - raise ConanInvalidConfiguration("Strawberry Perl is only intended to be used on Windows.") + if self.settings.os != "Windows": + raise ConanInvalidConfiguration(f"{self.ref} is only intended to be used on Windows.") + if self.settings.arch not in ("x86", "x86_64"): + raise ConanInvalidConfiguration(f"{self.ref} is only available for x86 and x86_64 architectures.") def source(self): pass diff --git a/recipes/streaming-percentiles/all/conandata.yml b/recipes/streaming-percentiles/all/conandata.yml new file mode 100644 index 0000000000000..475aaed46b221 --- /dev/null +++ b/recipes/streaming-percentiles/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "3.1.0": + url: "https://github.com/sengelha/streaming-percentiles/archive/refs/tags/v3.1.0.tar.gz" + sha256: "196d76a7d7ce1bcdb6f720b1c2d8feb1cda62ac18cc6412f8bd907e4eafbab6c" +patches: + "3.1.0": + - patch_file: "patches/3.1.0-0001-add-includes.patch" + patch_description: "include missing headers (already applied to upstream)" + patch_type: "backport" + patch_source: "https://github.com/sengelha/streaming-percentiles/commit/058037eca3e05fafa1b53071137f3c168a9fdd92" diff --git a/recipes/streaming-percentiles/all/conanfile.py b/recipes/streaming-percentiles/all/conanfile.py new file mode 100644 index 0000000000000..6b5b0813aa365 --- /dev/null +++ b/recipes/streaming-percentiles/all/conanfile.py @@ -0,0 +1,54 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +from conan.tools.build import check_min_cppstd +import os + +required_conan_version = ">=1.52.0" + +class StreamingPercentilesConan(ConanFile): + name = "streaming-percentiles" + description = "Cross-platform, multi-language implementation of multiple streaming percentile algorithms" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sengelha/streaming-percentiles" + topics = ("streaming", "percentiles", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 11 + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.hpp", + os.path.join(self.source_folder, "cpp", "src"), + self.package_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/streaming-percentiles/all/patches/3.1.0-0001-add-includes.patch b/recipes/streaming-percentiles/all/patches/3.1.0-0001-add-includes.patch new file mode 100644 index 0000000000000..8c015b7b047b4 --- /dev/null +++ b/recipes/streaming-percentiles/all/patches/3.1.0-0001-add-includes.patch @@ -0,0 +1,62 @@ +diff --git a/cpp/src/include/stmpct/ckms_hbq.hpp b/cpp/src/include/stmpct/ckms_hbq.hpp +index 87cf860..850d527 100644 +--- a/cpp/src/include/stmpct/ckms_hbq.hpp ++++ b/cpp/src/include/stmpct/ckms_hbq.hpp +@@ -4,6 +4,7 @@ + // quantiles as defined in the paper _Effective Computation of Biased + // Quantiles over Data Streams_ + ++#include + #include "ckms_impl.hpp" + + namespace stmpct { +diff --git a/cpp/src/include/stmpct/ckms_lbq.hpp b/cpp/src/include/stmpct/ckms_lbq.hpp +index fb932af..c62d61d 100644 +--- a/cpp/src/include/stmpct/ckms_lbq.hpp ++++ b/cpp/src/include/stmpct/ckms_lbq.hpp +@@ -4,6 +4,7 @@ + // quantiles as defined in the paper _Effective Computation of Biased + // Quantiles over Data Streams_ + ++#include + #include "ckms_impl.hpp" + + namespace stmpct { +diff --git a/cpp/src/include/stmpct/ckms_tq.hpp b/cpp/src/include/stmpct/ckms_tq.hpp +index ac9dde8..5d1f093 100644 +--- a/cpp/src/include/stmpct/ckms_tq.hpp ++++ b/cpp/src/include/stmpct/ckms_tq.hpp +@@ -4,6 +4,8 @@ + // quantiles as defined in the paper _Effective Computation of Biased + // Quantiles over Data Streams_ + ++#include ++#include + #include "ckms_impl.hpp" + #include "targeted_quantile.hpp" + +diff --git a/cpp/src/include/stmpct/ckms_uq.hpp b/cpp/src/include/stmpct/ckms_uq.hpp +index d0d3837..c417ddc 100644 +--- a/cpp/src/include/stmpct/ckms_uq.hpp ++++ b/cpp/src/include/stmpct/ckms_uq.hpp +@@ -5,6 +5,7 @@ + // Quantiles over Data Streams_. Conceptually nearly equivalent to + // the GK algorithm. + ++#include + #include "ckms_impl.hpp" + + namespace stmpct { +diff --git a/cpp/src/include/stmpct/gk.hpp b/cpp/src/include/stmpct/gk.hpp +index 6b7a1c6..bf4e163 100644 +--- a/cpp/src/include/stmpct/gk.hpp ++++ b/cpp/src/include/stmpct/gk.hpp +@@ -1,6 +1,8 @@ + #pragma once + ++#include + #include ++#include + + // The Greenwald-Khanna algorithm as defined in the paper + // Space-Efficient Online Computation of Quantile Summaries diff --git a/recipes/streaming-percentiles/all/test_package/CMakeLists.txt b/recipes/streaming-percentiles/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0259c93280ffb --- /dev/null +++ b/recipes/streaming-percentiles/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(streaming-percentiles REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE streaming-percentiles::streaming-percentiles) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/streaming-percentiles/all/test_package/conanfile.py b/recipes/streaming-percentiles/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/streaming-percentiles/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/streaming-percentiles/all/test_package/test_package.cpp b/recipes/streaming-percentiles/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6bead07a3dd0f --- /dev/null +++ b/recipes/streaming-percentiles/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include + +#include "stmpct/gk.hpp" +int main(int argc, char* argv[]) { + double epsilon = 0.1; + stmpct::gk g(epsilon); + for (int i = 0; i < 1000; ++i) + g.insert(rand()); + double p50 = g.quantile(0.5); // Approx. median + double p95 = g.quantile(0.95); // Approx. 95th percentile + + std::cout << "median : " << p50 << " 95th percentile : " << p95 << std::endl; + + return 0; +} diff --git a/recipes/streaming-percentiles/config.yml b/recipes/streaming-percentiles/config.yml new file mode 100644 index 0000000000000..baa80af0c4b7d --- /dev/null +++ b/recipes/streaming-percentiles/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1.0": + folder: all diff --git a/recipes/string-view-lite/all/conandata.yml b/recipes/string-view-lite/all/conandata.yml index 84f246b4d8a4d..49123d0095698 100644 --- a/recipes/string-view-lite/all/conandata.yml +++ b/recipes/string-view-lite/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.0": + url: "https://github.com/martinmoene/string-view-lite/archive/v1.8.0.tar.gz" + sha256: "9b38c32621eb1a81a7fa59427144309225c414a7bae522ab3a2d9ae239dd35be" "1.7.0": url: "https://github.com/martinmoene/string-view-lite/archive/v1.7.0.tar.gz" sha256: "265eaec08c4555259b46f5b03004dbc0f7206384edfac1cd5a837efaa642e01c" diff --git a/recipes/string-view-lite/all/conanfile.py b/recipes/string-view-lite/all/conanfile.py index 3306dff001e24..05850dbb27134 100644 --- a/recipes/string-view-lite/all/conanfile.py +++ b/recipes/string-view-lite/all/conanfile.py @@ -8,11 +8,11 @@ class StringViewLite(ConanFile): name = "string-view-lite" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/martinmoene/string-view-lite" description = "string-view lite - A C++17-like string_view for C++98, C++11 and later in a single-file header-only library" - topics = ("cpp98", "cpp11", "cpp14", "cpp17", "string-view", "string-view-implementations") license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/string-view-lite" + topics = ("cpp98", "cpp11", "cpp14", "cpp17", "string-view", "string-view-implementations", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/string-view-lite/config.yml b/recipes/string-view-lite/config.yml index f05245374fbdd..4a0cc99434665 100644 --- a/recipes/string-view-lite/config.yml +++ b/recipes/string-view-lite/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.0": + folder: all "1.7.0": folder: all "1.6.0": diff --git a/recipes/stringzilla/all/conandata.yml b/recipes/stringzilla/all/conandata.yml index 182ba818238f7..9a0f2b597bc71 100644 --- a/recipes/stringzilla/all/conandata.yml +++ b/recipes/stringzilla/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.8.4": + url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v3.8.4.tar.gz" + sha256: "4132957633d28ce2651e587f2ab736cdf174e61b8ab1bcef453b21d40a2d872e" "2.0.4": url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v2.0.4.tar.gz" sha256: "440d3d586f8cfe96bc7648f01f2d3c514c4e2dc22446caeb50599383d1970ed2" diff --git a/recipes/stringzilla/all/conanfile.py b/recipes/stringzilla/all/conanfile.py index bded9fa3b6426..af7a34cd5d72b 100644 --- a/recipes/stringzilla/all/conanfile.py +++ b/recipes/stringzilla/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.files import get, copy from conan.tools.layout import basic_layout from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version import os required_conan_version = ">=1.52.0" @@ -36,12 +37,26 @@ def source(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, "stringzilla"), - ) + if Version(self.version) < "3.0.0": + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "stringzilla"), + ) + else: + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + 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.bindirs = [] diff --git a/recipes/stringzilla/all/test_package/CMakeLists.txt b/recipes/stringzilla/all/test_package/CMakeLists.txt index 6769ff716eab8..5bcb77f146e86 100644 --- a/recipes/stringzilla/all/test_package/CMakeLists.txt +++ b/recipes/stringzilla/all/test_package/CMakeLists.txt @@ -3,9 +3,12 @@ project(test_package LANGUAGES CXX) find_package(stringzilla REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.cpp) +if (stringzilla_VERSION VERSION_LESS 2.0) + add_executable(${PROJECT_NAME} test_package.cpp) +elseif(stringzilla_VERSION VERSION_LESS 3.0) + add_executable(${PROJECT_NAME} test_package_2_0.cpp) +else() + add_executable(${PROJECT_NAME} test_package_3_0.cpp) +endif() target_link_libraries(${PROJECT_NAME} PRIVATE stringzilla::stringzilla) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -if(stringzilla_VERSION VERSION_LESS 2.0) - target_compile_definitions(${PROJECT_NAME} PRIVATE STRINGZILLA_LESS_2_0) -endif() diff --git a/recipes/stringzilla/all/test_package/conanfile.py b/recipes/stringzilla/all/test_package/conanfile.py index 3a91c9439218e..dd09e74d7fe14 100644 --- a/recipes/stringzilla/all/test_package/conanfile.py +++ b/recipes/stringzilla/all/test_package/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout, CMake +from conan.tools.cmake import CMake, cmake_layout import os diff --git a/recipes/stringzilla/all/test_package/test_package.cpp b/recipes/stringzilla/all/test_package/test_package.cpp index c5ffe699dbc06..6829d24ab3783 100644 --- a/recipes/stringzilla/all/test_package/test_package.cpp +++ b/recipes/stringzilla/all/test_package/test_package.cpp @@ -1,8 +1,7 @@ #include #include -#include "stringzilla.h" -#ifdef STRINGZILLA_LESS_2_0 +#include "stringzilla.h" int main(void) { // Initialize your haystack and needle @@ -24,29 +23,3 @@ int main(void) { return EXIT_SUCCESS; } - -#else - -int main(void) { - // Initialize your haystack and needle - sz_string_view_t haystack = { - "Fastest string sort, search, split, " - "and shuffle for long strings and multi-gigabyte files in Python and C, " - "leveraging SIMD with Arm Neon and x86 AVX2 & AVX-512 intrinsics.", - 171}; - sz_string_view_t needle = {"SIMD", 4}; - - // Perform string-level operations - sz_size_t character_count = sz_count_char(haystack.start, haystack.length, "a"); - sz_string_start_t substring_position = sz_find_substring( - haystack.start, haystack.length, - needle.start, needle.length - ); - - // Hash strings - sz_u32_t crc32 = sz_hash_crc32(haystack.start, haystack.length); - - return EXIT_SUCCESS; -} - -#endif diff --git a/recipes/stringzilla/all/test_package/test_package_2_0.cpp b/recipes/stringzilla/all/test_package/test_package_2_0.cpp new file mode 100644 index 0000000000000..c165ef341d114 --- /dev/null +++ b/recipes/stringzilla/all/test_package/test_package_2_0.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include "stringzilla.h" + +int main(void) { + // Initialize your haystack and needle + sz_string_view_t haystack = { + "Fastest string sort, search, split, " + "and shuffle for long strings and multi-gigabyte files in Python and C, " + "leveraging SIMD with Arm Neon and x86 AVX2 & AVX-512 intrinsics.", + 171}; + sz_string_view_t needle = {"SIMD", 4}; + + // Perform string-level operations + sz_size_t character_count = sz_count_char(haystack.start, haystack.length, "a"); + sz_string_start_t substring_position = sz_find_substring( + haystack.start, haystack.length, + needle.start, needle.length + ); + + // Hash strings + sz_u32_t crc32 = sz_hash_crc32(haystack.start, haystack.length); + + return EXIT_SUCCESS; +} diff --git a/recipes/stringzilla/all/test_package/test_package_3_0.cpp b/recipes/stringzilla/all/test_package/test_package_3_0.cpp new file mode 100644 index 0000000000000..9611c090a6122 --- /dev/null +++ b/recipes/stringzilla/all/test_package/test_package_3_0.cpp @@ -0,0 +1,20 @@ +#include +#include + +#include "stringzilla/stringzilla.hpp" + +namespace sz = ashvardanian::stringzilla; + +int main(void) { + sz::string haystack = "some string"; + sz::string_view needle = sz::string_view(haystack).substr(0, 4); + + auto substring_position = haystack.find(needle); // Or `rfind` + + haystack.end() - haystack.begin() == haystack.size(); // Or `rbegin`, `rend` + haystack.find_first_of(" \w\t") == 4; // Or `find_last_of`, `find_first_not_of`, `find_last_not_of` + haystack.starts_with(needle) == true; // Or `ends_with` + haystack.remove_prefix(needle.size()); // Why is this operation in-place?! + + return EXIT_SUCCESS; +} diff --git a/recipes/stringzilla/config.yml b/recipes/stringzilla/config.yml index c0ea771b63446..1873ea240511d 100644 --- a/recipes/stringzilla/config.yml +++ b/recipes/stringzilla/config.yml @@ -1,4 +1,6 @@ versions: + "3.8.4": + folder: all "2.0.4": folder: all "2.0.3": diff --git a/recipes/strong_type/all/conandata.yml b/recipes/strong_type/all/conandata.yml index 33e85e480c828..f9c56ef18c867 100644 --- a/recipes/strong_type/all/conandata.yml +++ b/recipes/strong_type/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "v15": + url: "https://github.com/rollbear/strong_type/archive/refs/tags/v15.tar.gz" + sha256: "d445398d4c4d6795060ac2b60be146b3cd7e6039985244b2d56f9bc333f20bae" "v14": url: "https://github.com/rollbear/strong_type/archive/refs/tags/v14.tar.gz" sha256: "6cc5a6f8de5b52e6c9e4c8b246b6052b5943d6de9b314660009e092af522d2fc" diff --git a/recipes/strong_type/config.yml b/recipes/strong_type/config.yml index 5469ad726c024..b91eac17af3a4 100644 --- a/recipes/strong_type/config.yml +++ b/recipes/strong_type/config.yml @@ -1,4 +1,6 @@ versions: + "v15": + folder: all "v14": folder: all "v13": diff --git a/recipes/swig/all/cmake/conan-official-swig-targets.cmake b/recipes/swig/all/cmake/conan-official-swig-targets.cmake deleted file mode 100644 index 8740b23580975..0000000000000 --- a/recipes/swig/all/cmake/conan-official-swig-targets.cmake +++ /dev/null @@ -1,7 +0,0 @@ -find_program(SWIG_EXECUTABLE swig) -if(NOT SWIG_DIR) - execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib - OUTPUT_VARIABLE SWIG_lib_output OUTPUT_STRIP_TRAILING_WHITESPACE) - set(SWIG_DIR ${SWIG_lib_output} CACHE STRING "Location of SWIG library" FORCE) -endif() -mark_as_advanced(SWIG_DIR SWIG_EXECUTABLE) diff --git a/recipes/swig/all/cmake/conan-swig-variables.cmake b/recipes/swig/all/cmake/conan-swig-variables.cmake new file mode 100644 index 0000000000000..3421127d0076f --- /dev/null +++ b/recipes/swig/all/cmake/conan-swig-variables.cmake @@ -0,0 +1,3 @@ +find_program(SWIG_EXECUTABLE swig) +# CMakeDeps sets SWIG_DIR to the generators folder, override it to the correct value +get_filename_component(SWIG_DIR "${SWIG_EXECUTABLE}/../swiglib" ABSOLUTE) diff --git a/recipes/swig/all/conandata.yml b/recipes/swig/all/conandata.yml index 7c4f531b134a3..5daf69357f98b 100644 --- a/recipes/swig/all/conandata.yml +++ b/recipes/swig/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.1.1": + url: "https://github.com/swig/swig/archive/refs/tags/v4.1.1.tar.gz" + sha256: "4d97f9528dda8ced8b762e405dff2da38cc4603ef5f868f7287c94872f693265" "4.1.0": url: "https://github.com/swig/swig/archive/refs/tags/v4.1.0.tar.gz" sha256: "5b9313b1af5edfcea158a389520be266f013bc9be4ce933d79a30c5659ba99fe" @@ -9,18 +12,31 @@ sources: url: "https://github.com/swig/swig/archive/rel-4.0.1.tar.gz" sha256: "2eaf6fb89d071d1be280bf995c63360b3729860c0da64948123b5d7e4cfb6cb7" patches: + "4.1.1": + - patch_file: "patches/0001-4.1.0-swig-linux-library-path.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" + - patch_file: "patches/0002-4.1.0-do-not-define-SWIG_LIB_WIN_UNIX.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" "4.1.0": - - base_path: "source_subfolder" - patch_file: "patches/0001-4.1.0-swig-linux-library-path.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-4.1.0-do-not-define-SWIG_LIB_WIN_UNIX.patch" + - patch_file: "patches/0001-4.1.0-swig-linux-library-path.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" + - patch_file: "patches/0002-4.1.0-do-not-define-SWIG_LIB_WIN_UNIX.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" "4.0.2": - - base_path: "source_subfolder" - patch_file: "patches/0001-swig-linux-library-path.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-4.0.2-do-not-define-SWIG_LIB_WIN_UNIX.patch" + - patch_file: "patches/0001-swig-linux-library-path.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" + - patch_file: "patches/0002-4.0.2-do-not-define-SWIG_LIB_WIN_UNIX.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" "4.0.1": - - base_path: "source_subfolder" - patch_file: "patches/0001-swig-linux-library-path.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-4.0.1-do-not-define-SWIG_LIB_WIN_UNIX.patch" + - patch_file: "patches/0001-swig-linux-library-path.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" + - patch_file: "patches/0002-4.0.1-do-not-define-SWIG_LIB_WIN_UNIX.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" diff --git a/recipes/swig/all/conanfile.py b/recipes/swig/all/conanfile.py index 432bfb37aeca5..d1ed51bb5b937 100644 --- a/recipes/swig/all/conanfile.py +++ b/recipes/swig/all/conanfile.py @@ -1,170 +1,192 @@ -from conan import ConanFile -from conan.tools.files import get -from conans import AutoToolsBuildEnvironment, tools -import contextlib -import functools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.apple import is_apple_os, to_apple_arch +from conan.tools.env import VirtualBuildEnv, Environment +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rmdir, 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 +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class SwigConan(ConanFile): name = "swig" description = "SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages." + license = "GPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.swig.org" - license = "GPL-3.0-or-later" - topics = ("swig", "python", "java", "wrapper") - exports_sources = "patches/**", "cmake/*" - settings = "os", "arch", "compiler", "build_type" + topics = ("python", "java", "wrapper") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + def configure(self): + # SWIG prefers static linking + self.options["pcre"].shared = False + self.options["pcre2"].shared = False + self.options["libgettext"].shared = False + + def export_sources(self): + copy(self, "cmake/*", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + @property def _use_pcre2(self): - return self.version not in ['4.0.1', '4.0.2'] - + return Version(self.version) >= "4.1" def requirements(self): if self._use_pcre2: - self.requires("pcre2/10.40") + self.requires("pcre2/10.43") else: self.requires("pcre/8.45") - - def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - if self.settings.compiler == "Visual Studio": - self.build_requires("winflexbison/2.5.24") - else: - self.build_requires("bison/3.8.2") - self.build_requires("automake/1.16.5") + if is_apple_os(self): + self.requires("libgettext/0.22") def package_id(self): del self.info.settings.compiler - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @property - def _user_info_build(self): - # If using the experimental feature with different context for host and - # build, the 'user_info' attributes of the 'build_requires' packages - # will be located into the 'user_info_build' object. In other cases they - # will be located into the 'deps_user_info' object. - return getattr(self, "user_info_build", self.deps_user_info) - - @contextlib.contextmanager - def _build_context(self): - env = {} - if self.settings.compiler != "Visual Studio": - env["YACC"] = self._user_info_build["bison"].YACC - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env.update({ - "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)), - "AR": "{} link".format(self._user_info_build["automake"].ar_lib), - "LD": "link", - }) - with tools.environment_append(env): - yield + 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("cccl/1.3") + if is_msvc(self): + self.tool_requires("winflexbison/2.5.25") else: - with tools.environment_append(env): - yield - - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - deps_libpaths = autotools.library_paths - deps_libs = autotools.libs - deps_defines = autotools.defines - if self.settings.os == "Windows" and self.settings.compiler != "Visual Studio": - autotools.link_flags.append("-static") - - libargs = list("-L\"{}\"".format(p) for p in deps_libpaths) + list("-l\"{}\"".format(l) for l in deps_libs) - args = [ - "{}_LIBS={}".format("PCRE2" if self._use_pcre2 else "PCRE", " ".join(libargs)), - "{}_CPPFLAGS={}".format("PCRE2" if self._use_pcre2 else "PCRE", " ".join("-D{}".format(define) for define in deps_defines)), - "--host={}".format(self.settings.arch), - "--with-swiglibdir={}".format(self._swiglibdir), - ] - if self.settings.os == "Linux": - args.append("LIBS=-ldl") - - host, build = None, None + self.tool_requires("bison/3.8.2") + self.tool_requires("automake/1.16.5") - if self.settings.compiler == "Visual Studio": - self.output.warn("Visual Studio compiler cannot create ccache-swig. Disabling ccache-swig.") - args.append("--disable-ccache") - autotools.flags.append("-FS") - # MSVC canonical names aren't understood - host, build = False, False - - if self.settings.os == "Macos" and self.settings.arch == "armv8": - # FIXME: Apple ARM should be handled by build helpers - autotools.flags.append("-arch arm64") - autotools.link_flags.append("-arch arm64") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - autotools.libs = [] - autotools.library_paths = [] + def generate(self): + build_env = VirtualBuildEnv(self) + build_env.generate() - if self.settings.os == "Windows" and self.settings.compiler != "Visual Studio": - autotools.libs.extend(["mingwex", "ssp"]) + tc = AutotoolsToolchain(self) + env = tc.environment() - autotools.configure(args=args, configure_dir=self._source_subfolder, - host=host, build=build) - return autotools + pcre = "pcre2" if self._use_pcre2 else "pcre" + tc.configure_args += [ + f"--host={self.settings.arch}", + "--with-swiglibdir=${prefix}/bin/swiglib", + f"--with-{pcre}-prefix={self.dependencies[pcre].package_folder}", + ] + tc.extra_cflags.append("-DHAVE_PCRE=1") + if self._use_pcre2: + env.define("PCRE2_LIBS", " ".join("-l" + lib for lib in self.dependencies["pcre2"].cpp_info.libs)) + + if self.settings.os in ["Linux", "FreeBSD"]: + tc.configure_args.append("LIBS=-ldl") + tc.extra_defines.append("HAVE_UNISTD_H=1") + elif self.settings.os == "Windows": + if is_msvc(self): + env.define("CC", "cccl -FS") + env.define("CXX", "cccl -FS") + tc.configure_args.append("--disable-ccache") + else: + tc.extra_ldflags.append("-static") + tc.configure_args.append("LIBS=-lmingwex -lssp") + elif is_apple_os(self): + tc.extra_cflags.append(f"-arch {to_apple_arch(self)}") + tc.extra_cxxflags.append(f"-arch {to_apple_arch(self)}") + tc.extra_ldflags.append(f"-arch {to_apple_arch(self)}") + tc.generate(env) + + if is_msvc(self): + # Custom AutotoolsDeps for cl-like compilers + # workaround for https://github.com/conan-io/conan/issues/12784 + includedirs = [] + defines = [] + libs = [] + libdirs = [] + linkflags = [] + cxxflags = [] + cflags = [] + for dependency in self.dependencies.values(): + deps_cpp_info = dependency.cpp_info.aggregated_components() + includedirs.extend(deps_cpp_info.includedirs) + defines.extend(deps_cpp_info.defines) + libs.extend(deps_cpp_info.libs + deps_cpp_info.system_libs) + libdirs.extend(deps_cpp_info.libdirs) + linkflags.extend(deps_cpp_info.sharedlinkflags + deps_cpp_info.exelinkflags) + cxxflags.extend(deps_cpp_info.cxxflags) + cflags.extend(deps_cpp_info.cflags) + + env = Environment() + env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in includedirs] + [f"-D{d}" for d in defines]) + env.append("_LINK_", [lib if lib.endswith(".lib") else f"{lib}.lib" for lib in libs]) + env.append("LDFLAGS", [f"-L{unix_path(self, p)}" for p in libdirs] + linkflags) + env.append("CXXFLAGS", cxxflags) + env.append("CFLAGS", cflags) + env.vars(self).save_script("conanautotoolsdeps_cl_workaround") + else: + deps = AutotoolsDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) + # Rely on AutotoolsDeps instead of pcre2-config + # https://github.com/swig/swig/blob/v4.1.1/configure.ac#L70-L92 + # https://github.com/swig/swig/blob/v4.0.2/configure.ac#L65-L86 + replace_in_file(self, os.path.join(self.source_folder, "configure.ac"), + 'AS_IF([test "x$with_pcre" != xno],', 'AS_IF([false],') def build(self): self._patch_sources() - with tools.chdir(os.path.join(self._source_subfolder)): - self.run("./autogen.sh", win_bash=tools.os_info.is_windows) - with self._build_context(): - autotools = self._configure_autotools() + with chdir(self, self.source_folder): + autotools = Autotools(self) + self.run("./autogen.sh") + autotools.configure() autotools.make() def package(self): - self.copy(pattern="LICENSE*", dst="licenses", src=self._source_subfolder) - self.copy(pattern="COPYRIGHT", dst="licenses", src=self._source_subfolder) - self.copy("*", src="cmake", dst=self._module_subfolder) - with self._build_context(): - autotools = self._configure_autotools() + copy(self, "LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "COPYRIGHT", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.cmake", + dst=os.path.join(self.package_folder, self._module_subfolder), + src=os.path.join(self.export_sources_folder, "cmake")) + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.install() - - @property - def _swiglibdir(self): - return os.path.join(self.package_folder, "bin", "swiglib").replace("\\", "/") + for path in self.package_path.iterdir(): + if path.is_dir() and path.name not in ["bin", "lib", "licenses"]: + rmdir(self, path) @property def _module_subfolder(self): return os.path.join("lib", "cmake") @property - def _module_file(self): - return "conan-official-{}-targets.cmake".format(self.name) + def _cmake_module_rel_path(self): + return os.path.join(self._module_subfolder, "conan-swig-variables.cmake") def package_info(self): - self.cpp_info.includedirs=[] + self.cpp_info.includedirs = [] + self.cpp_info.set_property("cmake_file_name", "SWIG") + self.cpp_info.set_property("cmake_target_name", "SWIG::SWIG") + self.cpp_info.set_property("cmake_build_modules", [self._cmake_module_rel_path]) + + self.buildenv_info.define_path("SWIG_LIB", os.path.join(self.package_folder, "bin", "swiglib")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "SWIG" self.cpp_info.names["cmake_find_package_multi"] = "SWIG" - self.cpp_info.builddirs = [self._module_subfolder] - self.cpp_info.build_modules["cmake_find_package"] = \ - [os.path.join(self._module_subfolder, self._module_file)] - self.cpp_info.build_modules["cmake_find_package_multi"] = \ - [os.path.join(self._module_subfolder, self._module_file)] + self.cpp_info.build_modules["cmake_find_package"] = [self._cmake_module_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._cmake_module_rel_path] bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) self.env_info.PATH.append(bindir) + self.env_info.SWIG_LIB = os.path.join(self.package_folder, "bin", "swiglib") diff --git a/recipes/swig/all/test_package/CMakeLists.txt b/recipes/swig/all/test_package/CMakeLists.txt index 3f3a1aa9d1821..767943c116cee 100644 --- a/recipes/swig/all/test_package/CMakeLists.txt +++ b/recipes/swig/all/test_package/CMakeLists.txt @@ -1,51 +1,20 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS NO_OUTPUT_DIRS) - -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $<1:${CMAKE_BINARY_DIR}>) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_BINARY_DIR}>) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_BINARY_DIR}>) - -find_package(SWIG REQUIRED) +find_package(SWIG REQUIRED CONFIG) include(UseSWIG) -set(Python_ADDITIONAL_VERSIONS 3) -find_package(PythonInterp) -find_package(PythonLibs 3) - -enable_testing() - -if(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND) - swig_add_library(${PROJECT_NAME} - LANGUAGE python - SOURCES - test.i - test_package.c - ) - - get_filename_component(PYTHON_LIBRARY_DIR "${PYTHON_LIBRARIES}" DIRECTORY) - - message(STATUS "PYTHON_INCLUDE_DIRS: ${PYTHON_INCLUDE_DIRS}") - message(STATUS "PYTHON_LIBRARIES: ${PYTHON_LIBRARIES}") - message(STATUS "PYTHON_LIBRARY_DIR: ${PYTHON_LIBRARY_DIR}") +find_package(Python REQUIRED COMPONENTS Interpreter Development) - #target_compile_definitions(_${PROJECT_NAME} PRIVATE MS_NO_COREDLL) - target_include_directories(_${PROJECT_NAME} PRIVATE ${PYTHON_INCLUDE_DIRS}) - target_link_directories(_${PROJECT_NAME} PRIVATE ${PYTHON_LIBRARY_DIR}) - target_link_libraries(_${PROJECT_NAME} PRIVATE ${PYTHON_LIBRARIES}) +swig_add_library(${PROJECT_NAME} + LANGUAGE python + SOURCES test.i test_package.c + OUTPUT_DIR ${CMAKE_BINARY_DIR} +) +target_link_libraries(${PROJECT_NAME} PRIVATE Python::Python) - add_test( - NAME gcd_test - COMMAND ${PYTHON_EXECUTABLE} -c "import PackageTest; assert PackageTest.gcd(12, 16) == 4" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" - ) - add_test( - NAME foo_test - COMMAND ${PYTHON_EXECUTABLE} -c "import PackageTest; assert PackageTest.cvar.foo == 3.14159265359" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" - ) -else() - message(STATUS "Not building swig python module") -endif() +# Note: this does not copy the generated *.py file +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION ${CMAKE_BINARY_DIR} + RUNTIME DESTINATION ${CMAKE_BINARY_DIR} +) diff --git a/recipes/swig/all/test_package/conanfile.py b/recipes/swig/all/test_package/conanfile.py index 5059612e70e16..f305f9b713d22 100644 --- a/recipes/swig/all/test_package/conanfile.py +++ b/recipes/swig/all/test_package/conanfile.py @@ -1,27 +1,73 @@ -from conans import CMake, ConanFile, tools +import importlib +import os +import sys +from pathlib import PurePath + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps +from conan.tools.env import VirtualRunEnv +from conan.tools.microsoft import is_msvc class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str, visible=False, run=True) + + def layout(self): + cmake_layout(self) @property def _can_build(self): # FIXME: Python does not distribute debug libraries (use cci CPython recipe) - return not (self.settings.compiler == "Visual Studio" and self.settings.build_type == "Debug") + if is_msvc(self) and self.settings.build_type == "Debug": + return False + # FIXME: apple-clang fails with 'ld: library not found for -lintl' in CI, despite working ok locally + if self.settings.compiler == "apple-clang": + return False + return True + + @property + def _python_interpreter(self): + if getattr(sys, "frozen", False): + return "python" + return sys.executable + + def generate(self): + venv = VirtualRunEnv(self) + venv.generate(scope="build") + venv.generate(scope="run") + tc = CMakeToolchain(self) + tc.variables["Python_EXECUTABLE"] = PurePath(self._python_interpreter).as_posix() + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - if not tools.cross_building(self, skip_x64_x86=True): - self.run("swig -swiglib", run_environment=True) + if can_run(self): + self.run("swig -swiglib") if self._can_build: cmake = CMake(self) - cmake.verbose = True cmake.configure() cmake.build() + def _test_swig_module(self): + sys.path.append(self.build_folder) + sys.path.append(os.path.join(self.build_folder, str(self.settings.build_type))) + # Could also simply use 'import PackageTest' but this makes pylint angry + PackageTest = importlib.import_module("PackageTest") + assert PackageTest.gcd(12, 16) == 4 + self.output.info("PackageTest.gcd(12, 16) ran successfully") + assert PackageTest.cvar.foo == 3.14159265359 + self.output.info("PackageTest.cvar.foo == 3.14159265359 ran successfully") + sys.path.pop() + def test(self): - if not tools.cross_building(self): + if can_run(self): if self._can_build: - cmake = CMake(self) - cmake.test(output_on_failure=True) - self.run("swig -version", run_environment=True) + self._test_swig_module() + self.run("swig -version") + self.run("swig -swiglib") diff --git a/recipes/swig/all/test_v1_package/CMakeLists.txt b/recipes/swig/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/swig/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/swig/all/test_v1_package/conanfile.py b/recipes/swig/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e7dbf9e47271c --- /dev/null +++ b/recipes/swig/all/test_v1_package/conanfile.py @@ -0,0 +1,53 @@ +import importlib +import sys +from pathlib import PurePath + +from conans import CMake, ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + @property + def _can_build(self): + # FIXME: Python does not distribute debug libraries (use cci CPython recipe) + if self.settings.compiler == "Visual Studio" and self.settings.build_type == "Debug": + return False + # FIXME: apple-clang fails with 'ld: library not found for -lintl' in CI, despite working ok locally + if self.settings.compiler == "apple-clang": + return False + return True + + @property + def _python_interpreter(self): + if getattr(sys, "frozen", False): + return "python" + return sys.executable + + def build(self): + if not tools.cross_building(self, skip_x64_x86=True): + self.run("swig -swiglib", run_environment=True) + if self._can_build: + cmake = CMake(self) + cmake.verbose = True + cmake.definitions["Python_EXECUTABLE"] = PurePath(self._python_interpreter).as_posix() + cmake.configure() + cmake.build() + cmake.install() + + def _test_swig_module(self): + sys.path.append(self.build_folder) + # Could also simply use 'import PackageTest' but this makes pylint angry + PackageTest = importlib.import_module("PackageTest") + assert PackageTest.gcd(12, 16) == 4 + self.output.info("PackageTest.gcd(12, 16) ran successfully") + assert PackageTest.cvar.foo == 3.14159265359 + self.output.info("PackageTest.cvar.foo == 3.14159265359 ran successfully") + sys.path.pop() + + def test(self): + if not tools.cross_building(self): + if self._can_build: + self._test_swig_module() + self.run("swig -version", run_environment=True) diff --git a/recipes/swig/config.yml b/recipes/swig/config.yml index 543f01b80f536..e4181f963c4e1 100644 --- a/recipes/swig/config.yml +++ b/recipes/swig/config.yml @@ -1,4 +1,6 @@ versions: + "4.1.1": + folder: "all" "4.1.0": folder: "all" "4.0.2": diff --git a/recipes/symengine/all/conandata.yml b/recipes/symengine/all/conandata.yml index c52591b647475..f1d9cf2996b49 100644 --- a/recipes/symengine/all/conandata.yml +++ b/recipes/symengine/all/conandata.yml @@ -14,3 +14,6 @@ sources: "0.11.2": url: "https://github.com/symengine/symengine/releases/download/v0.11.2/symengine-0.11.2.tar.gz" sha256: "f6972acd6a65354f6414e69460d2e175729470632bdac05919bc2f7f32e48cbd" + "0.12.0": + url: "https://github.com/symengine/symengine/archive/refs/tags/v0.12.0.tar.gz" + sha256: "1b5c3b0bc6a9f187635f93585649f24a18e9c7f2167cebcd885edeaaf211d956" diff --git a/recipes/symengine/config.yml b/recipes/symengine/config.yml index b47e71fe86741..7edc4135e663c 100644 --- a/recipes/symengine/config.yml +++ b/recipes/symengine/config.yml @@ -9,3 +9,5 @@ versions: folder: all "0.11.2": folder: all + "0.12.0": + folder: all diff --git a/recipes/tar/all/conandata.yml b/recipes/tar/all/conandata.yml index 7df28f6d96e37..ab2017a8f4ca5 100644 --- a/recipes/tar/all/conandata.yml +++ b/recipes/tar/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.35": + url: "https://ftp.gnu.org/gnu/tar/tar-1.35.tar.xz" + sha256: "4d62ff37342ec7aed748535323930c7cf94acf71c3591882b26a7ea50f3edc16" "1.32.90": url: "https://alpha.gnu.org/gnu/tar/tar-1.32.90.tar.gz" sha256: "641fe07b7403c8eb801e7bfb91d1b7e5800ab15df524e22e0b2e89501280b6d7" +patches: + "1.35": + - patch_file: "patches/1.35-001-fix-iconv-link.patch" + patch_description: "Fix iconv link" + patch_type: "portability" + patch_source: "http://git.savannah.gnu.org/cgit/tar.git/patch/?id=8632df398b2f548465ebe68b8f494c0d6f8d913d" diff --git a/recipes/tar/all/conanfile.py b/recipes/tar/all/conanfile.py index 96d4365b7ea60..9f5cf868bef7f 100644 --- a/recipes/tar/all/conanfile.py +++ b/recipes/tar/all/conanfile.py @@ -3,10 +3,11 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -26,6 +27,9 @@ class TarConan(ConanFile): def _settings_build(self): return getattr(self, "settings_build", self.settings) + def export_sources(self): + export_conandata_patches(self) + def configure(self): self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") @@ -39,10 +43,15 @@ def package_id(self): def requirements(self): self.requires("bzip2/1.0.8", run=True, headers=False, libs=False) self.requires("lzip/1.23", run=True, headers=False, libs=False) - self.requires("xz_utils/5.4.4", run=True, headers=False, libs=False) + self.requires("xz_utils/5.4.5", run=True, headers=False, libs=False) self.requires("zstd/1.5.5", run=True, headers=False, libs=False) # self.requires("lzo/2.10", run=True, headers=False, libs=False) + def build_requirements(self): + if Version(self.version) == "1.35": + self.build_requires("automake/1.16.5") + self.build_requires("gettext/0.22.5") + def validate(self): if self.settings.os == "Windows": raise ConanInvalidConfiguration("This recipe does not support Windows builds of tar") # FIXME: fails on MSVC and mingw-w64 @@ -86,6 +95,8 @@ def _patch_sources(self): def build(self): self._patch_sources() autotools = Autotools(self) + if Version(self.version) == "1.35": + autotools.autoreconf() # autoreconf needed after patching autotools.configure() autotools.make() diff --git a/recipes/tar/all/patches/1.35-001-fix-iconv-link.patch b/recipes/tar/all/patches/1.35-001-fix-iconv-link.patch new file mode 100644 index 0000000000000..e433aa6ead2da --- /dev/null +++ b/recipes/tar/all/patches/1.35-001-fix-iconv-link.patch @@ -0,0 +1,24 @@ +From 8632df398b2f548465ebe68b8f494c0d6f8d913d Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff +Date: Tue, 18 Jul 2023 17:02:23 +0300 +Subject: Fix savannah bug #64441 + +* src/Makefile.am (tar_LDADD): Add libiconv libraries. +--- + src/Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 36c9543..e2ec58d 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -52,4 +52,5 @@ AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) + tar_LDADD = $(LIBS) ../lib/libtar.a ../gnu/libgnu.a\ + $(LIB_ACL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS)\ + $(LIB_GETRANDOM) $(LIB_HARD_LOCALE) $(FILE_HAS_ACL_LIB) $(LIB_MBRTOWC)\ +- $(LIB_SELINUX) $(LIB_SETLOCALE_NULL) ++ $(LIB_SELINUX) $(LIB_SETLOCALE_NULL) \ ++ $(LIBINTL) $(LIBICONV) +-- +cgit v1.1 + diff --git a/recipes/tar/config.yml b/recipes/tar/config.yml index b21f806d0621e..65088c19d5771 100644 --- a/recipes/tar/config.yml +++ b/recipes/tar/config.yml @@ -1,3 +1,5 @@ versions: + "1.35": + folder: "all" "1.32.90": folder: "all" diff --git a/recipes/taskflow/all/conandata.yml b/recipes/taskflow/all/conandata.yml index d4e7661550418..bc9d6699fbb72 100644 --- a/recipes/taskflow/all/conandata.yml +++ b/recipes/taskflow/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.7.0": + url: "https://github.com/taskflow/taskflow/archive/v3.7.0.tar.gz" + sha256: "788b88093fb3788329ebbf7c7ee05d1f8960d974985a301798df01e77e04233b" "3.6.0": url: "https://github.com/taskflow/taskflow/archive/v3.6.0.tar.gz" sha256: "5a1cd9cf89f93a97fcace58fd73ed2fc8ee2053bcb43e047acb6bc121c3edf4c" diff --git a/recipes/taskflow/all/conanfile.py b/recipes/taskflow/all/conanfile.py index 7d914d16abb83..e16199ca67bf9 100644 --- a/recipes/taskflow/all/conanfile.py +++ b/recipes/taskflow/all/conanfile.py @@ -35,12 +35,14 @@ def _compilers_minimum_version(self): return { "17": { "Visual Studio": "16", - "gcc": "7.3", + "msvc": "192", + "gcc": "7.3" if Version(self.version) < "3.7.0" else "8.4", "clang": "6.0", "apple-clang": "10.0", }, "14": { "Visual Studio": "15", + "msvc": "191", "gcc": "5", "clang": "4.0", "apple-clang": "8.0", diff --git a/recipes/taskflow/config.yml b/recipes/taskflow/config.yml index 36b5f1772375b..805659f33f589 100644 --- a/recipes/taskflow/config.yml +++ b/recipes/taskflow/config.yml @@ -1,4 +1,6 @@ versions: + "3.7.0": + folder: all "3.6.0": folder: all "3.5.0": diff --git a/recipes/tensorflow-lite/all/conanfile.py b/recipes/tensorflow-lite/all/conanfile.py index 0ad39bb09b0e6..1fe43f9524e5d 100644 --- a/recipes/tensorflow-lite/all/conanfile.py +++ b/recipes/tensorflow-lite/all/conanfile.py @@ -1,10 +1,9 @@ -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, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.env import VirtualBuildEnv -from conan.tools.files import get, save, copy, export_conandata_patches, apply_conandata_patches, replace_in_file +from conan.tools.files import get, save, copy, export_conandata_patches, apply_conandata_patches from conan.tools.scm import Version from os.path import join import textwrap @@ -89,7 +88,7 @@ def requirements(self): self.requires("intel-neon2sse/cci.20210225") if self.options.with_xnnpack: self.requires("xnnpack/cci.20231026") - # https://github.com/tensorflow/tensorflow/blob/359c3cdfc5fabac82b3c70b3b6de2b0a8c16874f/tensorflow/lite/delegates/xnnpack/xnnpack_delegate.cc#L165 + if Version(self.version) >= "2.12.0" or self.options.with_xnnpack: self.requires("pthreadpool/cci.20231129") if self.options.with_xnnpack or self.options.get_safe("with_nnapi", False): self.requires("fp16/cci.20210320") diff --git a/recipes/tensorflow-lite/all/patches/2.12.0-0001-remove_simple_memory_arena_debug_dump.patch b/recipes/tensorflow-lite/all/patches/2.12.0-0001-remove_simple_memory_arena_debug_dump.patch index 7347da947b777..4753a3d1bac63 100644 --- a/recipes/tensorflow-lite/all/patches/2.12.0-0001-remove_simple_memory_arena_debug_dump.patch +++ b/recipes/tensorflow-lite/all/patches/2.12.0-0001-remove_simple_memory_arena_debug_dump.patch @@ -12,10 +12,3 @@ index c71a392..7260efe 100644 # This particular file is excluded because the more explicit approach to enable # XNNPACK delegate is preferred to the weak-symbol one. -@@ -654,4 +657,4 @@ target_link_libraries(_pywrap_tensorflow_interpreter_wrapper - target_compile_options(_pywrap_tensorflow_interpreter_wrapper - PUBLIC ${TFLITE_TARGET_PUBLIC_OPTIONS} - PRIVATE ${TFLITE_TARGET_PRIVATE_OPTIONS} --) -\ No newline at end of file -+) diff --git a/recipes/tensorflow-lite/all/patches/2.12.0-0002-disable-fetch-content.patch b/recipes/tensorflow-lite/all/patches/2.12.0-0002-disable-fetch-content.patch index 3e5227f425d87..d3bfdf275681e 100644 --- a/recipes/tensorflow-lite/all/patches/2.12.0-0002-disable-fetch-content.patch +++ b/recipes/tensorflow-lite/all/patches/2.12.0-0002-disable-fetch-content.patch @@ -1,14 +1,3 @@ -diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt -index 24b8265..7260efe 100644 ---- a/tensorflow/lite/CMakeLists.txt -+++ b/tensorflow/lite/CMakeLists.txt -@@ -657,4 +657,4 @@ target_link_libraries(_pywrap_tensorflow_interpreter_wrapper - target_compile_options(_pywrap_tensorflow_interpreter_wrapper - PUBLIC ${TFLITE_TARGET_PUBLIC_OPTIONS} - PRIVATE ${TFLITE_TARGET_PRIVATE_OPTIONS} --) -\ No newline at end of file -+) diff --git a/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake b/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake index 9ed9510..4a6a45d 100644 --- a/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake diff --git a/recipes/tensorflow-lite/all/patches/2.12.0-0003-use-cci-dependencies.patch b/recipes/tensorflow-lite/all/patches/2.12.0-0003-use-cci-dependencies.patch index 669ae2418a34e..be146c5e56c09 100644 --- a/recipes/tensorflow-lite/all/patches/2.12.0-0003-use-cci-dependencies.patch +++ b/recipes/tensorflow-lite/all/patches/2.12.0-0003-use-cci-dependencies.patch @@ -1,8 +1,8 @@ diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt -index 24b8265..9e0d1e0 100644 +index 24b8265..d95c0ae 100644 --- a/tensorflow/lite/CMakeLists.txt +++ b/tensorflow/lite/CMakeLists.txt -@@ -142,31 +142,16 @@ +@@ -142,31 +142,17 @@ endmacro() find_package(absl REQUIRED) find_package(Eigen3 REQUIRED) find_package(farmhash REQUIRED) @@ -32,6 +32,7 @@ index 24b8265..9e0d1e0 100644 - add_subdirectory( - "${PTHREADPOOL_SOURCE_DIR}" - "${CMAKE_BINARY_DIR}/pthreadpool") ++find_package(pthreadpool REQUIRED) + +if(TARGET flatbuffers::flatbuffers_shared) + set(FLATBUFFERS_TARGET flatbuffers::flatbuffers_shared) @@ -40,7 +41,7 @@ index 24b8265..9e0d1e0 100644 endif() set(TF_TARGET_PRIVATE_OPTIONS "") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang$") -@@ -180,6 +165,10 @@ +@@ -180,6 +166,10 @@ set(TFLITE_TARGET_PRIVATE_OPTIONS "") set(TFLITE_TARGET_PRIVATE_DEFINITIONS "") # Additional library dependencies based upon enabled features. set(TFLITE_TARGET_DEPENDENCIES "") @@ -51,13 +52,12 @@ index 24b8265..9e0d1e0 100644 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang$") # TFLite uses deprecated methods in neon2sse which generates a huge number of # warnings so surpress these until they're fixed. -@@ -429,13 +418,14 @@ +@@ -429,13 +419,13 @@ else() endif() if(TFLITE_ENABLE_XNNPACK) find_package(fp16_headers REQUIRED) - find_package(XNNPACK REQUIRED) + find_package(xnnpack REQUIRED) -+ find_package(pthreadpool REQUIRED) populate_tflite_source_vars("delegates/xnnpack" TFLITE_DELEGATES_XNNPACK_SRCS FILTER ".*(_test|_tester)\\.(cc|h)" @@ -68,7 +68,7 @@ index 24b8265..9e0d1e0 100644 ) list(APPEND TFLITE_TARGET_PUBLIC_OPTIONS "-DTFLITE_BUILD_WITH_XNNPACK_DELEGATE") endif() -@@ -492,6 +482,7 @@ +@@ -492,6 +482,7 @@ populate_tflite_source_vars("kernels/internal/reference/sparse_ops" TFLITE_KERNEL_INTERNAL_REF_SPARSE_OPS_SRCS ) set(TFLITE_PROFILER_SRCS @@ -76,7 +76,7 @@ index 24b8265..9e0d1e0 100644 ${TFLITE_SOURCE_DIR}/profiling/platform_profiler.cc ${TFLITE_SOURCE_DIR}/profiling/root_profiler.h ${TFLITE_SOURCE_DIR}/profiling/root_profiler.cc -@@ -555,19 +546,18 @@ +@@ -555,19 +546,18 @@ target_include_directories(tensorflow-lite target_link_libraries(tensorflow-lite PUBLIC Eigen3::Eigen diff --git a/recipes/tensorflow-lite/all/test_package/conanfile.py b/recipes/tensorflow-lite/all/test_package/conanfile.py index 841a097747d32..8321ed4e2de49 100644 --- a/recipes/tensorflow-lite/all/test_package/conanfile.py +++ b/recipes/tensorflow-lite/all/test_package/conanfile.py @@ -22,6 +22,5 @@ def build(self): def test(self): if can_run(self): - model_path = os.path.join(self.source_folder, "model.tflite") command = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(f"{command} {model_path}", env="conanrun") + self.run(command, env="conanrun") diff --git a/recipes/tensorflow-lite/all/test_package/model.tflite b/recipes/tensorflow-lite/all/test_package/model.tflite deleted file mode 100644 index 281cb988ba465..0000000000000 Binary files a/recipes/tensorflow-lite/all/test_package/model.tflite and /dev/null differ diff --git a/recipes/tensorflow-lite/all/test_package/test_package.cpp b/recipes/tensorflow-lite/all/test_package/test_package.cpp index 954d81537da3f..21834b32a2984 100644 --- a/recipes/tensorflow-lite/all/test_package/test_package.cpp +++ b/recipes/tensorflow-lite/all/test_package/test_package.cpp @@ -1,42 +1,15 @@ -#include -#include #include #include -#include - #include -#include int main(int argc, char * argv[]) { - if ( argc != 2) { - std::cerr << "Pass model file path as argument" << std::endl; - return -1; - } - std::cout << "Using TensorFlow Lite version " << TFLITE_VERSION_STRING << std::endl; - auto model = tflite::FlatBufferModel::BuildFromFile(argv[1]); - if (!model) { - throw std::runtime_error("Failed to load TFLite model"); - } - - tflite::ops::builtin::BuiltinOpResolver resolver; - tflite::InterpreterBuilder builder(*model, resolver); std::unique_ptr interpreter; - builder(&interpreter); + interpreter = std::make_unique(); - if (interpreter->AllocateTensors() != kTfLiteOk) { - throw std::runtime_error("Failed to allocate tensors"); - } + const int num_tensors = interpreter->tensors_size(); + std::cout << "Number of tensors in the interpreter: " << num_tensors << std::endl; - tflite::PrintInterpreterState(interpreter.get()); - auto input = interpreter->typed_input_tensor(0); - *input = 42.0F; - std::cout << "==== Running SQUARE(x) Model ====\n\n"; - if (interpreter->Invoke() != kTfLiteOk) { - throw std::runtime_error("Failed to execute model"); - } - auto output = interpreter->typed_output_tensor(0); - std::cout << "SQUARE(" << *input << ") = " << *output << std::endl; return 0; } diff --git a/recipes/tensorflow-lite/all/test_v1_package/conanfile.py b/recipes/tensorflow-lite/all/test_v1_package/conanfile.py index 17a163fae24bd..b6d768011ed00 100644 --- a/recipes/tensorflow-lite/all/test_v1_package/conanfile.py +++ b/recipes/tensorflow-lite/all/test_v1_package/conanfile.py @@ -14,6 +14,5 @@ def build(self): def test(self): if not cross_building(self): - model_path = os.path.join(self.source_folder, os.pardir, "test_package", "model.tflite") command = os.path.join("bin", "test_package") - self.run(f"{command} {model_path}", run_environment=True) + self.run(command, run_environment=True) diff --git a/recipes/tesseract/all/conandata.yml b/recipes/tesseract/all/conandata.yml index 00a8d11156c81..dde624ec73438 100644 --- a/recipes/tesseract/all/conandata.yml +++ b/recipes/tesseract/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "5.4.1": + url: "https://github.com/tesseract-ocr/tesseract/archive/5.4.0.tar.gz" + sha256: "30ceffd9b86780f01cbf4eaf9b7fc59abddfcbaf5bbd52f9a633c6528cb183fd" + "5.4.0": + url: "https://github.com/tesseract-ocr/tesseract/archive/5.4.0.tar.gz" + sha256: "30ceffd9b86780f01cbf4eaf9b7fc59abddfcbaf5bbd52f9a633c6528cb183fd" + "5.3.4": + url: "https://github.com/tesseract-ocr/tesseract/archive/5.3.4.tar.gz" + sha256: "141afc12b34a14bb691a939b4b122db0d51bd38feda7f41696822bacea7710c7" "5.3.3": url: "https://github.com/tesseract-ocr/tesseract/archive/5.3.3.tar.gz" sha256: "dc4329f85f41191b2d813b71b528ba6047745813474e583ccce8795ff2ff5681" @@ -18,6 +27,18 @@ sources: url: "https://github.com/tesseract-ocr/tesseract/archive/4.1.1.tar.gz" sha256: "2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb" patches: + "5.4.1": + - patch_file: "patches/0004-control-optimizations-5.4.0.patch" + patch_description: "fix condition for cpu optimizations" + patch_type: "portability" + "5.4.0": + - patch_file: "patches/0004-control-optimizations-5.4.0.patch" + patch_description: "fix condition for cpu optimizations" + patch_type: "portability" + "5.3.4": + - patch_file: "patches/0004-control-optimizations-5.3.3.patch" + patch_description: "fix condition for cpu optimizations" + patch_type: "portability" "5.3.3": - patch_file: "patches/0004-control-optimizations-5.3.3.patch" patch_description: "fix condition for cpu optimizations" diff --git a/recipes/tesseract/all/conanfile.py b/recipes/tesseract/all/conanfile.py index 861e7b6b85384..f4748d7b4ec1b 100644 --- a/recipes/tesseract/all/conanfile.py +++ b/recipes/tesseract/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, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, save +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, rm, save from conan.tools.scm import Version import os @@ -155,6 +155,7 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( diff --git a/recipes/tesseract/all/patches/0004-control-optimizations-5.4.0.patch b/recipes/tesseract/all/patches/0004-control-optimizations-5.4.0.patch new file mode 100644 index 0000000000000..5f979a5a3b6c0 --- /dev/null +++ b/recipes/tesseract/all/patches/0004-control-optimizations-5.4.0.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 85af2df..aff97da 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -165,7 +165,7 @@ endif(ENABLE_NATIVE) + + message(STATUS "CMAKE_SYSTEM_PROCESSOR=<${CMAKE_SYSTEM_PROCESSOR}>") + +-if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86|x86_64|AMD64|amd64|i386|i686") ++if(ENABLE_OPTIMIZATIONS AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86|x86_64|AMD64|amd64|i386|i686") + + set(HAVE_NEON FALSE) + if(MSVC) diff --git a/recipes/tesseract/config.yml b/recipes/tesseract/config.yml index f1f981966776b..2a1c379104746 100644 --- a/recipes/tesseract/config.yml +++ b/recipes/tesseract/config.yml @@ -1,4 +1,10 @@ versions: + "5.4.1": + folder: all + "5.4.0": + folder: all + "5.3.4": + folder: all "5.3.3": folder: all "5.3.0": diff --git a/recipes/thorvg/all/conandata.yml b/recipes/thorvg/all/conandata.yml new file mode 100644 index 0000000000000..1968085d2b1e5 --- /dev/null +++ b/recipes/thorvg/all/conandata.yml @@ -0,0 +1,31 @@ +sources: + "0.14.2": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.14.2.tar.gz" + sha256: "04202e8f5e17b427c3b16ae3b3d4be5d3f3cdac96d5c64ed3efd7b6db3ad731f" + "0.14.1": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.14.1.tar.gz" + sha256: "9c0346fda8b62a3b13a764dda5784e0465c8cab54fb5342d0240c7fb40e415bd" + "0.14.0": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.14.0.tar.gz" + sha256: "6f186b53be3a0bd971dabde7a58022f43303467794e89e3641c774f38cdc2664" + "0.13.8": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.13.8.tar.gz" + sha256: "ce49929a94d1686d4f1436da6ef5fa7a8439901c22b5fa0879d7d5879b8ba2bd" + "0.13.7": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.13.7.tar.gz" + sha256: "972c84e5670a7138eec24062d4ccc243d161158ecd9c53788300a8ca6aaf3426" + "0.13.6": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.13.6.tar.gz" + sha256: "f24fd3647e1a309dec00f6455b32258c0dd0e0dbd1133233169467571f188bad" + "0.13.5": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.13.5.tar.gz" + sha256: "977ed74c3846c9a6acd5765aff776745d40e3c91507b22e51177d59c69afd198" + "0.13.4": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.13.4.tar.gz" + sha256: "2521adf99fb04ae543f5c14bb5fafd5ba7df0ea2e2a9e61351105c27059fc9e6" + "0.13.2": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.13.2.tar.gz" + sha256: "03b5dbb4c73ff221a4bd7243cc0ad377aecff4c3077f5a57ee2902e4122d3218" + "0.13.0": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.13.0.tar.gz" + sha256: "4245c401fa637452c8526c0c4448d8c7915f09a6a2e1fa85d6e9032ee610b454" diff --git a/recipes/thorvg/all/conanfile.py b/recipes/thorvg/all/conanfile.py new file mode 100644 index 0000000000000..922751fa36250 --- /dev/null +++ b/recipes/thorvg/all/conanfile.py @@ -0,0 +1,202 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir, rename, replace_in_file, rm +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.64.0 <2 || >=2.2.0" + + +class ThorvgConan(ConanFile): + name = "thorvg" + description = "ThorVG is a platform-independent portable library that allows for drawing vector-based scenes and animations." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/thorvg/thorvg" + topics = ("svg", "animation", "tvg") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_engines": ['sw', 'gl_beta', 'wg_beta', "gl"], + "with_loaders": [False, 'tvg', 'svg', 'png', 'jpg', 'lottie', 'ttf', 'webp', 'all'], + "with_savers": [False, 'tvg', 'gif', 'all'], + "with_bindings": [False, 'capi', 'wasm_beta'], + "with_tools": [False, 'svg2tvg', 'svg2png', 'lottie2gif', 'all'], + "with_threads": [True, False], + "with_vector": [True, False], # removed in thorvg 0.13.1. Renamed to simd + "with_simd": [True, False], # legacy with_vector + "with_examples": [True, False], + "with_extra": [False, 'lottie_expressions'], + } + default_options = { + "shared": False, + "fPIC": True, + "with_engines": 'sw', + "with_loaders": 'all', + "with_savers": False, + "with_bindings": 'capi', + "with_tools": False, + "with_threads": True, + "with_vector": False, + "with_simd": False, + "with_examples": False, + "with_extra": 'lottie_expressions', + } + # See more here: https://github.com/thorvg/thorvg/blob/main/meson_options.txt + options_description = { + "with_engines": "Enable Rasterizer Engine in thorvg", + "with_loaders": "Enable File Loaders in thorvg", + "with_savers": "Enable File Savers in thorvg", + "with_threads": "Enable the multi-threading task scheduler in thorvg", + "with_vector": "Enable CPU Vectorization(SIMD) in thorvg (renamed in 0.13.1 to 'simd')", + "with_simd": "Enable CPU Vectorization(SIMD) in thorvg", + "with_bindings": "Enable API bindings", + "with_tools": "Enable building thorvg tools", + "with_examples": "Enable building examples", + "with_extra": "Enable support for exceptionally advanced features", + } + short_paths = True + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + # Renamed to simd in higher versions + if Version(self.version) > "0.13.0": + del self.options.with_vector + else: + del self.options.with_simd + if Version(self.version) < "0.13.3": + del self.options.with_extra + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_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." + ) + + if is_msvc(self) and self.settings.build_type == "Debug": + raise ConanInvalidConfiguration( + f"{self.ref} doesn't support debug build on MSVC." + ) + + if Version(self.version) < "0.14.0" and self.options.with_engines in ["gl"]: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support with_engines=gl, use with_engines=gl_beta instead") + if Version(self.version) >= "0.14.0" and self.options.with_engines in ["gl_beta"]: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support with_engines=gl_beta, use with_engines=gl instead") + + def requirements(self): + loaders_opt = str(self.options.with_loaders) + if loaders_opt in ("all", "jpg"): + self.requires("libjpeg-turbo/3.0.2") + if loaders_opt in ("all", "png"): + self.requires("libpng/1.6.43") + if loaders_opt in ("all", "webp"): + self.requires("libwebp/1.4.0") + if self.settings.os == "Linux": + if self.options.with_engines in ["gl", "gl_beta"]: + self.requires("opengl/system") + + def build_requirements(self): + self.tool_requires("meson/1.4.0") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = MesonToolchain(self, backend=("vs" if is_msvc(self) else None)) + is_debug = self.settings.get_safe("build_type") == "Debug" + tc.project_options.update({ + "engines": str(self.options.with_engines), + "loaders": str(self.options.with_loaders) if self.options.with_loaders else '', + "savers": str(self.options.with_savers) if self.options.with_savers else '', + "bindings": str(self.options.with_bindings) if self.options.with_bindings else '', + "tools": str(self.options.with_tools )if self.options.with_tools else '', + "threads": bool(self.options.with_threads), + "examples": bool(self.options.with_examples), + "tests": False, + "log": is_debug, + }) + # Workaround to avoid: error D8016: '/O1' and '/RTC1' command-line options are incompatible + if is_msvc(self) and is_debug: + tc.project_options["optimization"] = "plain" + # vector option renamed to simd + if Version(self.version) > "0.13.0": + tc.project_options["simd"] = bool(self.options.with_simd) + else: + tc.project_options["vector"] = bool(self.options.with_vector) + if self.options.get_safe("with_extra") is not None: + tc.project_options["extra"] = str(self.options.with_extra) if self.options.with_extra else '' + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + venv = VirtualBuildEnv(self) + venv.generate() + + def _patch_sources(self): + # Workaround to avoid: Stripping target 'src\\thorvg-0.dll'. + if is_msvc(self) and self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), ", 'strip=true'", "") + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, pattern="LICENSE", 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", "pkgconfig")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + fix_apple_shared_install_name(self) + + if is_msvc(self) and not self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "libthorvg.a"), os.path.join(self.package_folder, "lib", "thorvg.lib")) + + def package_info(self): + self.cpp_info.libs = ["thorvg"] + + self.cpp_info.set_property("pkg_config_name", "libthorvg") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "m"]) + if not self.options.shared: + self.cpp_info.defines = ["TVG_STATIC"] + else: + self.cpp_info.defines = ["TVG_EXPORT", "TVG_BUILD"] diff --git a/recipes/thorvg/all/test_package/CMakeLists.txt b/recipes/thorvg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f35032cc2fe13 --- /dev/null +++ b/recipes/thorvg/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(thorvg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE thorvg::thorvg) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/thorvg/all/test_package/conanfile.py b/recipes/thorvg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/thorvg/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/thorvg/all/test_package/test_package.cpp b/recipes/thorvg/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7d7acdb5cafb7 --- /dev/null +++ b/recipes/thorvg/all/test_package/test_package.cpp @@ -0,0 +1,32 @@ +#include "thorvg.h" + +int main() { + const int WIDTH = 800; + const int HEIGHT = 600; + + tvg::Initializer::init(tvg::CanvasEngine::Sw, 0); + + static uint32_t buffer[WIDTH * HEIGHT]; // canvas target buffer + + auto canvas = tvg::SwCanvas::gen(); // generate a canvas + canvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888); // buffer, stride, w, h, Colorspace + + auto rect = tvg::Shape::gen(); // generate a shape + rect->appendRect(50, 50, 200, 200, 20, 20); // define it as a rounded rectangle (x, y, w, h, rx, ry) + rect->fill(100, 100, 100, 255); // set its color (r, g, b, a) + canvas->push(move(rect)); // push the rectangle into the canvas + + auto circle = tvg::Shape::gen(); // generate a shape + circle->appendCircle(400, 400, 100, 100); // define it as a circle (cx, cy, rx, ry) + + auto fill = tvg::RadialGradient::gen(); // generate a radial gradient + fill->radial(400, 400, 150); // set the radial gradient geometry info (cx, cy, radius) + + tvg::Fill::ColorStop colorStops[2]; // gradient colors + colorStops[0] = {0.0, 255, 255, 255, 255}; // 1st color values (offset, r, g, b, a) + colorStops[1] = {1.0, 0, 0, 0, 255}; // 2nd color values (offset, r, g, b, a) + fill->colorStops(colorStops, 2); // set the gradient colors info + + circle->fill(move(fill)); // set the circle fill + canvas->push(move(circle)); // push the circle into the canvas +} diff --git a/recipes/thorvg/config.yml b/recipes/thorvg/config.yml new file mode 100644 index 0000000000000..448de784dc4da --- /dev/null +++ b/recipes/thorvg/config.yml @@ -0,0 +1,21 @@ +versions: + "0.14.2": + folder: all + "0.14.1": + folder: all + "0.14.0": + folder: all + "0.13.8": + folder: all + "0.13.7": + folder: all + "0.13.6": + folder: all + "0.13.5": + folder: all + "0.13.4": + folder: all + "0.13.2": + folder: all + "0.13.0": + folder: all diff --git a/recipes/thrift/all/conandata.yml b/recipes/thrift/all/conandata.yml index 57ad35a140baa..6ddf0c58f5a00 100644 --- a/recipes/thrift/all/conandata.yml +++ b/recipes/thrift/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.20.0": + url: "http://archive.apache.org/dist/thrift/0.20.0/thrift-0.20.0.tar.gz" + sha256: "b5d8311a779470e1502c027f428a1db542f5c051c8e1280ccd2163fa935ff2d6" "0.18.1": url: "http://archive.apache.org/dist/thrift/0.18.1/thrift-0.18.1.tar.gz" sha256: "04c6f10e5d788ca78e13ee2ef0d2152c7b070c0af55483d6b942e29cff296726" @@ -18,6 +21,10 @@ sources: url: "http://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz" sha256: "13da5e1cd9c8a3bb89778c0337cc57eb0c29b08f3090b41cf6ab78594b410ca5" patches: + "0.20.0": + - patch_file: "patches/cmake-0.16.0.patch" + patch_description: "use cci packages" + patch_type: "conan" "0.18.1": - patch_file: "patches/cmake-0.16.0.patch" patch_description: "use cci packages" diff --git a/recipes/thrift/all/conanfile.py b/recipes/thrift/all/conanfile.py index 7b6885cf89f45..4239d05bfd5e2 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.84.0", transitive_headers=True) + self.requires("boost/1.85.0", transitive_headers=True) if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") if self.options.with_zlib: @@ -75,7 +75,7 @@ def requirements(self): if self.options.with_libevent: self.requires("libevent/2.1.12") if self.options.with_qt5: - self.requires("qt/5.15.12") + self.requires("qt/5.15.13") def build_requirements(self): if self._settings_build.os == "Windows": diff --git a/recipes/thrift/config.yml b/recipes/thrift/config.yml index 8ce3e9b3821f4..f54d46190d9d2 100644 --- a/recipes/thrift/config.yml +++ b/recipes/thrift/config.yml @@ -1,4 +1,6 @@ versions: + "0.20.0": + folder: all "0.18.1": folder: all "0.17.0": diff --git a/recipes/tidwall-neco/all/CMakeLists.txt b/recipes/tidwall-neco/all/CMakeLists.txt new file mode 100644 index 0000000000000..ee8e2e4c821d7 --- /dev/null +++ b/recipes/tidwall-neco/all/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.15) +project(neco LANGUAGES C) + +include(GNUInstallDirs) + +add_library(neco ${TIDWALL_NECO_SRC_DIR}/neco.c) +target_include_directories(neco PRIVATE ${TIDWALL_NECO_SRC_DIR}) +set_target_properties(neco PROPERTIES + PUBLIC_HEADER ${TIDWALL_NECO_SRC_DIR}/neco.h + WINDOWS_EXPORT_ALL_SYMBOLS ON +) +target_compile_features(neco PRIVATE c_std_11) + +install( + TARGETS neco + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/recipes/tidwall-neco/all/conandata.yml b/recipes/tidwall-neco/all/conandata.yml new file mode 100644 index 0000000000000..683bfe9e9152a --- /dev/null +++ b/recipes/tidwall-neco/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.3.2": + url: "https://github.com/tidwall/neco/archive/refs/tags/v0.3.2.tar.gz" + sha256: "ae3cefa6217428e992da0b30f254502b9974079dd9973eee9c482ea89df3fcef" diff --git a/recipes/tidwall-neco/all/conanfile.py b/recipes/tidwall-neco/all/conanfile.py new file mode 100644 index 0000000000000..5aea18d3be4d2 --- /dev/null +++ b/recipes/tidwall-neco/all/conanfile.py @@ -0,0 +1,69 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + +class TidwallNecoConan(ConanFile): + name = "tidwall-neco" + description = "Concurrency library for C (coroutines)" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tidwall/neco" + topics = ("coroutine", "concurrency", "network") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support Visual Studio (yet).") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TIDWALL_NECO_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["neco"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["pthread", "dl"] diff --git a/recipes/tidwall-neco/all/test_package/CMakeLists.txt b/recipes/tidwall-neco/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a57d060daf586 --- /dev/null +++ b/recipes/tidwall-neco/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(tidwall-neco REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tidwall-neco::tidwall-neco) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/tidwall-neco/all/test_package/conanfile.py b/recipes/tidwall-neco/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fafba71d30d56 --- /dev/null +++ b/recipes/tidwall-neco/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tidwall-neco/all/test_package/test_package.c b/recipes/tidwall-neco/all/test_package/test_package.c new file mode 100644 index 0000000000000..463b07f3d9439 --- /dev/null +++ b/recipes/tidwall-neco/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include + +// #define _GNU_SOURCE +#include "neco.h" + +void coroutine(int argc, void *argv[]) { + printf("main coroutine started\n"); +} + +int main(int argc, char *argv[]) { + neco_start(coroutine, 0); + return 0; +} diff --git a/recipes/tidwall-neco/config.yml b/recipes/tidwall-neco/config.yml new file mode 100644 index 0000000000000..f2fc85b835922 --- /dev/null +++ b/recipes/tidwall-neco/config.yml @@ -0,0 +1,3 @@ +versions: + "0.3.2": + folder: all diff --git a/recipes/tinycolormap/all/conandata.yml b/recipes/tinycolormap/all/conandata.yml new file mode 100644 index 0000000000000..771edaa798dc0 --- /dev/null +++ b/recipes/tinycolormap/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230223": + url: "https://github.com/yuki-koyama/tinycolormap/archive/0f62abbc269d9677829083d4d563643830ac7fb9.zip" + sha256: "f736d7b76ea07e43da6c6905d891bc58ef512a794bbc0ef3ba9b593b4c1e2d63" diff --git a/recipes/tinycolormap/all/conanfile.py b/recipes/tinycolormap/all/conanfile.py new file mode 100644 index 0000000000000..be4fc0dfc05d4 --- /dev/null +++ b/recipes/tinycolormap/all/conanfile.py @@ -0,0 +1,64 @@ +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 TinycolormapConan(ConanFile): + name = "tinycolormap" + description = "A header-only, single-file library for colormaps written in C++11" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/yuki-koyama/tinycolormap" + topics = ("color", "colormap", "visualization", "header-only") + package_type = "header-library" + + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + options = { + "with_eigen": [True, False], + "with_qt": [True, False], + } + default_options = { + "with_eigen": False, + "with_qt": False, + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def requirements(self): + if self.options.with_eigen: + self.requires("eigen/3.4.0") + if self.options.with_qt: + # Only Qt5 is supported + self.requires("qt/5.15.13") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.options.with_eigen: + self.cpp_info.defines.append("TINYCOLORMAP_WITH_EIGEN") + self.cpp_info.requires.append("eigen::eigen") + if self.options.with_qt: + self.cpp_info.defines.append("TINYCOLORMAP_WITH_QT5") + self.cpp_info.requires.append("qt::qtGui") diff --git a/recipes/tinycolormap/all/test_package/CMakeLists.txt b/recipes/tinycolormap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cafa69c0c2ce2 --- /dev/null +++ b/recipes/tinycolormap/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(tinycolormap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tinycolormap::tinycolormap) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tinycolormap/all/test_package/conanfile.py b/recipes/tinycolormap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a808db45f245 --- /dev/null +++ b/recipes/tinycolormap/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tinycolormap/all/test_package/test_package.cpp b/recipes/tinycolormap/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fdc0a6b320ab7 --- /dev/null +++ b/recipes/tinycolormap/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include + +int main() { + double value = 0.75; + auto color = tinycolormap::GetColor(value, tinycolormap::ColormapType::Viridis); + std::cout << "Viridis RGB values at " << value << ": " + << (int)color.ri() << " " << (int)color.gi() << " " << (int)color.bi() << std::endl; +} diff --git a/recipes/tinycolormap/config.yml b/recipes/tinycolormap/config.yml new file mode 100644 index 0000000000000..5ebaf8fdf738e --- /dev/null +++ b/recipes/tinycolormap/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230223": + folder: all diff --git a/recipes/tinyexr/all/test_package/conanfile.py b/recipes/tinyexr/all/test_package/conanfile.py index 5a5dc0862d479..e845ae751a301 100644 --- a/recipes/tinyexr/all/test_package/conanfile.py +++ b/recipes/tinyexr/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_path = os.path.join(self.source_folder, "test.exr") - self.run(f"{bin_path} {img_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/tinyexr/all/test_package/test.exr b/recipes/tinyexr/all/test_package/test.exr deleted file mode 100644 index 5cc69a90c12ce..0000000000000 Binary files a/recipes/tinyexr/all/test_package/test.exr and /dev/null differ diff --git a/recipes/tinyexr/all/test_package/test_package.cpp b/recipes/tinyexr/all/test_package/test_package.cpp index 2cd0713e457c8..b1d9264dbf3c1 100644 --- a/recipes/tinyexr/all/test_package/test_package.cpp +++ b/recipes/tinyexr/all/test_package/test_package.cpp @@ -11,25 +11,15 @@ int main(int argc, const char *argv[]) { - if (argc < 2) { - std::cerr << "Need at least one argument\n"; - } - float* out; int width; int height; const char* err = nullptr; - int ret = LoadEXR(&out, &width, &height, argv[1], &err); + int ret = LoadEXR(&out, &width, &height, "non-real-file.exr", &err); - if (ret == TINYEXR_SUCCESS) { - free(out); - } else { - if(err) { - std::cerr << err << std::endl; - } else { - std::cerr << "Unknown error." << std::endl; - } + if (ret != TINYEXR_SUCCESS) { + std::cout << "Test message\n"; // Always prints } return 0; diff --git a/recipes/tinyexr/all/test_v1_package/conanfile.py b/recipes/tinyexr/all/test_v1_package/conanfile.py index bd607d6c6515a..20d4d2e28d57e 100644 --- a/recipes/tinyexr/all/test_v1_package/conanfile.py +++ b/recipes/tinyexr/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not cross_building(self): bin_path = os.path.join("bin", "test_package") - img_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.exr") - self.run(f"{bin_path} {img_path}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/tinygltf/all/conandata.yml b/recipes/tinygltf/all/conandata.yml index fb20b704f6ed3..105809b76f50e 100644 --- a/recipes/tinygltf/all/conandata.yml +++ b/recipes/tinygltf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.9.0": + url: "https://github.com/syoyo/tinygltf/archive/v2.9.0.tar.gz" + sha256: "76c4da3fcd664ccf1b3d35f1d934dd19820141c8705c4966d841176c4c10a2e9" "2.8.19": url: "https://github.com/syoyo/tinygltf/archive/v2.8.19.tar.gz" sha256: "9e3f6206c6e922c7482e1b4612b62c5cddb7e053b6690fa20edfa5d97805053b" diff --git a/recipes/tinygltf/all/test_package/box01.glb b/recipes/tinygltf/all/test_package/box01.glb deleted file mode 100644 index 7477e897f06a5..0000000000000 Binary files a/recipes/tinygltf/all/test_package/box01.glb and /dev/null differ diff --git a/recipes/tinygltf/all/test_package/conanfile.py b/recipes/tinygltf/all/test_package/conanfile.py index 0708ee77c3850..0a6bc68712d90 100644 --- a/recipes/tinygltf/all/test_package/conanfile.py +++ b/recipes/tinygltf/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - glb_path = os.path.join(self.source_folder, "box01.glb") - self.run(f"{bin_path} {glb_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/tinygltf/all/test_package/test_package.cpp b/recipes/tinygltf/all/test_package/test_package.cpp index ade21796f6efe..0dd78b403c96f 100644 --- a/recipes/tinygltf/all/test_package/test_package.cpp +++ b/recipes/tinygltf/all/test_package/test_package.cpp @@ -8,29 +8,13 @@ #include int main(int argc, char **argv) { - if (argc < 2) { - std::cerr << "Need at least one argument\n"; - return 1; - } tinygltf::Model model; tinygltf::TinyGLTF loader; std::string err; std::string warn; - bool ret = loader.LoadBinaryFromFile(&model, &err, &warn, argv[1]); - - if (!warn.empty()) { - printf("Warn: %s\n", warn.c_str()); - } - - if (!err.empty()) { - printf("Err: %s\n", err.c_str()); - } - - if (!ret) { - printf("Failed to parse glTF\n"); - return -1; - } + bool ret = loader.LoadBinaryFromFile(&model, &err, &warn, "non_existent_file.glb"); + printf("Test %d\n", ret); return 0; } diff --git a/recipes/tinygltf/all/test_v1_package/conanfile.py b/recipes/tinygltf/all/test_v1_package/conanfile.py index 6d85d0b397c56..38f4483872d47 100644 --- a/recipes/tinygltf/all/test_v1_package/conanfile.py +++ b/recipes/tinygltf/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - glb_path = os.path.join(self.source_folder, os.pardir, "test_package", "box01.glb") - self.run(f"{bin_path} {glb_path}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/tinygltf/config.yml b/recipes/tinygltf/config.yml index 0589bcf5301f7..3eba51a5b7276 100644 --- a/recipes/tinygltf/config.yml +++ b/recipes/tinygltf/config.yml @@ -1,4 +1,6 @@ versions: + "2.9.0": + folder: all "2.8.19": folder: all "2.8.13": diff --git a/recipes/tixi3/all/conandata.yml b/recipes/tixi3/all/conandata.yml index 2336f6ccbdc16..0af8f2d8ae5cf 100644 --- a/recipes/tixi3/all/conandata.yml +++ b/recipes/tixi3/all/conandata.yml @@ -4,6 +4,10 @@ sources: url: "https://github.com/DLR-SC/tixi/archive/refs/tags/v3.3.0.tar.gz" patches: "3.3.0": + - patch_file: "patches/0001-missing-stdlib-include.patch" + patch_description: "fix missing stdlib include" + patch_type: "bugfix" + patch_source: "https://github.com/DLR-SC/tixi/pull/225" - patch_file: "patches/link_curl.patch" patch_description: "Fix CMake target name for libcurl" patch_type: "conan" diff --git a/recipes/tixi3/all/conanfile.py b/recipes/tixi3/all/conanfile.py index 9ec42f58000e7..51cfcf9ef724f 100644 --- a/recipes/tixi3/all/conanfile.py +++ b/recipes/tixi3/all/conanfile.py @@ -33,8 +33,8 @@ def generate(self): deps.generate() def requirements(self): - self.requires("libxml2/2.11.6") - self.requires("libxslt/1.1.37") + self.requires("libxml2/[>=2.12.5 <3]") + self.requires("libxslt/1.1.39") self.requires("libcurl/[>=7.78.0 <9]") def layout(self): diff --git a/recipes/tixi3/all/patches/0001-missing-stdlib-include.patch b/recipes/tixi3/all/patches/0001-missing-stdlib-include.patch new file mode 100644 index 0000000000000..1c8e8d048f4f9 --- /dev/null +++ b/recipes/tixi3/all/patches/0001-missing-stdlib-include.patch @@ -0,0 +1,88 @@ +From 53b324c41133ac72b36f2bcda0b75c2bf2f3bff0 Mon Sep 17 00:00:00 2001 +From: mayeut +Date: Sat, 20 Apr 2024 13:10:18 +0200 +Subject: [PATCH] fix issues with latest version of libxml2 + +--- + src/tixiImpl.c | 1 + + src/tixiInternal.c | 2 +- + src/tixiUtils.c | 1 + + src/uidHelper.c | 1 + + src/webMethods.c | 2 ++ + src/xpathFunctions.c | 1 + + 6 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/tixiImpl.c b/src/tixiImpl.c +index f9e08b9..aa306d1 100644 +--- a/src/tixiImpl.c ++++ b/src/tixiImpl.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + #include "libxml/parser.h" + #include "libxml/xpath.h" +diff --git a/src/tixiInternal.c b/src/tixiInternal.c +index 5bf0712..b399b4d 100644 +--- a/src/tixiInternal.c ++++ b/src/tixiInternal.c +@@ -46,7 +46,7 @@ + + extern void printMsg(MessageType type, const char* message, ...); + +-void xmlStructuredErrorHandler(void * userData, xmlErrorPtr error) { ++void xmlStructuredErrorHandler(void * userData, xmlError const* error) { + printMsg(MESSAGETYPE_ERROR, "%s:%i: %s", error->file, error->line, error->message); + } + +diff --git a/src/tixiUtils.c b/src/tixiUtils.c +index 834be5d..bd42fc8 100644 +--- a/src/tixiUtils.c ++++ b/src/tixiUtils.c +@@ -32,6 +32,7 @@ + #include + #include + #endif ++#include + + extern void printMsg(MessageType type, const char* message, ...); + +diff --git a/src/uidHelper.c b/src/uidHelper.c +index 9c7a7bd..841774d 100644 +--- a/src/uidHelper.c ++++ b/src/uidHelper.c +@@ -17,6 +17,7 @@ + */ + #include "uidHelper.h" + #include "tixiInternal.h" ++#include + + extern void printMsg(MessageType type, const char* message, ...); + +diff --git a/src/webMethods.c b/src/webMethods.c +index f8372e9..16e6411 100644 +--- a/src/webMethods.c ++++ b/src/webMethods.c +@@ -25,6 +25,8 @@ + #include + #include + ++#include ++ + extern void printMsg(MessageType type, const char* message, ...); + + void* myrealloc(void* ptr, size_t size) +diff --git a/src/xpathFunctions.c b/src/xpathFunctions.c +index 25442f6..69ce60e 100644 +--- a/src/xpathFunctions.c ++++ b/src/xpathFunctions.c +@@ -21,6 +21,7 @@ + #include "libxml/xpathInternals.h" + + #include ++#include + + extern void printMsg(MessageType type, const char* message, ...); + diff --git a/recipes/tmx/all/conandata.yml b/recipes/tmx/all/conandata.yml index 015638445fd3e..8a82786790fb4 100644 --- a/recipes/tmx/all/conandata.yml +++ b/recipes/tmx/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.10.0": + url: "https://github.com/baylej/tmx/archive/refs/tags/tmx_1.10.0.tar.gz" + sha256: "8ee42d1728c567d6047a58b2624c39c8844aaf675c470f9f284c4ed17e94188f" "1.4.0": url: "https://github.com/baylej/tmx/archive/refs/tags/tmx_1.4.0.tar.gz" sha256: "5ab52e72976141260edd1b15ea34e1626c0f4ba9b8d2afe7f4d68b51fc9fedf7" +patches: + "1.4.0": + - patch_file: "patches/0001-missing-stdlib-include.patch" + patch_description: "fix missing stdlib include" + patch_type: "bugfix" + patch_source: "https://github.com/baylej/tmx/commit/2d20ed631618f5e9ca89d90147aab8157989f5da.patch" diff --git a/recipes/tmx/all/conanfile.py b/recipes/tmx/all/conanfile.py index a45d56f04f970..30a73f62e1cfe 100644 --- a/recipes/tmx/all/conanfile.py +++ b/recipes/tmx/all/conanfile.py @@ -1,10 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get, rmdir, save +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save import os import textwrap -required_conan_version = ">=1.51.1" +required_conan_version = ">=1.53.0" class TmxConan(ConanFile): @@ -15,6 +15,7 @@ class TmxConan(ConanFile): homepage = "https://github.com/baylej/tmx" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,30 +30,24 @@ class TmxConan(ConanFile): "with_zstd": False, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - 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.libcxx") + self.settings.rm_safe("compiler.cppstd") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libxml2/2.11.6") + self.requires("libxml2/[>=2.12.5 <3]") if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zstd: @@ -75,6 +70,7 @@ def generate(self): deps.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/tmx/all/patches/0001-missing-stdlib-include.patch b/recipes/tmx/all/patches/0001-missing-stdlib-include.patch new file mode 100644 index 0000000000000..9c45635658dfa --- /dev/null +++ b/recipes/tmx/all/patches/0001-missing-stdlib-include.patch @@ -0,0 +1,22 @@ +From 2d20ed631618f5e9ca89d90147aab8157989f5da Mon Sep 17 00:00:00 2001 +From: Connor Rigby +Date: Thu, 18 Jan 2024 18:40:53 -0700 +Subject: [PATCH] tmx_mem: add stdlib.h for free and realloc + +Signed-off-by: Connor Rigby +--- + src/tmx_mem.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/tmx_mem.c b/src/tmx_mem.c +index 5ff31c9..b421af6 100644 +--- a/src/tmx_mem.c ++++ b/src/tmx_mem.c +@@ -2,6 +2,7 @@ + Node allocation + */ + ++#include + #include + + #include diff --git a/recipes/tmx/config.yml b/recipes/tmx/config.yml index c957e4bc2d3c7..2403f62fecbf1 100644 --- a/recipes/tmx/config.yml +++ b/recipes/tmx/config.yml @@ -1,3 +1,5 @@ versions: + "1.10.0": + folder: all "1.4.0": folder: all diff --git a/recipes/toml11/all/conandata.yml b/recipes/toml11/all/conandata.yml index 4af534aa325d5..ac81047f5f6b3 100644 --- a/recipes/toml11/all/conandata.yml +++ b/recipes/toml11/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "4.0.3": + url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v4.0.3.tar.gz" + sha256: "c8cbc7839cb3f235153045ce550e559f55a04554dfcab8743ba8a1e8ef6a54bf" + "4.0.1": + url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v4.0.1.tar.gz" + sha256: "96965cb00ca7757c611c169cd5a6fb15736eab1cd1c1a88aaa62ad9851d926aa" "3.8.1": url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v3.8.1.tar.gz" sha256: "6a3d20080ecca5ea42102c078d3415bef80920f6c4ea2258e87572876af77849" diff --git a/recipes/toml11/all/conanfile.py b/recipes/toml11/all/conanfile.py index 7d770d91572aa..6ba04d6746f11 100644 --- a/recipes/toml11/all/conanfile.py +++ b/recipes/toml11/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.files import copy, get from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os required_conan_version = ">=1.50.0" @@ -32,8 +33,12 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - copy(self, "toml.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "toml11")) - copy(self, "*.hpp", src=os.path.join(self.source_folder, "toml"), dst=os.path.join(self.package_folder, "include", "toml11", "toml")) + if Version(self.version) < "4.0.0": + copy(self, "toml.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "toml11")) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "toml"), dst=os.path.join(self.package_folder, "include", "toml11", "toml")) + else: + copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) def package_info(self): diff --git a/recipes/toml11/config.yml b/recipes/toml11/config.yml index cc2a74e6a20e3..2c9b67b0ff120 100644 --- a/recipes/toml11/config.yml +++ b/recipes/toml11/config.yml @@ -1,4 +1,8 @@ versions: + "4.0.3": + folder: all + "4.0.1": + folder: all "3.8.1": folder: all "3.8.0": diff --git a/recipes/tomlplusplus/all/conanfile.py b/recipes/tomlplusplus/all/conanfile.py index c7d9d9ea44bf5..4743d8a6d4255 100644 --- a/recipes/tomlplusplus/all/conanfile.py +++ b/recipes/tomlplusplus/all/conanfile.py @@ -21,6 +21,12 @@ class TomlPlusPlusConan(ConanFile): license = "MIT" package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + options = { + "exceptions": [True, False, None] + } + default_options = { + "exceptions": None + } no_copy_source = True @property @@ -73,3 +79,8 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "tomlplusplus::tomlplusplus") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + # Casting as a String because None value would not be properly handled, this is a PackageOption, not the value itself + # which `is` never None + if str(self.options.exceptions) != "None": + define_value = "1" if self.options.exceptions is True else "0" + self.cpp_info.defines.append(f"TOML_EXCEPTIONS={define_value}") diff --git a/recipes/tomlplusplus/all/test_package/test_package.cpp b/recipes/tomlplusplus/all/test_package/test_package.cpp index d50b3c6469741..96107c1712ae1 100644 --- a/recipes/tomlplusplus/all/test_package/test_package.cpp +++ b/recipes/tomlplusplus/all/test_package/test_package.cpp @@ -7,21 +7,25 @@ using namespace std::string_view_literals; int main(int argc, char* argv[]) { auto config = toml::parse_file(argv[1]); + // Important: this cast will convert from parse_result which is sometimes defined as a table + // and sometimes defined as it's own class that is castable to a table&. + auto& table = static_cast(config); // get key-value pairs - std::string_view library_name = config["library"]["name"].value_or(""sv); - std::string_view library_author = config["library"]["authors"][0].value_or(""sv); - int64_t depends_on_cpp_version = config["dependencies"]["cpp"].value_or(0); + std::string_view library_name = table["library"]["name"].value_or(""sv); + std::string_view library_author = table["library"]["authors"][0].value_or(""sv); + int64_t depends_on_cpp_version = table["dependencies"]["cpp"].value_or(0); // modify the data - config.insert_or_assign("alternatives", toml::array{ + table.insert_or_assign("alternatives", toml::array{ "cpptoml", "toml11", "Boost.TOML" }); + table.insert_or_assign("exceptions", TOML_EXCEPTIONS==1); // iterate & visit over the data - for (auto&& [k, v] : config) + for (auto&& [k, v] : table) { v.visit([](auto& node) noexcept { @@ -30,9 +34,9 @@ int main(int argc, char* argv[]) { } // re-serialize as TOML - std::cout << config << std::endl; + std::cout << table << std::endl; // re-serialize as JSON - std::cout << toml::json_formatter{ config } << std::endl; + std::cout << toml::json_formatter{ table } << std::endl; return 0; } diff --git a/recipes/tomlplusplus/all/test_package/test_package_multi.cpp b/recipes/tomlplusplus/all/test_package/test_package_multi.cpp index df195938cfdee..436a7391f96b1 100644 --- a/recipes/tomlplusplus/all/test_package/test_package_multi.cpp +++ b/recipes/tomlplusplus/all/test_package/test_package_multi.cpp @@ -7,21 +7,25 @@ using namespace std::string_view_literals; int main(int argc, char* argv[]) { auto config = toml::parse_file(argv[1]); + // Important: this cast will convert from parse_result which is sometimes defined as a table + // and sometimes defined as it's own class that is castable to a table&. + auto& table = static_cast(config); // get key-value pairs - std::string_view library_name = config["library"]["name"].value_or(""sv); - std::string_view library_author = config["library"]["authors"][0].value_or(""sv); - int64_t depends_on_cpp_version = config["dependencies"]["cpp"].value_or(0); + std::string_view library_name = table["library"]["name"].value_or(""sv); + std::string_view library_author = table["library"]["authors"][0].value_or(""sv); + int64_t depends_on_cpp_version = table["dependencies"]["cpp"].value_or(0); // modify the data - config.insert_or_assign("alternatives", toml::array{ + table.insert_or_assign("alternatives", toml::array{ "cpptoml", "toml11", "Boost.TOML" }); + table.insert_or_assign("exceptions", TOML_EXCEPTIONS==1); // iterate & visit over the data - for (auto&& [k, v] : config) + for (auto&& [k, v] : table) { v.visit([](auto& node) noexcept { @@ -30,9 +34,9 @@ int main(int argc, char* argv[]) { } // re-serialize as TOML - std::cout << config << std::endl; + std::cout << table << std::endl; // re-serialize as JSON - std::cout << toml::json_formatter{ config } << std::endl; + std::cout << toml::json_formatter{ table } << std::endl; return 0; } diff --git a/recipes/toon/all/conandata.yml b/recipes/toon/all/conandata.yml new file mode 100644 index 0000000000000..2e5eef4c5773f --- /dev/null +++ b/recipes/toon/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "3.2": + url: "https://github.com/edrosten/TooN/archive/refs/tags/TOON_3.2.tar.gz" + sha256: "62f30dfb92a6f8873e6a42649760e2d1b54e61e1d3bc023d0bb171600b41c759" +patches: + "3.2": + - patch_file: "patches/001-bugfixes-backport.patch" + patch_description: "apply unreleased minor fixes" + patch_type: "backport" + patch_source: "https://github.com/edrosten/TooN/compare/TOON_3.2...370dcd9" diff --git a/recipes/toon/all/conanfile.py b/recipes/toon/all/conanfile.py new file mode 100644 index 0000000000000..6756336186e83 --- /dev/null +++ b/recipes/toon/all/conanfile.py @@ -0,0 +1,99 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class ToonConan(ConanFile): + name = "toon" + description = "TooN - Tom's Object Oriented Numerics library" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://codedocs.xyz/edrosten/TooN/" + topics = ("numerical", "linear-algebra", "matrix", "vector", "optimization", "automatic-differentiation", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + exports_sources = ["config.hh"] + + options = { + "with_lapack": [True, False] + } + default_options = { + "with_lapack": True + } + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "msvc": "191", + "Visual Studio": "15", + } + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_lapack: + self.requires("openblas/0.3.26", options={"build_lapack": True}) + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if self.options.with_lapack and not self.dependencies["openblas"].options.build_lapack: + raise ConanInvalidConfiguration(f"{self.ref} requires LAPACK support in OpenBLAS with -o='openblas/*:build_lapack=True'") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*", + os.path.join(self.source_folder, "TooN"), + os.path.join(self.package_folder, "include", "TooN")) + copy(self, "config.hh", self.export_sources_folder, + os.path.join(self.package_folder, "include", "TooN", "internal")) + + if not self.options.with_lapack: + replace_in_file( + self, + os.path.join(self.package_folder, "include", "TooN", "internal", "config.hh"), + "define TOON_USE_LAPACK", + "undef TOON_USE_LAPACK" + ) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "TooN") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/toon/all/config.hh b/recipes/toon/all/config.hh new file mode 100644 index 0000000000000..ed689361e6c58 --- /dev/null +++ b/recipes/toon/all/config.hh @@ -0,0 +1,29 @@ +/* TooN/internal/config.hh. Generated from config.hh.in by configure. */ +/* TooN/internal/config.hh.in. Generated from configure.ac by autoheader. */ + +/* define if the compiler supports basic C++14 syntax */ +#undef HAVE_CXX14 + +/* Define to 1 if you have the `lapack' library (-llapack). */ +#define HAVE_LIBLAPACK 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "https://github.com/edrosten/TooN" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "TooN" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "TooN version-3.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "toon" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "https://codedocs.xyz/edrosten/TooN/" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "version-3.2" + +/* Use LAPACK */ +#define TOON_USE_LAPACK diff --git a/recipes/toon/all/patches/001-bugfixes-backport.patch b/recipes/toon/all/patches/001-bugfixes-backport.patch new file mode 100644 index 0000000000000..634a27c8578c0 --- /dev/null +++ b/recipes/toon/all/patches/001-bugfixes-backport.patch @@ -0,0 +1,127 @@ +diff --git a/TooN/QR.h b/TooN/QR.h +index e2273cc..10b33c3 100644 +--- a/TooN/QR.h ++++ b/TooN/QR.h +@@ -29,6 +29,7 @@ + #ifndef TOON_INC_QR_H + #define TOON_INC_QR_H + #include ++#include + #include + + namespace TooN +diff --git a/TooN/QR_Lapack.h b/TooN/QR_Lapack.h +index 6b628d1..67f1fd0 100644 +--- a/TooN/QR_Lapack.h ++++ b/TooN/QR_Lapack.h +@@ -29,6 +29,7 @@ + + #include + #include ++#include + #include + + namespace TooN{ +diff --git a/TooN/SVD.h b/TooN/SVD.h +index a74deed..e22a437 100644 +--- a/TooN/SVD.h ++++ b/TooN/SVD.h +@@ -30,6 +30,7 @@ + + #include + #include ++#include + + namespace TooN { + +diff --git a/TooN/SymEigen.h b/TooN/SymEigen.h +index aa5b434..8c6d42f 100644 +--- a/TooN/SymEigen.h ++++ b/TooN/SymEigen.h +@@ -28,6 +28,7 @@ + #ifndef __SYMEIGEN_H + #define __SYMEIGEN_H + ++#include + #include + #include + #include +diff --git a/TooN/functions/derivatives.h b/TooN/functions/derivatives.h +index 791f71e..9749461 100644 +--- a/TooN/functions/derivatives.h ++++ b/TooN/functions/derivatives.h +@@ -27,6 +27,7 @@ + #define TOON_INCLUDE_DERIVATIVES_NUMERICAL_H + + #include ++#include + #include + #include + +diff --git a/TooN/helpers.h b/TooN/helpers.h +index 8204560..447bca3 100644 +--- a/TooN/helpers.h ++++ b/TooN/helpers.h +@@ -32,6 +32,7 @@ + + #include + #include ++#include + #include + #include + #include +diff --git a/TooN/optimization/brent.h b/TooN/optimization/brent.h +index e117a80..3e60251 100644 +--- a/TooN/optimization/brent.h ++++ b/TooN/optimization/brent.h +@@ -27,6 +27,7 @@ + #define TOON_BRENT_H + #include + #include ++#include + #include + #include + #include +diff --git a/doc/documentation.h b/doc/documentation.h +index 2df5d9e..95276b1 100644 +--- a/doc/documentation.h ++++ b/doc/documentation.h +@@ -1,15 +1,7 @@ + /* + Copyright (c) 2005 Paul Smith, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Edward Rosten + +- Permission is granted to copy, distribute and/or modify this document under +- the terms of the GNU Free Documentation License, Version 1.2 or any later +- version published by the Free Software Foundation; with no Invariant +- Sections, no Front-Cover Texts, and no Back-Cover Texts. +- +- You should have received a copy of the GNU Free Documentation License +- License along with this library; if not, write to the Free Software +- Foundation, Inc. +- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ This library is free software, see COPYING file for details + + */ + /////////////////////////////////////////////////////// +diff --git a/doc/linoperatorsdoc.h b/doc/linoperatorsdoc.h +index b7aa503..f2ec6b1 100644 +--- a/doc/linoperatorsdoc.h ++++ b/doc/linoperatorsdoc.h +@@ -1,16 +1,7 @@ + /* + Copyright (c) 2005 Paul Smith + +- Permission is granted to copy, distribute and/or modify this document under +- the terms of the GNU Free Documentation License, Version 1.2 or any later +- version published by the Free Software Foundation; with no Invariant +- Sections, no Front-Cover Texts, and no Back-Cover Texts. +- +- You should have received a copy of the GNU Free Documentation License +- License along with this library; if not, write to the Free Software +- Foundation, Inc. +- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +- ++ This library is free software, see COPYING file for details + */ + // A proxy version of the Matrix class, + // cleaned up to present a comprehensible diff --git a/recipes/toon/all/test_package/CMakeLists.txt b/recipes/toon/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..28a1d29b7ba57 --- /dev/null +++ b/recipes/toon/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(TooN REQUIRED IMPORTED_TARGET TooN) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::TooN) +if (WITH_LAPACK) + target_compile_definitions(${PROJECT_NAME} PRIVATE "WITH_LAPACK") +endif () +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/toon/all/test_package/conanfile.py b/recipes/toon/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cfe5e425874fc --- /dev/null +++ b/recipes/toon/all/test_package/conanfile.py @@ -0,0 +1,35 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "PkgConfigDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_LAPACK"] = self.dependencies[self.tested_reference_str].options.with_lapack + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/toon/all/test_package/test_package.cpp b/recipes/toon/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..da2c3199f9737 --- /dev/null +++ b/recipes/toon/all/test_package/test_package.cpp @@ -0,0 +1,38 @@ +#include +#include + +#ifdef USE_LAPACK +#include +#endif + +#include +#include + +using namespace TooN; + +void test_determinant() { + Matrix<3> t = Data( + 1, 0.5, 0.5, + 0.5, 2, 0.7, + 0.5, 0.7, 3); + std::cout << "determinant: " << determinant(t) << std::endl; +} + +#ifdef USE_LAPACK +void test_lapack() { + Matrix<3> t = Data( + 1, 0.5, 0.5, + 0.5, 2, 0.7, + 0.5, 0.7, 3); + Lapack_Cholesky<3> chol(t); + std::cout << "Lapack_Cholesky determinat: " << chol.determinant() << std::endl; +} +#endif + +int main() { + test_determinant(); + +#ifdef USE_LAPACK + test_lapack(); +#endif +} diff --git a/recipes/toon/config.yml b/recipes/toon/config.yml new file mode 100644 index 0000000000000..9b5abcde381a5 --- /dev/null +++ b/recipes/toon/config.yml @@ -0,0 +1,3 @@ +versions: + "3.2": + folder: all diff --git a/recipes/trantor/all/conandata.yml b/recipes/trantor/all/conandata.yml index 8d7d3d5b8bb82..62488c1cd1518 100644 --- a/recipes/trantor/all/conandata.yml +++ b/recipes/trantor/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.19": + url: "https://github.com/an-tao/trantor/archive/v1.5.19.tar.gz" + sha256: "a2f55a98fd4b0737ba0e2cd77d2f237253e607b2047071be04a9ea76587bb608" "1.5.16": url: "https://github.com/an-tao/trantor/archive/v1.5.16.tar.gz" sha256: "ef6f4d9c855ea7823dd9bfb094e852d23450b5fc149936f09964d19cb34741e9" @@ -27,6 +30,10 @@ sources: url: "https://github.com/an-tao/trantor/archive/v1.5.7.tar.gz" sha256: "42576563afbf1e58c7d68f758cf3fca4d193496d4e3f82c80069d8389a7839d5" patches: + "1.5.19": + - patch_file: "patches/1.5.19-0001-disable-werror.patch" + patch_description: "disable -Werror for gcc5" + patch_type: "portability" "1.5.16": - patch_file: "patches/1.5.15-0001-disable-werror.patch" patch_description: "disable -Werror for gcc5" diff --git a/recipes/trantor/all/patches/1.5.19-0001-disable-werror.patch b/recipes/trantor/all/patches/1.5.19-0001-disable-werror.patch new file mode 100644 index 0000000000000..c627d69cd2495 --- /dev/null +++ b/recipes/trantor/all/patches/1.5.19-0001-disable-werror.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a0b10de..b2331dc 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -76,7 +76,7 @@ if(NOT + "Windows" + AND CMAKE_CXX_COMPILER_ID MATCHES Clang|GNU + ) +- target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror) ++ target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra) + endif() + + if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") diff --git a/recipes/trantor/config.yml b/recipes/trantor/config.yml index be5d52dcb95bc..a5621cf2bc6f8 100644 --- a/recipes/trantor/config.yml +++ b/recipes/trantor/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.19": + folder: "all" "1.5.16": folder: "all" "1.5.15": diff --git a/recipes/tree-gen/all/conandata.yml b/recipes/tree-gen/all/conandata.yml index 21ee5b5699adc..71aa893da1723 100644 --- a/recipes/tree-gen/all/conandata.yml +++ b/recipes/tree-gen/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.7": + url: "https://github.com/QuTech-Delft/tree-gen/archive/refs/tags/1.0.7.tar.gz" + sha256: "bd27c88d789efe1d187846d3b819fbaa1ba3a520d6d4181d1216c4a2e73e4e85" "1.0.6": url: "https://github.com/QuTech-Delft/tree-gen/archive/refs/tags/1.0.6.tar.gz" sha256: "a7f6617830b3817b21cddc0f4442a04c10fbb89a19cabb1bbd0e8facb040cba8" diff --git a/recipes/tree-gen/config.yml b/recipes/tree-gen/config.yml index c8c4465c97415..4028d61266d40 100644 --- a/recipes/tree-gen/config.yml +++ b/recipes/tree-gen/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.7": + folder: all "1.0.6": folder: all diff --git a/recipes/tree-sitter/all/conandata.yml b/recipes/tree-sitter/all/conandata.yml index 8277c606ebb37..3ddeeffd1d3bc 100644 --- a/recipes/tree-sitter/all/conandata.yml +++ b/recipes/tree-sitter/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.22.6": + url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.22.6.tar.gz" + sha256: "e2b687f74358ab6404730b7fb1a1ced7ddb3780202d37595ecd7b20a8f41861f" + "0.22.5": + url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.22.5.tar.gz" + sha256: "6bc22ca7e0f81d77773462d922cf40b44bfd090d92abac75cb37dbae516c2417" "0.22.1": url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.22.1.tar.gz" sha256: "b21065e78da33e529893c954e712ad15d9ad44a594b74567321d4a3a007d6090" diff --git a/recipes/tree-sitter/config.yml b/recipes/tree-sitter/config.yml index d166b5cb681fc..7357ec5c57b73 100644 --- a/recipes/tree-sitter/config.yml +++ b/recipes/tree-sitter/config.yml @@ -1,4 +1,8 @@ versions: + "0.22.6": + folder: all + "0.22.5": + folder: all "0.22.1": folder: all "0.21.0": diff --git a/recipes/tsl-robin-map/all/conandata.yml b/recipes/tsl-robin-map/all/conandata.yml index 89211be8fec7b..184cd30d5f022 100644 --- a/recipes/tsl-robin-map/all/conandata.yml +++ b/recipes/tsl-robin-map/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.3.0": + url: "https://github.com/Tessil/robin-map/archive/v1.3.0.tar.gz" + sha256: "a8424ad3b0affd4c57ed26f0f3d8a29604f0e1f2ef2089f497f614b1c94c7236" + "1.2.2": + url: "https://github.com/Tessil/robin-map/archive/v1.2.2.tar.gz" + sha256: "c72767ecea2a90074c7efbe91620c8f955af666505e22782e82813c652710821" "1.2.1": url: "https://github.com/Tessil/robin-map/archive/v1.2.1.tar.gz" sha256: "2b54d2c1de2f73bea5c51d5dcbd64813a08caf1bfddcfdeee40ab74e9599e8e3" diff --git a/recipes/tsl-robin-map/all/conanfile.py b/recipes/tsl-robin-map/all/conanfile.py index 14ac380eaf691..d6ee665d5c051 100644 --- a/recipes/tsl-robin-map/all/conanfile.py +++ b/recipes/tsl-robin-map/all/conanfile.py @@ -11,9 +11,9 @@ class TslRobinMapConan(ConanFile): name = "tsl-robin-map" license = "MIT" description = "C++ implementation of a fast hash map and hash set using robin hood hashing." - topics = ("robin-map", "structure", "hash map", "hash set") - homepage = "https://github.com/Tessil/robin-map" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Tessil/robin-map" + topics = ("robin-map", "structure", "hash map", "hash set", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/tsl-robin-map/config.yml b/recipes/tsl-robin-map/config.yml index 7a3b316dace84..05411da627de4 100644 --- a/recipes/tsl-robin-map/config.yml +++ b/recipes/tsl-robin-map/config.yml @@ -1,4 +1,8 @@ versions: + "1.3.0": + folder: all + "1.2.2": + folder: all "1.2.1": folder: all "1.0.1": diff --git a/recipes/type_safe/all/conandata.yml b/recipes/type_safe/all/conandata.yml index 0be0030fda0b5..1e778714e307e 100644 --- a/recipes/type_safe/all/conandata.yml +++ b/recipes/type_safe/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.4": + url: "https://github.com/foonathan/type_safe/archive/v0.2.4.tar.gz" + sha256: "a631d03c18c65726b3d1b7d41ac5806e9121367afe10dd2f408a2d75e144b734" "0.2.3": url: "https://github.com/foonathan/type_safe/archive/v0.2.3.tar.gz" sha256: "19008ab9526b0d2db1ae6bbd6640f5f7a398826bb2266561472e9f1b10d85bec" diff --git a/recipes/type_safe/config.yml b/recipes/type_safe/config.yml index ae20ba2754647..3e1d8c0bc781f 100644 --- a/recipes/type_safe/config.yml +++ b/recipes/type_safe/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.4": + folder: all "0.2.3": folder: all "0.2.2": diff --git a/recipes/uncrustify/all/conandata.yml b/recipes/uncrustify/all/conandata.yml index b95a9b875d7e4..e46325da0f342 100644 --- a/recipes/uncrustify/all/conandata.yml +++ b/recipes/uncrustify/all/conandata.yml @@ -1,16 +1,10 @@ sources: + "0.79.0": + url: "https://github.com/uncrustify/uncrustify/archive/uncrustify-0.79.0.tar.gz" + sha256: "e7afaeabf636b7f0ce4e3e9747b95f7bd939613a8db49579755dddf44fedca5f" "0.78.1": url: "https://github.com/uncrustify/uncrustify/archive/uncrustify-0.78.1.tar.gz" sha256: "ecaf4c0adca14c36dfffa30bc28e69865115ecd602c90eb16a8cddccb41caad2" - "0.78.0": - url: "https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.78.0.tar.gz" - sha256: "377efec187c26c7ad77900d94032fa51b029831c69442d607a6e53ef2115928f" "0.77.1": url: "https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.77.1.tar.gz" sha256: "414bbc9f7860eb18a53074f9af14ed04638a633b2216a73f2629291300d37c1b" - "0.75.1": - url: "https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.75.1.tar.gz" - sha256: "fd14acc0a31ed88b33137bdc26d32964327488c835f885696473ef07caf2e182" - "0.74.0": - url: "https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.74.0.tar.gz" - sha256: "b7d24e256e7f919aa96289ac8167ac98340df7faa2d34b60d2242dc54700caaa" diff --git a/recipes/uncrustify/config.yml b/recipes/uncrustify/config.yml index d0d1205acdb6e..2c75346920bc6 100644 --- a/recipes/uncrustify/config.yml +++ b/recipes/uncrustify/config.yml @@ -1,11 +1,7 @@ versions: - "0.78.1": + "0.79.0": folder: all - "0.78.0": + "0.78.1": folder: all "0.77.1": folder: all - "0.75.1": - folder: all - "0.74.0": - folder: all diff --git a/recipes/unleash-client-cpp/all/CMakeLists.txt b/recipes/unleash-client-cpp/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- a/recipes/unleash-client-cpp/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/unleash-client-cpp/all/conandata.yml b/recipes/unleash-client-cpp/all/conandata.yml index 76a5bca8da701..69cfd9795a61f 100644 --- a/recipes/unleash-client-cpp/all/conandata.yml +++ b/recipes/unleash-client-cpp/all/conandata.yml @@ -1,8 +1,4 @@ sources: - "1.1.1": - url: "https://github.com/aruizs/unleash-client-cpp/archive/refs/tags/v1.1.1.tar.gz" - sha256: "2750dc231bf608910d4270ac39d83d46d25b88cc547a9d4d31f7ce4950effa7c" -patches: - "1.1.1": - - patch_file: "patches/0001-no-conan-cmake.patch" - base_path: "source_subfolder" + "1.3.0": + url: "https://github.com/aruizs/unleash-client-cpp/archive/refs/tags/v1.3.0.tar.gz" + sha256: "fa0b8d6101c6dbd08db23a3d353f386c17e9436a63d658f88c7d0b8619b8d501" diff --git a/recipes/unleash-client-cpp/all/conanfile.py b/recipes/unleash-client-cpp/all/conanfile.py index 08a60bfc378de..5c84a2f78a279 100644 --- a/recipes/unleash-client-cpp/all/conanfile.py +++ b/recipes/unleash-client-cpp/all/conanfile.py @@ -1,18 +1,22 @@ -from conans import ConanFile, CMake, 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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir import os -required_conan_version = ">=1.43.0" +from conan.tools.scm import Version +required_conan_version = ">=1.53.0" class UnleashConan(ConanFile): name = "unleash-client-cpp" - homepage = "https://github.com/aruizs/unleash-client-cpp/" + description = "Unleash Client SDK for C++ projects." license = "MIT" url = "https://github.com/conan-io/conan-center-index" - description = "Unleash Client SDK for C++ projects." + homepage = "https://github.com/aruizs/unleash-client-cpp/" topics = ("unleash", "feature", "flag", "toggle") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,17 +27,6 @@ class UnleashConan(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" - @property def _min_cppstd(self): return "17" @@ -42,75 +35,61 @@ def _min_cppstd(self): def _compilers_min_version(self): return { "Visual Studio": "15", # Should we check toolset? + "msvc": "191", "gcc": "7", "clang": "4.0", "apple-clang": "3.8", "intel": "17", } - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) - 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): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("cpr/1.7.2") - self.requires("nlohmann_json/3.10.5") + self.requires("cpr/1.10.5") + self.requires("nlohmann_json/3.11.3") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._min_cppstd) - - def loose_lt_semver(v1, v2): - lv1 = [int(v) for v in v1.split(".")] - lv2 = [int(v) for v in v2.split(".")] - min_length = min(len(lv1), len(lv2)) - return lv1[:min_length] < lv2[:min_length] + check_min_cppstd(self, self._min_cppstd) min_version = self._compilers_min_version.get(str(self.settings.compiler), False) - if min_version and loose_lt_semver(str(self.settings.compiler.version), min_version): + if min_version and Version(self.settings.compiler.version) < min_version: raise ConanInvalidConfiguration( - "{} requires C++{}, which your compiler does not support.".format(self.name, self._min_cppstd) + 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) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["ENABLE_TESTING"] = False - self._cmake.definitions["ENABLE_TEST_COVERAGE"] = 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["ENABLE_TESTING"] = False + tc.variables["ENABLE_TESTING_COVERAGE"] = False + 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() + 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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + 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.libs = ["unleash"] self.cpp_info.set_property("cmake_file_name", "unleash") self.cpp_info.set_property("cmake_target_name", "unleash::unleash") - self.cpp_info.libs = ["unleash"] - - self.cpp_info.names["cmake_find_package"] = "unleash" - self.cpp_info.names["cmake_find_package_multi"] = "unleash" - diff --git a/recipes/unleash-client-cpp/all/patches/0001-no-conan-cmake.patch b/recipes/unleash-client-cpp/all/patches/0001-no-conan-cmake.patch deleted file mode 100644 index f88f88c81dde7..0000000000000 --- a/recipes/unleash-client-cpp/all/patches/0001-no-conan-cmake.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -25,8 +25,6 @@ if(DEFINED unleash_SHARED_LIBS) - endif() - - # External dependencies using Conan.io --include(cmake/Conan.cmake) --run_conan() - - # Create the main unleash library target - add_subdirectory(src) diff --git a/recipes/unleash-client-cpp/all/test_package/CMakeLists.txt b/recipes/unleash-client-cpp/all/test_package/CMakeLists.txt index 5dfa06d3b7057..bd4860f14d566 100644 --- a/recipes/unleash-client-cpp/all/test_package/CMakeLists.txt +++ b/recipes/unleash-client-cpp/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package LANGUAGES CXX) find_package(unleash CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} unleash::unleash) +target_link_libraries(${PROJECT_NAME} PRIVATE unleash::unleash) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/unleash-client-cpp/all/test_package/conanfile.py b/recipes/unleash-client-cpp/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/unleash-client-cpp/all/test_package/conanfile.py +++ b/recipes/unleash-client-cpp/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def 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/unleash-client-cpp/all/test_package/test_package.cpp b/recipes/unleash-client-cpp/all/test_package/test_package.cpp index 9af855c3e03d7..1eaf68256bc88 100644 --- a/recipes/unleash-client-cpp/all/test_package/test_package.cpp +++ b/recipes/unleash-client-cpp/all/test_package/test_package.cpp @@ -1,10 +1,11 @@ #include +#include +#include #include int main() { unleash::UnleashClient unleashClient = unleash::UnleashClient::create("production", "https://www.apple.com/%"); - unleashClient.initializeClient(); - return unleashClient.isEnabled("feature.toogle"); - + std::cout << "feature.toggle - is enabled: " << std::boolalpha << unleashClient.isEnabled("feature.toogle") << '\n'; + return 0; } diff --git a/recipes/unleash-client-cpp/config.yml b/recipes/unleash-client-cpp/config.yml index 60d31991f5141..426a0e4c79e9b 100644 --- a/recipes/unleash-client-cpp/config.yml +++ b/recipes/unleash-client-cpp/config.yml @@ -1,3 +1,3 @@ versions: - "1.1.1": + "1.3.0": folder: all diff --git a/recipes/uriparser/all/conandata.yml b/recipes/uriparser/all/conandata.yml index 2e0f68c6098de..e42d123f7e6e6 100644 --- a/recipes/uriparser/all/conandata.yml +++ b/recipes/uriparser/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.8": + url: "https://github.com/uriparser/uriparser/releases/download/uriparser-0.9.8/uriparser-0.9.8.tar.xz" + sha256: "1d71c054837ea32a31e462bce5a1af272379ecf511e33448e88100b87ff73b2e" "0.9.7": url: "https://github.com/uriparser/uriparser/releases/download/uriparser-0.9.7/uriparser-0.9.7.tar.xz" sha256: "1ddae35cb3cc2c36e8199829d46f1c7f8b222e74a723fdae67ec8561e1ac5a39" diff --git a/recipes/uriparser/all/conanfile.py b/recipes/uriparser/all/conanfile.py index 9e901d6027dc5..c8edbccee9815 100644 --- a/recipes/uriparser/all/conanfile.py +++ b/recipes/uriparser/all/conanfile.py @@ -10,10 +10,10 @@ class UriparserConan(ConanFile): name = "uriparser" description = "Strictly RFC 3986 compliant URI parsing and handling library written in C89" - topics = ("uri", "parser") + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://uriparser.github.io/" - license = "BSD-3-Clause" + topics = ("uri", "parser") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { diff --git a/recipes/uriparser/config.yml b/recipes/uriparser/config.yml index 983b5479ac5be..42a189b84f1e9 100644 --- a/recipes/uriparser/config.yml +++ b/recipes/uriparser/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.8": + folder: "all" "0.9.7": folder: "all" "0.9.6": diff --git a/recipes/userspace-rcu/all/conandata.yml b/recipes/userspace-rcu/all/conandata.yml index 570705edb2dd6..63079c64c1840 100644 --- a/recipes/userspace-rcu/all/conandata.yml +++ b/recipes/userspace-rcu/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.14.0": + url: "https://github.com/urcu/userspace-rcu/archive/refs/tags/v0.14.0.tar.gz" + sha256: "42fb5129a3fffe5a4b790dfe1ea3a734c69ee095fefbf649326269bba94c262d" "0.11.4": - sha256: d995598482221587ff6753d2a8da6ac74ff0fa79fbea29ccee196f295834531d - url: https://github.com/urcu/userspace-rcu/archive/refs/tags/v0.11.4.tar.gz + url: "https://github.com/urcu/userspace-rcu/archive/refs/tags/v0.11.4.tar.gz" + sha256: "d995598482221587ff6753d2a8da6ac74ff0fa79fbea29ccee196f295834531d" diff --git a/recipes/userspace-rcu/all/conanfile.py b/recipes/userspace-rcu/all/conanfile.py index ad697812f9c26..bc82bbc3b711b 100644 --- a/recipes/userspace-rcu/all/conanfile.py +++ b/recipes/userspace-rcu/all/conanfile.py @@ -1,28 +1,25 @@ import os -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conan.tools.files import get, rmdir -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import chdir, copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class UserspaceRCUConan(ConanFile): name = "userspace-rcu" - homepage ="https://liburcu.org/" description = "Userspace RCU (read-copy-update) library" - topics = ("urcu") - url = "https://github.com/conan-io/conan-center-index" license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://liburcu.org/" + topics = "urcu" - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - settings = "os", "compiler", "build_type", "arch" - + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -31,65 +28,58 @@ def _source_subfolder(self): "shared": False, "fPIC": True, } - build_requires = ( - "libtool/2.4.6", - ) - generators = "PkgConfigDeps" + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: - raise ConanInvalidConfiguration("Building for {} unsupported".format(self.settings.os)) + raise ConanInvalidConfiguration(f"Building for {self.settings.os} unsupported") + if self.version == "0.11.4" and self.settings.compiler == "apple-clang": + # Fails with "cds_hlist_add_head_rcu.c:19:10: fatal error: 'urcu/urcu-memb.h' file not found" + raise ConanInvalidConfiguration(f"{self.ref} is not compatible with apple-clang") - def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - if self.options.shared: - del self.options.fPIC + def build_requirements(self): + self.tool_requires("libtool/2.4.7") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - self._autotools.libs = [] - yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - ] - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.generate() def build(self): - with tools.chdir(self._source_subfolder): - self.run("./bootstrap") - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() autotools.make() def package(self): - self.copy(pattern="LICENSE*", src=self._source_subfolder, dst="licenses") - autotools = self._configure_autotools() + copy(self, "LICENSE*", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) autotools.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + rm(self, "*.la", self.package_folder, recursive=True) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): for lib_type in ["", "-bp", "-cds", "-mb", "-memb", "-qsbr", "-signal"]: - component_name = "urcu{}".format(lib_type) + component_name = f"urcu{lib_type}" self.cpp_info.components[component_name].libs = ["urcu-common", component_name] self.cpp_info.components[component_name].set_property("pkg_config_name", component_name) - self.cpp_info.components[component_name].names["pkg_config"] = component_name - # todo Remove in Conan version 1.50.0 where these are set by default for the PkgConfigDeps generator. - self.cpp_info.components[component_name].includedirs = ["include"] - self.cpp_info.components[component_name].libdirs = ["lib"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components[component_name].system_libs = ["pthread"] # Some definitions needed for MB and Signal variants diff --git a/recipes/userspace-rcu/all/test_package/CMakeLists.txt b/recipes/userspace-rcu/all/test_package/CMakeLists.txt index 2afe258693778..3dbdbb9223703 100644 --- a/recipes/userspace-rcu/all/test_package/CMakeLists.txt +++ b/recipes/userspace-rcu/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.15) -project(test_package) +project(test_package LANGUAGES C) find_package(userspace-rcu COMPONENTS urcu REQUIRED) diff --git a/recipes/userspace-rcu/all/test_package/conanfile.py b/recipes/userspace-rcu/all/test_package/conanfile.py index 78d6ce7aad715..28dc52eddfee5 100644 --- a/recipes/userspace-rcu/all/test_package/conanfile.py +++ b/recipes/userspace-rcu/all/test_package/conanfile.py @@ -1,15 +1,23 @@ +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 -from conan.tools.build import cross_building class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -17,6 +25,7 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): + if can_run(self): for test in ["", "-mb", "-signal"]: - self.run("test_package{}".format(test), run_environment=True) + bin_path = os.path.join(self.cpp.build.bindir, f"test_package{test}") + self.run(bin_path, env="conanrun") diff --git a/recipes/userspace-rcu/all/test_v1_package/CMakeLists.txt b/recipes/userspace-rcu/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/userspace-rcu/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/userspace-rcu/all/test_v1_package/conanfile.py b/recipes/userspace-rcu/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..a8ac0984771ba --- /dev/null +++ b/recipes/userspace-rcu/all/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +import os + +from conans import ConanFile, CMake +from conan.tools.build import cross_building + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + for test in ["", "-mb", "-signal"]: + bin_path = os.path.join("bin", f"test_package{test}") + self.run(bin_path, run_environment=True) diff --git a/recipes/userspace-rcu/config.yml b/recipes/userspace-rcu/config.yml index 813707cc5417d..8246204055b2f 100644 --- a/recipes/userspace-rcu/config.yml +++ b/recipes/userspace-rcu/config.yml @@ -1,3 +1,5 @@ versions: + "0.14.0": + folder: all "0.11.4": folder: all diff --git a/recipes/uvw/all/conandata.yml b/recipes/uvw/all/conandata.yml index f88dde6763845..9e2f0333781b4 100644 --- a/recipes/uvw/all/conandata.yml +++ b/recipes/uvw/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.4.0": + url: "https://github.com/skypjack/uvw/archive/v3.4.0_libuv_v1.48.tar.gz" + sha256: "c16600573871a5feeb524234b378ab832c8971b2a68d030c6bd0e3077d416ade" "3.3.0": url: "https://github.com/skypjack/uvw/archive/v3.3.0_libuv_v1.47.tar.gz" sha256: "aabb17d3d8f0b3481b44e981c889dd4a2a6a3f1a96a4d01055e669f4b7d37d0e" @@ -17,3 +20,11 @@ sources: "2.10.0": url: "https://github.com/skypjack/uvw/archive/v2.10.0_libuv_v1.42.tar.gz" sha256: "30b0ba97a94d5e652490c6b1b32c95e608263f21cf3bc606308d09b3e3a114bf" +libuv_version_mapping: + "3.4.0": "1.48.0" + "3.3.0": "1.47.0" + "3.2.0": "1.46.0" + "3.1.0": "1.45.0" + "2.12.1": "1.44.2" + "2.11.0": "1.43.0" + "2.10.0": "1.42.0" diff --git a/recipes/uvw/all/conanfile.py b/recipes/uvw/all/conanfile.py index fc221de9ee0df..b1ed6df28cbd3 100644 --- a/recipes/uvw/all/conanfile.py +++ b/recipes/uvw/all/conanfile.py @@ -37,14 +37,7 @@ def _compilers_minimum_version(self): @property def _required_libuv_version(self): - return { - "3.3.0": "1.47.0", - "3.2.0": "1.46.0", - "3.1.0": "1.45.0", - "2.12.1": "1.44.2", - "2.11.0": "1.43.0", - "2.10.0": "1.42.0", - }[self.version] + return self.conan_data["libuv_version_mapping"][self.version] def layout(self): basic_layout(self, src_folder="src") diff --git a/recipes/uvw/config.yml b/recipes/uvw/config.yml index 7b4a0bac4b71c..652dbe6c9d518 100644 --- a/recipes/uvw/config.yml +++ b/recipes/uvw/config.yml @@ -1,4 +1,6 @@ versions: + "3.4.0": + folder: "all" "3.3.0": folder: "all" "3.2.0": diff --git a/recipes/uwebsockets/all/conandata.yml b/recipes/uwebsockets/all/conandata.yml index 85952f5a23966..8013b9756dcc5 100644 --- a/recipes/uwebsockets/all/conandata.yml +++ b/recipes/uwebsockets/all/conandata.yml @@ -1,4 +1,11 @@ sources: + "20.64.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.64.0.tar.gz" + sha256: "bb81fa773dcbd6bc738904ad496554fd131a33269570e0e86fa09213d82ba9ef" + "20.63.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.63.0.tar.gz" + sha256: "3bcb3fab4242d312e227b05f34e21d8468960e5eea59e12799aa21a94f1b2b1f" + # keep 20.62.0, the last version to provide C-API "20.62.0": url: "https://github.com/uNetworking/uWebSockets/archive/v20.62.0.tar.gz" sha256: "03dfc8037cf43856a41e64bbc7fc5a7cf5e6369c9158682753074ecbbe09eed1" diff --git a/recipes/uwebsockets/config.yml b/recipes/uwebsockets/config.yml index c2e19d13ebc2e..421b89636665b 100644 --- a/recipes/uwebsockets/config.yml +++ b/recipes/uwebsockets/config.yml @@ -1,4 +1,8 @@ versions: + "20.64.0": + folder: all + "20.63.0": + folder: all "20.62.0": folder: all "20.60.0": diff --git a/recipes/vigra/all/conandata.yml b/recipes/vigra/all/conandata.yml new file mode 100644 index 0000000000000..1d74fa25b7f22 --- /dev/null +++ b/recipes/vigra/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.11.2": + url: "https://github.com/ukoethe/vigra/archive/refs/tags/Version-1-11-2.tar.gz" + sha256: "4841936f5c3c137611ec782e293d961df29d3b5b70ade8cb711374de0f4cb5d3" +patches: + "1.11.2": + - patch_file: "patches/1.11.2-001-disable_doc_build.patch" + patch_description: "enable build to proceed when documentation is disabled" + patch_type: "conan" diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py new file mode 100644 index 0000000000000..0ac9a204a6384 --- /dev/null +++ b/recipes/vigra/all/conanfile.py @@ -0,0 +1,123 @@ +import os +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeDeps, CMakeToolchain, CMake, cmake_layout +from conan.tools.files import get, export_conandata_patches, apply_conandata_patches, rm, copy, replace_in_file + + +class VigraConan(ConanFile): + name = "vigra" + description = "A generic C++ library for image analysis" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://ukoethe.github.io/vigra/" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + topics = "image-processing", "computer-vision" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_hdf5": [True, False], + "with_openexr": [True, False], + "with_boost_graph": [True, False], + "with_lemon": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + "with_hdf5": True, + "with_openexr": True, + "with_boost_graph": True, + "with_lemon": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + apply_conandata_patches(self) + replace_in_file( + self, + os.path.join(self.source_folder, "src", "impex", "CMakeLists.txt"), + 'SOVERSION ${SOVERSION} INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}"', + 'SOVERSION ${SOVERSION} INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" INSTALL_NAME_DIR "@rpath"' + ) + + def layout(self): + cmake_layout(self, src_folder="src") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def requirements(self): + self.requires("libtiff/4.6.0") + self.requires("libpng/[>=1.6 <2]") + self.requires("fftw/3.3.10") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("libjpeg/9e") + + if self.options.with_hdf5: + self.requires("hdf5/1.14.3") + + if self.options.with_openexr: + self.requires("openexr/3.2.4") + self.requires("imath/3.1.9") + + if self.options.with_boost_graph: + self.requires("boost/1.85.0") + + if self.options.with_lemon: + self.requires("coin-lemon/1.3.1") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["WITH_VIGRANUMPY"] = False + tc.cache_variables["BUILD_DOCS"] = False + tc.cache_variables["BUILD_TESTS"] = False + + tc.cache_variables["WITH_OPENEXR"] = self.options.with_openexr + tc.cache_variables["WITH_BOOST_GRAPH"] = self.options.with_boost_graph + tc.cache_variables["WITH_LEMON"] = self.options.with_lemon + + tc.cache_variables["VIGRA_STATIC_LIB"] = not self.options.shared + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + cm = CMake(self) + cm.install() + rm(self, "*.cmake", self.package_folder, recursive=True) + #fix_apple_shared_install_name(self) + + def package_info(self): + if not self.options.shared: + self.cpp_info.defines = ["VIGRA_STATIC_LIB"] + + self.cpp_info.libs = ["vigraimpex"] + self.cpp_info.set_property("cmake_file_name", "Vigra") + self.cpp_info.set_property("cmake_target_name", "vigraimpex") + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("shlwapi") diff --git a/recipes/vigra/all/patches/1.11.2-001-disable_doc_build.patch b/recipes/vigra/all/patches/1.11.2-001-disable_doc_build.patch new file mode 100644 index 0000000000000..322479285c3dd --- /dev/null +++ b/recipes/vigra/all/patches/1.11.2-001-disable_doc_build.patch @@ -0,0 +1,13 @@ +Index: CMakeLists.txt +=================================================================== +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -341,7 +341,7 @@ add_custom_target(PACKAGE_SRC_TAR + COMMENT "Creating ${PROJECT_BINARY_DIR}/vigra-${vigra_version}-src.tar.gz") + + ADD_DEPENDENCIES(PACKAGE_SRC_TAR check) +-ADD_DEPENDENCIES(PACKAGE_SRC_TAR doc_cpp) ++#ADD_DEPENDENCIES(PACKAGE_SRC_TAR doc_cpp) + IF(WITH_VIGRANUMPY AND PYTHON_SPHINX) + ADD_DEPENDENCIES(PACKAGE_SRC_TAR doc_python) + ENDIF() diff --git a/recipes/vigra/all/test_package/CMakeLists.txt b/recipes/vigra/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8063e47f90875 --- /dev/null +++ b/recipes/vigra/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Vigra REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vigraimpex) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vigra/all/test_package/conanfile.py b/recipes/vigra/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4385dcaa88926 --- /dev/null +++ b/recipes/vigra/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" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cm = CMake(self) + cm.configure() + cm.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/vigra/all/test_package/test_package.cpp b/recipes/vigra/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..84b2dc0869089 --- /dev/null +++ b/recipes/vigra/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +using std::cout; +using std::endl; + +using namespace vigra; + +int main() +{ + cout << "creating a fixed size vigra array.." << endl; + + vigra::TinyVector arr = {1.1, 2.2, 3.3, 4.4, 5.5}; + + cout << "formats supported: " << endl; + cout << impexListFormats() << endl; +} diff --git a/recipes/vigra/config.yml b/recipes/vigra/config.yml new file mode 100644 index 0000000000000..68804c58d126a --- /dev/null +++ b/recipes/vigra/config.yml @@ -0,0 +1,3 @@ +versions: + "1.11.2": + folder: all diff --git a/recipes/vincentlaucsb-csv-parser/all/conandata.yml b/recipes/vincentlaucsb-csv-parser/all/conandata.yml index b2ca51139b4f8..ec36bbdac4426 100644 --- a/recipes/vincentlaucsb-csv-parser/all/conandata.yml +++ b/recipes/vincentlaucsb-csv-parser/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "2.3.0": + url: "https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/2.3.0.tar.gz" + sha256: "27b8ac51aa58b9a4debd8ccfb44738c8583a2e874da42f56bbdf3764b75f3af5" + "2.2.3": + url: "https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/2.2.3.tar.gz" + sha256: "e70ea75612fb45f9a9dd83145fb3fbf0b5929a32683de478ad429cdd85f10e4e" + "2.2.2": + url: "https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/2.2.2.tar.gz" + sha256: "8d7720021d19cf03880eb768d82d7f7e0a240b6d564bc6b495fceb4775b8f0c7" + "2.2.0": + url: "https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/2.2.0.tar.gz" + sha256: "027fd894c5e6a59f5afcedd6cc071364611df5f35fcc6fc4a8e193712b2f1e73" "2.1.3": url: "https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/2.1.3.tar.gz" - sha256: 3f6ce9212e66d273de12a9671dcbf7be7da0241334dc690585dd434dce5e5acf + sha256: "3f6ce9212e66d273de12a9671dcbf7be7da0241334dc690585dd434dce5e5acf" diff --git a/recipes/vincentlaucsb-csv-parser/all/conanfile.py b/recipes/vincentlaucsb-csv-parser/all/conanfile.py index eb5f85b4e4c16..02f230bb6cf6b 100644 --- a/recipes/vincentlaucsb-csv-parser/all/conanfile.py +++ b/recipes/vincentlaucsb-csv-parser/all/conanfile.py @@ -5,6 +5,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.files import copy, get from conan.tools.scm import Version +from conan.tools.layout import basic_layout required_conan_version = ">=1.52.0" @@ -12,26 +13,44 @@ class VincentlaucsbCsvParserConan(ConanFile): name = "vincentlaucsb-csv-parser" description = "Vince's CSV Parser with simple and intuitive syntax" - topics = ("conan", "csv-parser", "csv", "rfc 4180", "parser", "generator") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/vincentlaucsb/csv-parser" - license = "MIT" - settings = "os", "compiler" + topics = ("csv", "rfc 4180", "parser", "generator", "header-only") package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def validate(self): - # C++17 recommended: https://github.com/vincentlaucsb/csv-parser/blob/2.1.3/README.md - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 14) - compiler = self.settings.compiler - compiler_version = Version(self.settings.compiler.version) - if compiler == "gcc" and compiler_version < "7": - raise ConanInvalidConfiguration("gcc version < 7 not supported") + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } + + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): self.info.clear() + def validate(self): + # C++17 recommended: https://github.com/vincentlaucsb/csv-parser/blob/2.1.3/README.md + 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) diff --git a/recipes/vincentlaucsb-csv-parser/config.yml b/recipes/vincentlaucsb-csv-parser/config.yml index e6ceade928280..0aa8e836c3b2f 100644 --- a/recipes/vincentlaucsb-csv-parser/config.yml +++ b/recipes/vincentlaucsb-csv-parser/config.yml @@ -1,3 +1,11 @@ versions: + "2.3.0": + folder: all + "2.2.3": + folder: all + "2.2.2": + folder: all + "2.2.0": + folder: all "2.1.3": folder: all diff --git a/recipes/vorbis/all/test_package/8kadpcm.wav b/recipes/vorbis/all/test_package/8kadpcm.wav deleted file mode 100644 index 40a362222bc7a..0000000000000 Binary files a/recipes/vorbis/all/test_package/8kadpcm.wav and /dev/null differ diff --git a/recipes/vorbis/all/test_package/conanfile.py b/recipes/vorbis/all/test_package/conanfile.py index 327c8dd400306..3a8c6c5442b33 100644 --- a/recipes/vorbis/all/test_package/conanfile.py +++ b/recipes/vorbis/all/test_package/conanfile.py @@ -22,6 +22,4 @@ def build(self): def test(self): if not cross_building(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - in_wav_path = os.path.join(self.source_folder, "8kadpcm.wav") - out_ogg_path = os.path.join(self.cpp.build.bindirs[0], "sample.ogg") - self.run(f"{bin_path} < {in_wav_path} > {out_ogg_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/vorbis/all/test_package/test_package.c b/recipes/vorbis/all/test_package/test_package.c index d8d92bc3cbff7..794aa0d6e61b5 100644 --- a/recipes/vorbis/all/test_package/test_package.c +++ b/recipes/vorbis/all/test_package/test_package.c @@ -1,252 +1,7 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * - * by the Xiph.Org Foundation http://www.xiph.org/ * - * * - ******************************************************************** - - function: simple example encoder - last mod: $Id$ - - ********************************************************************/ - -/* takes a stereo 16bit 44.1kHz WAV file from stdin and encodes it into - a Vorbis bitstream */ - -/* Note that this is POSIX, not ANSI, code */ - #include -#include -#include -#include -#include #include -#ifdef _WIN32 /* We need the following two to set stdin/stdout to binary */ -#include -#include -#endif - -#if defined(__MACOS__) && defined(__MWERKS__) -#include /* CodeWarrior's Mac "command-line" support */ -#endif - -#define READ 1024 -signed char readbuffer[READ*4+44]; /* out of the data segment, not the stack */ - int main(){ - ogg_stream_state os; /* take physical pages, weld into a logical - stream of packets */ - ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */ - ogg_packet op; /* one raw packet of data for decode */ - - vorbis_info vi; /* struct that stores all the static vorbis bitstream - settings */ - vorbis_comment vc; /* struct that stores all the user comments */ - - vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ - vorbis_block vb; /* local working space for packet->PCM decode */ - - int eos=0,ret; - int i, founddata; - -#if defined(macintosh) && defined(__MWERKS__) - int argc = 0; - char **argv = NULL; - argc = ccommand(&argv); /* get a "command line" from the Mac user */ - /* this also lets the user set stdin and stdout */ -#endif - - /* we cheat on the WAV header; we just bypass 44 bytes (simplest WAV - header is 44 bytes) and assume that the data is 44.1khz, stereo, 16 bit - little endian pcm samples. This is just an example, after all. */ - -#ifdef _WIN32 /* We need to set stdin/stdout to binary mode. Damn windows. */ - /* if we were reading/writing a file, it would also need to in - binary mode, eg, fopen("file.wav","wb"); */ - /* Beware the evil ifdef. We avoid these where we can, but this one we - cannot. Don't add any more, you'll probably go to hell if you do. */ - _setmode( _fileno( stdin ), _O_BINARY ); - _setmode( _fileno( stdout ), _O_BINARY ); -#endif - - - /* we cheat on the WAV header; we just bypass the header and never - verify that it matches 16bit/stereo/44.1kHz. This is just an - example, after all. */ - - readbuffer[0] = '\0'; - for (i=0, founddata=0; i<30 && ! feof(stdin) && ! ferror(stdin); i++) - { - fread(readbuffer,1,2,stdin); - - if ( ! strncmp((char*)readbuffer, "da", 2) ){ - founddata = 1; - fread(readbuffer,1,6,stdin); - break; - } - } - - /********** Encode setup ************/ - - vorbis_info_init(&vi); - - /* choose an encoding mode. A few possibilities commented out, one - actually used: */ - - /********************************************************************* - Encoding using a VBR quality mode. The usable range is -.1 - (lowest quality, smallest file) to 1. (highest quality, largest file). - Example quality mode .4: 44kHz stereo coupled, roughly 128kbps VBR - - ret = vorbis_encode_init_vbr(&vi,2,44100,.4); - - --------------------------------------------------------------------- - - Encoding using an average bitrate mode (ABR). - example: 44kHz stereo coupled, average 128kbps VBR - - ret = vorbis_encode_init(&vi,2,44100,-1,128000,-1); - - --------------------------------------------------------------------- - - Encode using a quality mode, but select that quality mode by asking for - an approximate bitrate. This is not ABR, it is true VBR, but selected - using the bitrate interface, and then turning bitrate management off: - - ret = ( vorbis_encode_setup_managed(&vi,2,44100,-1,128000,-1) || - vorbis_encode_ctl(&vi,OV_ECTL_RATEMANAGE2_SET,NULL) || - vorbis_encode_setup_init(&vi)); - - *********************************************************************/ - - ret=vorbis_encode_init_vbr(&vi,2,44100,0.1); - - /* do not continue if setup failed; this can happen if we ask for a - mode that libVorbis does not support (eg, too low a bitrate, etc, - will return 'OV_EIMPL') */ - - if(ret)exit(1); - - /* add a comment */ + vorbis_comment vc; vorbis_comment_init(&vc); - vorbis_comment_add_tag(&vc,"ENCODER","encoder_example.c"); - - /* set up the analysis state and auxiliary encoding storage */ - vorbis_analysis_init(&vd,&vi); - vorbis_block_init(&vd,&vb); - - /* set up our packet->stream encoder */ - /* pick a random serial number; that way we can more likely build - chained streams just by concatenation */ - srand(time(NULL)); - ogg_stream_init(&os,rand()); - - /* Vorbis streams begin with three headers; the initial header (with - most of the codec setup parameters) which is mandated by the Ogg - bitstream spec. The second header holds any comment fields. The - third header holds the bitstream codebook. We merely need to - make the headers, then pass them to libvorbis one at a time; - libvorbis handles the additional Ogg bitstream constraints */ - - { - ogg_packet header; - ogg_packet header_comm; - ogg_packet header_code; - - vorbis_analysis_headerout(&vd,&vc,&header,&header_comm,&header_code); - ogg_stream_packetin(&os,&header); /* automatically placed in its own - page */ - ogg_stream_packetin(&os,&header_comm); - ogg_stream_packetin(&os,&header_code); - - /* This ensures the actual - * audio data will start on a new page, as per spec - */ - while(!eos){ - int result=ogg_stream_flush(&os,&og); - if(result==0)break; - fwrite(og.header,1,og.header_len,stdout); - fwrite(og.body,1,og.body_len,stdout); - } - - } - - while(!eos){ - long i; - long bytes=fread(readbuffer,1,READ*4,stdin); /* stereo hardwired here */ - - if(bytes==0){ - /* end of file. this can be done implicitly in the mainline, - but it's easier to see here in non-clever fashion. - Tell the library we're at end of stream so that it can handle - the last frame and mark end of stream in the output properly */ - vorbis_analysis_wrote(&vd,0); - - }else{ - /* data to encode */ - - /* expose the buffer to submit data */ - float **buffer=vorbis_analysis_buffer(&vd,READ); - - /* uninterleave samples */ - for(i=0;i {out_ogg_path}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/vvenc/all/conandata.yml b/recipes/vvenc/all/conandata.yml index a3832678cf3e2..96a4c747a1a95 100644 --- a/recipes/vvenc/all/conandata.yml +++ b/recipes/vvenc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.11.1": + url: "https://github.com/fraunhoferhhi/vvenc/archive/refs/tags/v1.11.1.tar.gz" + sha256: "4f0c8ac3f03eb970bee7a0cacc57a886ac511d58f081bb08ba4bce6f547d92fa" "1.10.0": url: "https://github.com/fraunhoferhhi/vvenc/archive/refs/tags/v1.10.0.tar.gz" sha256: "579e4b19de3b356a96ec436dbfeb3b9583cb0a854e55f81226990924a5cfd38c" diff --git a/recipes/vvenc/all/conanfile.py b/recipes/vvenc/all/conanfile.py index 50d169ed09a7f..ebfcf9dec9aca 100644 --- a/recipes/vvenc/all/conanfile.py +++ b/recipes/vvenc/all/conanfile.py @@ -14,16 +14,21 @@ class vvencRecipe(ConanFile): name = "vvenc" + description = "Fraunhofer Versatile Video Encoder (VVenC)" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" - description = "Fraunhofer Versatile Video Encoder (VVenC)" - topics = ("video", "encoder", "codec", "vvc", "h266") homepage = "https://www.hhi.fraunhofer.de/en/departments/vca/technologies-and-solutions/h266-vvc.html" + topics = ("video", "encoder", "codec", "vvc", "h266") package_type = "library" - - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def validate_build(self): if conan_version.major == 2: @@ -59,6 +64,17 @@ def _validate_build2(self): check_max_cppstd = getattr(sys.modules['conan.tools.build'], 'check_max_cppstd') check_max_cppstd(self, 14) + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + + def configure(self): + if self.options.shared: + self.options.rm_safe('fPIC') + + def layout(self): + cmake_layout(self, src_folder='src') + def package_id(self): # still important, older binutils cannot recognize # object files created with newer binutils, @@ -73,17 +89,6 @@ def package_id(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def config_options(self): - if self.settings.os == "Windows": - self.options.rm_safe("fPIC") - - def configure(self): - if self.options.shared: - self.options.rm_safe('fPIC') - - def layout(self): - cmake_layout(self, src_folder='src') - def generate(self): deps = CMakeDeps(self) deps.generate() diff --git a/recipes/vvenc/all/test_package/CMakeLists.txt b/recipes/vvenc/all/test_package/CMakeLists.txt index efaabb8094acb..c201147dc181d 100644 --- a/recipes/vvenc/all/test_package/CMakeLists.txt +++ b/recipes/vvenc/all/test_package/CMakeLists.txt @@ -1,9 +1,7 @@ cmake_minimum_required(VERSION 3.15) -project(PackageTest C) +project(test_package LANGUAGES C) find_package(vvenc CONFIG REQUIRED) - - -add_executable(example src/example.c) -target_link_libraries(example vvenc::vvenc) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE vvenc::vvenc) diff --git a/recipes/vvenc/all/test_package/conanfile.py b/recipes/vvenc/all/test_package/conanfile.py index 0f4e9c14439cf..2f7db800db937 100644 --- a/recipes/vvenc/all/test_package/conanfile.py +++ b/recipes/vvenc/all/test_package/conanfile.py @@ -8,6 +8,7 @@ class vvencTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", 'VirtualRunEnv', "CMakeToolchain" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) @@ -22,5 +23,5 @@ def layout(self): def test(self): if can_run(self): - cmd = os.path.join(self.cpp.build.bindir, "example") + cmd = os.path.join(self.cpp.build.bindir, "test_package") self.run(cmd, env="conanrun") diff --git a/recipes/vvenc/all/test_package/src/example.c b/recipes/vvenc/all/test_package/test_package.c similarity index 100% rename from recipes/vvenc/all/test_package/src/example.c rename to recipes/vvenc/all/test_package/test_package.c diff --git a/recipes/vvenc/config.yml b/recipes/vvenc/config.yml index f88ad156fc791..7674f2d958229 100644 --- a/recipes/vvenc/config.yml +++ b/recipes/vvenc/config.yml @@ -1,4 +1,6 @@ versions: + "1.11.1": + folder: "all" "1.10.0": folder: "all" "1.8.0": diff --git a/recipes/wasmedge/all/conandata.yml b/recipes/wasmedge/all/conandata.yml index b7eef0f907d2e..d88f2037f15aa 100644 --- a/recipes/wasmedge/all/conandata.yml +++ b/recipes/wasmedge/all/conandata.yml @@ -1,4 +1,45 @@ sources: + "0.14.0": + Windows: + "x86_64": + Visual Studio: + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-windows.zip" + sha256: "cd0dd57df8f3e8cb7ef0e57d2d09f1740093c2179fad933b270979bafe8295a1" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Linux: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-manylinux2014_x86_64.tar.gz" + sha256: "73b3892f94c143dc09d53415c6848bb8e87206a1f614fd0edfc89957a0f1b027" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-manylinux2014_aarch64.tar.gz" + sha256: "6136c42066cdd9a96170285af2613dc00f262f5758a03d7afb3ab12a36363c79" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.11.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Macos: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-darwin_x86_64.tar.gz" + sha256: "03c5d77be63ecad54ed33a1885f170bc854246ed8f9ae8e366b114bc8c0c2422" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-darwin_arm64.tar.gz" + sha256: "4f2f34545a97768e28700099ac9cbb18e7b434779d237de860324de400922546" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Android: + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-android_aarch64.tar.gz" + sha256: "58b834db8814b27051494df60588dc56f3a5d740604e92c1eac9e5021b311c03" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" "0.13.5": Windows: "x86_64": diff --git a/recipes/wasmedge/config.yml b/recipes/wasmedge/config.yml index 13b6ff12faa84..4d4208e046a5e 100644 --- a/recipes/wasmedge/config.yml +++ b/recipes/wasmedge/config.yml @@ -1,4 +1,6 @@ versions: + "0.14.0": + folder: "all" "0.13.5": folder: "all" "0.11.2": diff --git a/recipes/wasmer/all/conandata.yml b/recipes/wasmer/all/conandata.yml index 17a89f2c17e7b..8cdd0665cc1d3 100644 --- a/recipes/wasmer/all/conandata.yml +++ b/recipes/wasmer/all/conandata.yml @@ -1,4 +1,97 @@ sources: + "4.3.3": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-windows-amd64.tar.gz" + sha256: "63239253e7dc5373a421941aaa9ac8ee2ddb2f34e3d94b12ea739319d7929bd4" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-windows-gnu64.tar.gz" + sha256: "6180ddaed4b758ddc563be493001204f067667406994b4a05bfeb8f7948d9898" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-linux-amd64.tar.gz" + sha256: "817ce5b0ba0a97989fe390b16e76352632a3185ebd0ef3e5bfbaf0dbda73cd13" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-linux-aarch64.tar.gz" + sha256: "d15b8170911b1dca69923844bd31f2ea8a73d6ac9ebe7de0d5a30f0cab4cc1b4" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-linux-riscv64.tar.gz" + sha256: "b0ddc5ed34506f2c2674d3d09996b4c3da500644bc65880e8eede0a149dfaeae" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-darwin-amd64.tar.gz" + sha256: "cf49f6d421b0e8f00f3c4e96ac3ed1ee674b64e0e28f503ff46938cbf831c303" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-darwin-arm64.tar.gz" + sha256: "4b6bc3fc10e22c5347e240df6be7d2ac8db4c930768d7ed7a3d99b086cad4ba0" + "4.3.0": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-windows-amd64.tar.gz" + sha256: "dc58db29591c3088da053336ddf52ab3f5c870daa0a6901e045a7f1a78b3358e" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-windows-gnu64.tar.gz" + sha256: "8d903af970293ab7987df71f31651e8a59911299c47c8062314dda28f8562556" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-linux-amd64.tar.gz" + sha256: "664c0fd253e86e88afd3977c5a09a1d8162b1e80ce1421da92a310fccfc14243" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-linux-aarch64.tar.gz" + sha256: "e4693e54e40c44957de78328b7711d2822a7e30c88119a68b1a2bd99fdd0a599" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-linux-riscv64.tar.gz" + sha256: "d4ba4ce197f7dbb8e900e6f515143c73934a91feec556bd2f928ba872ddd60b2" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-darwin-amd64.tar.gz" + sha256: "7e58b848649ceba2f4d2d65ea34c72bf02f463327efc1549f027feb344525c69" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-darwin-arm64.tar.gz" + sha256: "ddf4079e3e0432bb1c856720cef8266494cfae2f3b294dbaf18c9853d32fbc1f" + "4.2.7": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-windows-amd64.tar.gz" + sha256: "5e429450a997e9a23b4efb7ad1bfb57a8c4a77436ce2a0c7c160c26576a42562" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-windows-gnu64.tar.gz" + sha256: "82061836fe79e2d52710ebb48fdffbd82910663ac1bae5bb13e72e6e1a7f0a46" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-linux-amd64.tar.gz" + sha256: "7fb9c34c42d31cd7ffed956d0e98d620b5fde0c5fccf9af5e58b9177664e25b1" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-linux-aarch64.tar.gz" + sha256: "5915f617f966cdedd0fe18f26237ef04701c6475c34e5b1cd2ffc0f6e84ffd3a" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-linux-riscv64.tar.gz" + sha256: "bdb480c30ef07640edb63b59b84a5508e802571d8eab74d7a40ff1164e8b7151" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-darwin-amd64.tar.gz" + sha256: "29748cdf51ecd11d10cc819bc568820e6267d658d495f08f4af7b90cf3bd0a35" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-darwin-arm64.tar.gz" + sha256: "65de621cd931acee76e09505bda28d71b6d955a6b33481ae1251280f0f26ebfc" "4.2.5": Windows: "x86_64": @@ -17,6 +110,10 @@ sources: "gcc": url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.5/wasmer-linux-aarch64.tar.gz" sha256: "b29117eebce282b63d49de6bb11920da439d68937bd6bc69575fb8f5f29ef293" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.5/wasmer-linux-riscv64.tar.gz" + sha256: "d2002afdce6ecdcd0e31efb47b50a8c195a12ab6b5127520870ece3a1338e889" Macos: "x86_64": "gcc": @@ -44,6 +141,10 @@ sources: "gcc": url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.0/wasmer-linux-aarch64.tar.gz" sha256: "681fe6ad3e7f139d3d2ed8cfbf6ceb4d54098c32da9663bbf849e6429d6e8f1c" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.0/wasmer-linux-riscv64.tar.gz" + sha256: "3b2dd3172ffd0084367a07565259d76c99099f3c1b8467c5d7c2a6d5d158de64" Macos: "x86_64": "gcc": @@ -71,6 +172,10 @@ sources: "gcc": url: "https://github.com/wasmerio/wasmer/releases/download/v4.1.1/wasmer-linux-aarch64.tar.gz" sha256: "74cc40fcfe4108c0240137a47704d4f6ade8895c70da25358b471fe32ce47a50" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.1.1/wasmer-linux-riscv64.tar.gz" + sha256: "2ee1ee5759133802771018fccd1a4b39a36a1b7ed2bf0e6f38e83266ba5c8bdb" Macos: "x86_64": "gcc": @@ -98,6 +203,10 @@ sources: "gcc": url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-linux-aarch64.tar.gz" sha256: "20f98f4be160e73e387444437f87aeaa276b46c1efee12729ab1108ebeda1d16" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-linux-riscv64.tar.gz" + sha256: "87ca77de67bd60a8ddc4c9fa9d9aaa647961826564051a40169cb0dddc2362ad" Macos: "x86_64": "gcc": @@ -125,6 +234,10 @@ sources: "gcc": url: "https://github.com/wasmerio/wasmer/releases/download/v3.2.1/wasmer-linux-aarch64.tar.gz" sha256: "f1847405588339b4327ef9d68c266355b04d3d18d6fc2c9fdfb2c9f576f4d758" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.2.1/wasmer-linux-riscv64.tar.gz" + sha256: "0408442c1da0d3bf1f83014adfe58d24a9ab5d3268db5a8a2dc05026f3a0650c" Macos: "x86_64": "gcc": diff --git a/recipes/wasmer/all/conanfile.py b/recipes/wasmer/all/conanfile.py index 402e36fdcca0f..06ec3aa8052ea 100644 --- a/recipes/wasmer/all/conanfile.py +++ b/recipes/wasmer/all/conanfile.py @@ -60,18 +60,18 @@ def package_id(self): del self.info.settings.compiler.version self.info.settings.compiler = self._compiler_alias - def source(self): + def build(self): get( self, - **self.conan_data["sources"][self.version][str(self.info.settings.os)][str(self.info.settings.arch)][self._compiler_alias] + **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias] ) def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.build_folder) - copy(self, pattern="*.h", 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"), src=os.path.join(self.build_folder, "include")) - srclibdir = os.path.join(self.source_folder, "lib") + srclibdir = os.path.join(self.build_folder, "lib") dstlibdir = os.path.join(self.package_folder, "lib") dstbindir = os.path.join(self.package_folder, "bin") if self.options.shared: diff --git a/recipes/wasmer/config.yml b/recipes/wasmer/config.yml index 4c7ede684889d..faad7585c3845 100644 --- a/recipes/wasmer/config.yml +++ b/recipes/wasmer/config.yml @@ -1,4 +1,10 @@ versions: + "4.3.3": + folder: "all" + "4.3.0": + folder: "all" + "4.2.7": + folder: "all" "4.2.5": folder: "all" "4.2.0": diff --git a/recipes/wasmtime-cpp/all/conandata.yml b/recipes/wasmtime-cpp/all/conandata.yml index 524a7021c9bc2..35283cdf993b9 100644 --- a/recipes/wasmtime-cpp/all/conandata.yml +++ b/recipes/wasmtime-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "18.0.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/v18.0.0.tar.gz" + sha256: "94478a9465c6f766ebd7999438a89392dcb30f9fe10f772c8669dcd0b7ffbf86" "9.0.0": url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/v9.0.0.tar.gz" sha256: "0ff8242a9dcbe43eb38c6a3e02be40ed585e6b88efd89092bf1b5318cb8fece1" diff --git a/recipes/wasmtime-cpp/all/conanfile.py b/recipes/wasmtime-cpp/all/conanfile.py index 9970e18861d77..9e61f74387ac9 100644 --- a/recipes/wasmtime-cpp/all/conanfile.py +++ b/recipes/wasmtime-cpp/all/conanfile.py @@ -44,6 +44,7 @@ def requirements(self): "1.0.0": "1.0.1", "6.0.0": "6.0.1", "9.0.0": "12.0.2", + "18.0.0": "18.0.3", } self.requires(f"wasmtime/{version_map.get(version, version)}") diff --git a/recipes/wasmtime-cpp/config.yml b/recipes/wasmtime-cpp/config.yml index 37168a28be705..49006a3577c70 100644 --- a/recipes/wasmtime-cpp/config.yml +++ b/recipes/wasmtime-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "18.0.0": + folder: all "9.0.0": folder: all "7.0.0": diff --git a/recipes/wasmtime/all/conandata.yml b/recipes/wasmtime/all/conandata.yml index 033b48ec7ab2e..f552bb5d07af3 100644 --- a/recipes/wasmtime/all/conandata.yml +++ b/recipes/wasmtime/all/conandata.yml @@ -1,4 +1,94 @@ sources: + "21.0.0": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-x86_64-windows-c-api.zip" + sha256: "aee0fb2d792f93d16cc3ae2857a384c1f3b105374dfdecb6ab3f3b2823e6acaf" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-x86_64-mingw-c-api.zip" + sha256: "d4253540cc201c12d356a0806786ea518577c486d66d83a0144b4227d559c507" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-x86_64-linux-c-api.tar.xz" + sha256: "e91b15f242454ab916dd895d326f6c2585a1f93f0df5aeb079e6f0511c90b37d" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-aarch64-linux-c-api.tar.xz" + sha256: "b3e77e3eab5c0c4c3085364701bdb5cdd05e5ac4e3308d40263b06ac67bae610" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-s390x-linux-c-api.tar.xz" + sha256: "dad2b4c43aaaa6734ac0d2825767759338b0273c46500b46ac071ddc7e853bec" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-x86_64-macos-c-api.tar.xz" + sha256: "f99c5682ce85f353645b2b642a90104d43f77eafe8a90faa2ecd9421c4d48d2f" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-aarch64-macos-c-api.tar.xz" + sha256: "0414332f1d6c90e6226102a27e8b8767eba845f34f4c8cabab575b094a0500f1" + Android: + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-aarch64-linux-c-api.tar.xz" + sha256: "b3e77e3eab5c0c4c3085364701bdb5cdd05e5ac4e3308d40263b06ac67bae610" + "20.0.1": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-x86_64-windows-c-api.zip" + sha256: "d9a8cfefe8684d7170b67ade0fda6da4ad21508909680a64eebe083b93aabc70" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-x86_64-mingw-c-api.zip" + sha256: "164ecbbe632d1368020bccf442a81b20ec1cb57f0d0cdfaccf92ed74bd2311e8" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-x86_64-linux-c-api.tar.xz" + sha256: "ba2e7ce72a50b0a472888249aecfb27aac841e5dfc72c845175fbeeaaf6862d4" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-aarch64-linux-c-api.tar.xz" + sha256: "e5f383012c4cacbe5ab78dba334fa77793e109c0da5840a8c00cb63633043bee" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-s390x-linux-c-api.tar.xz" + sha256: "f331a0fee2856f42136aaf9fbdc413abae397070f7b688d4b8c4885ec04292ff" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-x86_64-macos-c-api.tar.xz" + sha256: "a4031456c2c1e406395457bd7f452e9e71e8e024b727cf47ebb4da996f9a0c51" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-aarch64-macos-c-api.tar.xz" + sha256: "4bce467752f64dc4632b7ccad52b7e2ea134ad02a23e6b540b39a11c8c4fa579" + Android: + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-aarch64-linux-c-api.tar.xz" + sha256: "e5f383012c4cacbe5ab78dba334fa77793e109c0da5840a8c00cb63633043bee" + "19.0.2": + Windows: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-windows-c-api.zip" + sha256: "9814038a400680a322f8c287ccba68fc0c5ffccede31f9ed444e945bdeec5c70" + MinGW: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-mingw-c-api.zip" + sha256: "0a1c37ec9eebc2322632c8275386f99cdb08c58020ad01409aecde874b8ad364" + Linux: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-linux-c-api.tar.xz" + sha256: "734f82bc0fcf9e3214db37f4275536ee3b59be8935ec3ffac379b312423ee3ae" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-aarch64-linux-c-api.tar.xz" + sha256: "6952c3ffcbb0d04c1c7f07c17e945d0fe2b756965d17717fde2c51dcce7465ab" + "s390x": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-s390x-linux-c-api.tar.xz" + sha256: "536a9a676ffaa143c77fa4e9712e19f6035e93e0d58865d243ad5e15302ef9e8" + Macos: + "x86_64": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-macos-c-api.tar.xz" + sha256: "42948b3dc8ba7061101d83c55d1fb2ed2f537061291739e0582aa8375d6baf76" + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-aarch64-macos-c-api.tar.xz" + sha256: "d5b1121219d3503dac0f8cfc04a0557eea2330107867d0b32b91bd9fe0b62322" + Android: + "armv8": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-aarch64-linux-c-api.tar.xz" + sha256: "6952c3ffcbb0d04c1c7f07c17e945d0fe2b756965d17717fde2c51dcce7465ab" "18.0.3": Windows: "x86_64": @@ -149,213 +239,3 @@ sources: "armv8": url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-aarch64-linux-c-api.tar.xz" sha256: "47a5fcad64a0e223cf1796eafd0fc9ca62c8b3e457942695397feb56382d3db1" - "6.0.1": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-x86_64-windows-c-api.zip" - sha256: "09e5a916421933c6b81ae040b1678450a0c23c4286a2327d515001c51e5fe344" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-x86_64-mingw-c-api.zip" - sha256: "03982d3ff2d34d47f5609b4ac3acbc517d25c8ab881df69328d1e21b19ff70c4" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-x86_64-linux-c-api.tar.xz" - sha256: "a64c6e7bee46598d9efd357f4e7c6a4dfb3888e389755ff050555e0d330bcc0f" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-aarch64-linux-c-api.tar.xz" - sha256: "6dbc2dc9b9cc5ecd937f7fca07b5c87014615a4c00bcbac51ceb78140f9ccdf1" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-s390x-linux-c-api.tar.xz" - sha256: "047536e2085372d68ca5ee342d7c11722f8ac5858dd0e99615cf7c4cfa433225" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-x86_64-macos-c-api.tar.xz" - sha256: "97bb023c9f8eb206fb2a11befbbdd55003dfd3bcf763dd4bdf72bd02768f3faf" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-aarch64-macos-c-api.tar.xz" - sha256: "914c5b7a844c8e04d4f191ac229d4e3714d185971bde1be3203a6041aec5f465" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-aarch64-linux-c-api.tar.xz" - sha256: "6dbc2dc9b9cc5ecd937f7fca07b5c87014615a4c00bcbac51ceb78140f9ccdf1" - "5.0.0": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-x86_64-windows-c-api.zip" - sha256: "11b3c7473afee0db400683ac1aa9e5243b3d55dbdaeaca534c7b3481d3e3c8a3" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-x86_64-mingw-c-api.zip" - sha256: "3c87f5c59a10cfda484131dd1454a9bac8b56e48648377178b4b1cbb201358bd" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-x86_64-linux-c-api.tar.xz" - sha256: "cbdec67ae16af672d50ff2c47718713d60b6cdc05f7c0bee77f612dde8c7ee92" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-aarch64-linux-c-api.tar.xz" - sha256: "1b2baa5038afdd6d8338c4b94487c2b271d391b1f3e0bdf462ca7d9ef1c489df" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-s390x-linux-c-api.tar.xz" - sha256: "4ee4fc1e43c5b588f52b309046549928e3f6c1daee373d245c71687c1bd8a2dd" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-x86_64-macos-c-api.tar.xz" - sha256: "8c6f326c452598e23e2ba4894378e4ba73d18ce4d488cb1f29a377a47457321c" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-aarch64-macos-c-api.tar.xz" - sha256: "7c773aa2650bd9b2b50cfe5faa8bbff772a5417d8fc2ae1f050f575331aa6015" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-aarch64-linux-c-api.tar.xz" - sha256: "1b2baa5038afdd6d8338c4b94487c2b271d391b1f3e0bdf462ca7d9ef1c489df" - "4.0.0": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-x86_64-windows-c-api.zip" - sha256: "b2874ab0e2f7588dacef433bd1f9c4cd958243ef4cbbc5886b328cd14eab5d48" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-x86_64-mingw-c-api.zip" - sha256: "68c0a5fccdd875c0d653110af94bceb2d8e35b0d836f8784bccea2d5b5b88108" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-x86_64-linux-c-api.tar.xz" - sha256: "174166c8c2294d66844fe9736543e9edc8a28ff8db18b26e8b74f5a27024f8c5" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-aarch64-linux-c-api.tar.xz" - sha256: "f3017e9272068a264234efec5df822b619299e138bd2fdab2eca43c73d8e7d26" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-s390x-linux-c-api.tar.xz" - sha256: "9243404037187900ed85188744d28501c786abba1098a933a8c80363d3763350" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-x86_64-macos-c-api.tar.xz" - sha256: "41d0d2fd9c9942f0b00eac3da6ddfaca5a660a61c6220bc608d2e15d5adfbdd4" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-aarch64-macos-c-api.tar.xz" - sha256: "2761ee87f265e520a2ed1d82188c958f5dc244ad6fed94a80f6af33f705a320d" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-aarch64-linux-c-api.tar.xz" - sha256: "f3017e9272068a264234efec5df822b619299e138bd2fdab2eca43c73d8e7d26" - "3.0.0": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v3.0.0/wasmtime-v3.0.0-x86_64-windows-c-api.zip" - sha256: "4375673c544e43fc5c9c939e05b30efafdb1449412912ee17937272a25ee1ddd" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v3.0.0/wasmtime-v3.0.0-x86_64-mingw-c-api.zip" - sha256: "793a0179391e1f9b6699b1054b37dfffc36b7ab5eff401bb16a8fe66e6e42ee1" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v3.0.0/wasmtime-v3.0.0-x86_64-linux-c-api.tar.xz" - sha256: "0cdc7e36fa752c66d57121555fa58370581613e8c119654a4a12c197d4fde148" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v3.0.0/wasmtime-v3.0.0-aarch64-linux-c-api.tar.xz" - sha256: "93c3dcd7b315a98de221d68e0d253cfcbf122328aea285c28e70aa0ea6582088" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v3.0.0/wasmtime-v3.0.0-s390x-linux-c-api.tar.xz" - sha256: "9e19c795996a94ece9d0bf00c88cbb1081552c4ae0590effd50121351fb8303e" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v3.0.0/wasmtime-v3.0.0-x86_64-macos-c-api.tar.xz" - sha256: "df85111b0b20ee5a4201eae7c7cf368f905e6b73d186fcbf7347f750278a598d" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v3.0.0/wasmtime-v3.0.0-aarch64-macos-c-api.tar.xz" - sha256: "253a3d1c79134665ab2d7ae0672227b8d88b2becbb84ab96ceeee897a074801a" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v3.0.0/wasmtime-v3.0.0-aarch64-linux-c-api.tar.xz" - sha256: "93c3dcd7b315a98de221d68e0d253cfcbf122328aea285c28e70aa0ea6582088" - "2.0.0": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-x86_64-windows-c-api.zip" - sha256: "ada9fe8f706811f3f63dcaa4c7c72519893f91ae7980f7f8ed6e542932ad6a4e" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-x86_64-mingw-c-api.zip" - sha256: "dc024d00671098260643b51b3609bb808f440bb8e2f06d9fad6c2af1160d16b7" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-x86_64-linux-c-api.tar.xz" - sha256: "c216f16a0494b7b609890effcd417b9807dc8a6d5c47818fb4a297fef2bb54e3" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-aarch64-linux-c-api.tar.xz" - sha256: "9bbcfbcc68b9b8c4572f0bdd956e1a558f9a01e82bd099fac9c7755220c92189" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-s390x-linux-c-api.tar.xz" - sha256: "9bbe40d443a34b1d8f71c9239d87555e9f41e04a9d84f085186711b8075ec5ef" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-x86_64-macos-c-api.tar.xz" - sha256: "658f8834a322ddf35cfcfc2c56afbbfad91106a00633d5c6c932757fa83378b2" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-aarch64-macos-c-api.tar.xz" - sha256: "08749d061565f9b48a29c57d3ef9ee2d432d531fad8758be97b1c98bfda1c14b" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-aarch64-linux-c-api.tar.xz" - sha256: "9bbcfbcc68b9b8c4572f0bdd956e1a558f9a01e82bd099fac9c7755220c92189" - "1.0.1": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-x86_64-windows-c-api.zip" - sha256: "7b8ae00997d3d6fef21d084141f843db9d2c562ca24aebccb5b20cdbba93c8c2" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-x86_64-mingw-c-api.zip" - sha256: "ce5b516b3924fdf38e200cad2fd9438ac35bf7ddd734aea3e2dee8f319e275c3" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-x86_64-linux-c-api.tar.xz" - sha256: "b481b015c8805acabf2d1aad3b005a8564ac11f3c5b360bbbf71ba0f03e2c067" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-aarch64-linux-c-api.tar.xz" - sha256: "aa950e47fdff4970efb7a59a3ea9e96b965180f9e84be46280915086f0ad7519" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-s390x-linux-c-api.tar.xz" - sha256: "b197a1d8878ae98b2a6ca769bc89aeda9352cb516f94d5a8d84453666ba57ab6" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-x86_64-macos-c-api.tar.xz" - sha256: "fc570e49cf3c4d66b69770ecee692e1cf27d0fa6a6363c83f3f5cca23ac9dc3b" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-aarch64-macos-c-api.tar.xz" - sha256: "48fe254302c6519bf289a4d1385dd425a1c65c4dd521d88dc6a1fab6f025bd19" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-aarch64-linux-c-api.tar.xz" - sha256: "aa950e47fdff4970efb7a59a3ea9e96b965180f9e84be46280915086f0ad7519" - "0.39.1": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-x86_64-windows-c-api.zip" - sha256: "1bf83b7bfda81e2b7df5cede0b0b3dd29ff615ecaccb2ad59f266651f13ccab4" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-x86_64-mingw-c-api.zip" - sha256: "802325d7f1bbacd8b4c439cac7df9cdd35a9e7285fcd70bee217967a0f8c7ee7" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-x86_64-linux-c-api.tar.xz" - sha256: "b8580211b10b4380039700c5dd75813fc56138faf79fc86d63cc1abfe84c099b" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-aarch64-linux-c-api.tar.xz" - sha256: "3fb770e9afa3114c3ffe9f60e696ba3e4a74d34e4b50b59cce27c3d118f215b1" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-s390x-linux-c-api.tar.xz" - sha256: "65d662cc3948b89aab1f56d44da129d117798a59bdc938e90d6412d620980d72" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-x86_64-macos-c-api.tar.xz" - sha256: "a045371654222d7eb29ca23520ebf64d8144ea8e1ae0b38df2f39cdeb83e3649" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-aarch64-macos-c-api.tar.xz" - sha256: "a5e0e3b1acf924771d84beec6462baa00d9a436df2d65748bcd202cb8470d267" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-aarch64-linux-c-api.tar.xz" - sha256: "3fb770e9afa3114c3ffe9f60e696ba3e4a74d34e4b50b59cce27c3d118f215b1" diff --git a/recipes/wasmtime/config.yml b/recipes/wasmtime/config.yml index e2a5b299e7fea..5bcf55a2755ca 100644 --- a/recipes/wasmtime/config.yml +++ b/recipes/wasmtime/config.yml @@ -1,4 +1,10 @@ versions: + "21.0.0": + folder: all + "20.0.1": + folder: all + "19.0.2": + folder: all "18.0.3": folder: all "16.0.0": @@ -11,15 +17,3 @@ versions: folder: all "6.0.1": folder: all - "5.0.0": - folder: all - "4.0.0": - folder: all - "3.0.0": - folder: all - "2.0.0": - folder: all - "1.0.1": - folder: all - "0.39.1": - folder: all diff --git a/recipes/watcher/all/conandata.yml b/recipes/watcher/all/conandata.yml index 533a3689631b9..bda0c9f5ba9f9 100644 --- a/recipes/watcher/all/conandata.yml +++ b/recipes/watcher/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.11.0": + url: "https://github.com/e-dant/watcher/archive/release/0.11.0.tar.gz" + sha256: "dd92496d77b6bc27e27ed28253faae4d81bc58b19407d154bb49504b2af73664" + "0.10.1": + url: "https://github.com/e-dant/watcher/archive/release/0.10.1.tar.gz" + sha256: "cc14b0adfc23ae90390cf8b4f20291abbc5bf0e358b5d12fa73f7e21d021ccd0" "0.10.0": url: "https://github.com/e-dant/watcher/archive/release/0.10.0.tar.gz" sha256: "c15f088ddc41b58100921ea0b630bcbde83c9960aefecf82221da997f4d4b4ec" @@ -14,26 +20,3 @@ sources: "0.8.7": url: "https://github.com/e-dant/watcher/archive/release/0.8.7.tar.gz" sha256: "e83eaf097f8ebe9b87bee2962e6e18f6f2597ae4e76d8d0258adc2c62fa545d2" - "0.8.0": - url: "https://github.com/e-dant/watcher/archive/release/0.8.0.tar.gz" - sha256: "74530f5f6c083ec0348ec41938ae43b02bed1d125125623394f31038fec6f9d1" - "0.6.0": - url: "https://github.com/e-dant/watcher/archive/release/0.6.0.tar.gz" - sha256: "156669c92f9119d658954e124fcd9fc640999fb8a45e2bd915ea8b05e15b925a" - "0.5.5": - url: "https://github.com/e-dant/watcher/archive/release/0.5.5.tar.gz" - sha256: "55da2b7a22cbdba836a405d5cab31a461e84e4e686a117f06399a806d33b2d09" - "0.5.4": - url: "https://github.com/e-dant/watcher/archive/release/0.5.4.tar.gz" - sha256: "0dac1d89886252bb0b999c2dad85aff283022a2b4393922a993459b180b8c663" - "0.5.2": - url: "https://github.com/e-dant/watcher/archive/release/0.5.2.tar.gz" - sha256: "e18e663f9a72a59fca3e7a9e125ca77823b03a3388aa569398965777c5671173" - "0.4.3": - url: "https://github.com/e-dant/watcher/archive/release/0.4.3.tar.gz" - sha256: "8603b45edfa5023752d9e2fdd731efe5a556a542aaf03f6be0e69c68f552b25a" -patches: - "0.5.5": - - patch_file: "patches/0.5.5-fix-limits_max.patch" - patch_description: "fix max macro error in windows" - patch_type: "portability" diff --git a/recipes/watcher/all/conanfile.py b/recipes/watcher/all/conanfile.py index e70c9cb544fb1..167c9652d196e 100644 --- a/recipes/watcher/all/conanfile.py +++ b/recipes/watcher/all/conanfile.py @@ -1,11 +1,10 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy +from conan.tools.files import get, copy from conan.tools.build import check_min_cppstd from conan.tools.apple import is_apple_os 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.49.0" @@ -19,6 +18,7 @@ class WatcherConan(ConanFile): topics = ("watch", "filesystem", "event", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _min_cppstd(self): @@ -43,9 +43,6 @@ def _compilers_minimum_version(self): }, }.get(self._min_cppstd, {}) - def export_sources(self): - export_conandata_patches(self) - def layout(self): basic_layout(self, src_folder="src") @@ -71,9 +68,6 @@ def loose_lt_semver(v1, v2): 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( diff --git a/recipes/watcher/all/patches/0.5.5-fix-limits_max.patch b/recipes/watcher/all/patches/0.5.5-fix-limits_max.patch deleted file mode 100644 index aeed151aa95e0..0000000000000 --- a/recipes/watcher/all/patches/0.5.5-fix-limits_max.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/watcher/detail/adapter/adapter.hpp b/include/watcher/detail/adapter/adapter.hpp -index 3d43bb8..597c0bc 100644 ---- a/include/watcher/detail/adapter/adapter.hpp -+++ b/include/watcher/detail/adapter/adapter.hpp -@@ -23,7 +23,7 @@ namespace adapter { - - namespace { - inline constexpr size_t watch_count_max -- = std::numeric_limits::max() - 1; -+ = (std::numeric_limits::max)() - 1; - } /* namespace */ - - /* @brief wtr/watcher/detail/adapter/message diff --git a/recipes/watcher/config.yml b/recipes/watcher/config.yml index 83559e08c8922..ed37614dda7ca 100644 --- a/recipes/watcher/config.yml +++ b/recipes/watcher/config.yml @@ -1,4 +1,8 @@ versions: + "0.11.0": + folder: all + "0.10.1": + folder: all "0.10.0": folder: all "0.9.5": @@ -9,15 +13,3 @@ versions: folder: all "0.8.7": folder: all - "0.8.0": - folder: all - "0.6.0": - folder: all - "0.5.5": - folder: all - "0.5.4": - folder: all - "0.5.2": - folder: all - "0.4.3": - folder: all diff --git a/recipes/wayland-protocols/all/conanfile.py b/recipes/wayland-protocols/all/conanfile.py index ad20a22df526e..9302d46b476a0 100644 --- a/recipes/wayland-protocols/all/conanfile.py +++ b/recipes/wayland-protocols/all/conanfile.py @@ -1,4 +1,4 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.tools.env import VirtualBuildEnv from conan.tools.files import copy, get, replace_in_file, rmdir from conan.tools.layout import basic_layout @@ -7,7 +7,7 @@ from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class WaylandProtocolsConan(ConanFile): @@ -38,7 +38,8 @@ def source(self): def generate(self): tc = MesonToolchain(self) - tc.project_options["datadir"] = os.path.join(self.package_folder, "res") + # Using relative folder because of this https://github.com/conan-io/conan/pull/15706 + tc.project_options["datadir"] = "res" tc.project_options["tests"] = "false" tc.generate() virtual_build_env = VirtualBuildEnv(self) @@ -68,10 +69,10 @@ def package_info(self): 'datarootdir': '${prefix}/res', 'pkgdatadir': '${datarootdir}/wayland-protocols', } - self.cpp_info.set_property( - "pkg_config_custom_content", - "\n".join(f"{key}={value}" for key,value in pkgconfig_variables.items())) - + # TODO: Remove when Conan 1.x not supported + pkgconfig_variables = pkgconfig_variables if conan_version.major >= 2 \ + else "\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items()) + self.cpp_info.set_property("pkg_config_custom_content", pkgconfig_variables) self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] self.cpp_info.bindirs = [] diff --git a/recipes/wayland/all/conanfile.py b/recipes/wayland/all/conanfile.py index 865c98752b9de..a946c8f8c05b2 100644 --- a/recipes/wayland/all/conanfile.py +++ b/recipes/wayland/all/conanfile.py @@ -50,15 +50,15 @@ def requirements(self): if self.options.enable_libraries: self.requires("libffi/3.4.4") if self.options.enable_dtd_validation: - self.requires("libxml2/2.12.3") - self.requires("expat/2.6.0") + self.requires("libxml2/[>=2.12.5 <3]") + self.requires("expat/[>=2.6.2 <3]") def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") def build_requirements(self): - self.tool_requires("meson/1.3.1") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/2.1.0") if not can_run(self): diff --git a/recipes/whisper-cpp/all/conandata.yml b/recipes/whisper-cpp/all/conandata.yml index 1c610fb8c4e68..9575136360485 100644 --- a/recipes/whisper-cpp/all/conandata.yml +++ b/recipes/whisper-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.2": + url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.6.2.tar.gz" + sha256: "da7988072022acc3cfa61b370b3c51baad017f1900c3dc4e68cb276499f66894" "1.5.2": url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.5.2.tar.gz" sha256: "be9c4d5d4b5f28f02e36f28e602b7d2dcfd734dd1c834ddae91ae8db601e951f" @@ -9,6 +12,10 @@ sources: url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.2.1.tar.gz" sha256: "69d47fc2ba982c42bd5bade4b7c827d5b3ed74b9c59323991c45a9f0f24eb6ed" patches: + "1.6.2": + - patch_file: "patches/1.6.2-0001-remove_hardcoded_cxxstd.patch" + patch_description: "Remove hardcoded CMAKE_CXX_STANDARD" + patch_type: "conan" "1.2.1": - patch_file: "patches/1.2.1-0001-find_package_openblas.patch" patch_description: "Fix OpenBlas cmake target name" diff --git a/recipes/whisper-cpp/all/patches/1.6.2-0001-remove_hardcoded_cxxstd.patch b/recipes/whisper-cpp/all/patches/1.6.2-0001-remove_hardcoded_cxxstd.patch new file mode 100644 index 0000000000000..9e041fd99d19b --- /dev/null +++ b/recipes/whisper-cpp/all/patches/1.6.2-0001-remove_hardcoded_cxxstd.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 82913aa..f3a2d27 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -125,8 +125,6 @@ find_package(Threads REQUIRED) + #compile flag sycl + if (WHISPER_SYCL) + set(CMAKE_CXX_STANDARD 17) +-else() +- set(CMAKE_CXX_STANDARD 11) + endif() + + if (WHISPER_FFMPEG) diff --git a/recipes/whisper-cpp/config.yml b/recipes/whisper-cpp/config.yml index 8c62d29e8f324..a159f6f70ca5c 100644 --- a/recipes/whisper-cpp/config.yml +++ b/recipes/whisper-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.6.2": + folder: "all" "1.5.2": folder: "all" "1.4.3": diff --git a/recipes/wildcards/all/conandata.yml b/recipes/wildcards/all/conandata.yml new file mode 100644 index 0000000000000..466e54e9a7c61 --- /dev/null +++ b/recipes/wildcards/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.4.0": + url: "https://github.com/zemasoft/wildcards/archive/refs/tags/v1.4.0.tar.gz" + sha256: "da8846215df2c1493e9796392d9e17ca2da8cfeae0f718fe1d6e0544cbcfaa0f" diff --git a/recipes/wildcards/all/conanfile.py b/recipes/wildcards/all/conanfile.py new file mode 100644 index 0000000000000..ea532ea715b2a --- /dev/null +++ b/recipes/wildcards/all/conanfile.py @@ -0,0 +1,53 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "wildcards" + description = "A simple C++ header-only template library implementing matching using wildcards" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/zemasoft/wildcards" + topics = ("template", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WILDCARDS_BUILD_TESTS"] = False + tc.variables["WILDCARDS_BUILD_EXAMPLES"] = False + tc.generate() + + def build(self): + # INFO: Wildcards uses CMake to generate wildcards.hpp + cmake = CMake(self) + cmake.configure() + + def package(self): + copy(self, "LICENSE_1_0.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include", "wildcards")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs.append(os.path.join("include", "wildcards")) diff --git a/recipes/wildcards/all/test_package/CMakeLists.txt b/recipes/wildcards/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5d849260e8ce8 --- /dev/null +++ b/recipes/wildcards/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(wildcards REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE wildcards::wildcards) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/wildcards/all/test_package/conanfile.py b/recipes/wildcards/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/wildcards/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/wildcards/all/test_package/test_package.cpp b/recipes/wildcards/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..076aaeb8e51e2 --- /dev/null +++ b/recipes/wildcards/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include "wildcards.hpp" + + +int main(void) { + wildcards::match("Hello, World!", "H*World?"); + + return EXIT_SUCCESS; +} diff --git a/recipes/wildcards/config.yml b/recipes/wildcards/config.yml new file mode 100644 index 0000000000000..c957e4bc2d3c7 --- /dev/null +++ b/recipes/wildcards/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.0": + folder: all diff --git a/recipes/wineditline/all/CMakeLists.txt b/recipes/wineditline/all/CMakeLists.txt deleted file mode 100644 index 1fedb144d2f6c..0000000000000 --- a/recipes/wineditline/all/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) - -project(WinEditLineWrapper C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - -add_subdirectory(source_subfolder) diff --git a/recipes/wineditline/all/conandata.yml b/recipes/wineditline/all/conandata.yml index 789f36bc66156..d9e2a2c6f39a9 100644 --- a/recipes/wineditline/all/conandata.yml +++ b/recipes/wineditline/all/conandata.yml @@ -1,8 +1,4 @@ sources: "2.206": sha256: "2d255c417244e963261dc6171684265f405df030e90ba6e6690a99284d645161" - url: https://sourceforge.net/projects/mingweditline/files/wineditline-2.206.zip/download -patches: - "2.206": - - patch_file: patches/0001-fix-cmakelists.patch - base_path: source_subfolder + url: "https://sourceforge.net/projects/mingweditline/files/wineditline-2.206.zip" diff --git a/recipes/wineditline/all/conanfile.py b/recipes/wineditline/all/conanfile.py index 3888bf2a8557f..1a01961f91168 100644 --- a/recipes/wineditline/all/conanfile.py +++ b/recipes/wineditline/all/conanfile.py @@ -1,64 +1,63 @@ -import functools 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, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class WineditlineConan(ConanFile): name = "wineditline" - description = ( - "A BSD-licensed EditLine API implementation for the native " - "Windows Console" - ) + description = "A BSD-licensed EditLine API implementation for the native Windows Console" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "http://mingweditline.sourceforge.net/" topics = ("readline", "editline", "windows") - license = "BSD-3-Clause" - generators = ("cmake",) - settings = ("os", "arch", "compiler", "build_type") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], } default_options = { "shared": False, } - exports_sources = ("patches/*", "CMakeLists.txt") + provides = "editline" + + @property + def _target_name(self): + return "edit" if self.options.shared else "edit_static" + + 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 validate(self): if self.settings.os != "Windows": - message = "wineditline is supported only on Windows." - raise ConanInvalidConfiguration(message) - - @property - def _source_subfolder(self): - return "source_subfolder" + raise ConanInvalidConfiguration(f"{self.ref} is supported only on Windows.") def source(self): - root = self._source_subfolder - get_args = self.conan_data["sources"][self.version] - tools.get(**get_args, destination=root, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + 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 - - def build(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - self._configure_cmake().build() + cmake.build(target=self._target_name) def package(self): - self.copy("COPYING", "licenses", self._source_subfolder) - self._configure_cmake().install() + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include", "editline"), src=os.path.join(self.source_folder, "src", "editline")) + copy(self, "*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, "*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder, keep_path=False) def package_info(self): - self.cpp_info.libs = ["edit"] + self.cpp_info.libs = [self._target_name] diff --git a/recipes/wineditline/all/patches/0001-fix-cmakelists.patch b/recipes/wineditline/all/patches/0001-fix-cmakelists.patch deleted file mode 100644 index ef01b0ca0616b..0000000000000 --- a/recipes/wineditline/all/patches/0001-fix-cmakelists.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -1,25 +1,16 @@ --cmake_minimum_required (VERSION 2.6) --project (WinEditLine) --set (WinEditLine_VERSION_MAJOR 2) --set (WinEditLine_VERSION_MINOR 2) --if (MSVC AND MSVC_USE_STATIC_RUNTIME) --foreach(flag_var -- CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE -- CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO) -- if(${flag_var} MATCHES "/MD") -- string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") -- endif(${flag_var} MATCHES "/MD") --endforeach(flag_var) --endif() --if(NOT DEFINED LIB_SUFFIX) -- if(CMAKE_SIZEOF_VOID_P MATCHES 4) -- set(LIB_SUFFIX "32") -- else() -- set(LIB_SUFFIX "64") -- endif() --endif() --configure_file ( -- "${PROJECT_SOURCE_DIR}/src/config.h.in" -- "${PROJECT_BINARY_DIR}/config.h" -+cmake_minimum_required(VERSION 3.1) -+ -+project(WinEditLine C) -+ -+add_library(edit src/editline.c src/fn_complete.c src/history.c src/libedit.def) -+target_include_directories(edit PRIVATE src) -+ -+include(GNUInstallDirs) -+ -+install( -+ TARGETS edit -+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ) --add_subdirectory (src) -+ -+install(DIRECTORY src/editline DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/recipes/wineditline/all/test_package/CMakeLists.txt b/recipes/wineditline/all/test_package/CMakeLists.txt index 84a38c545c793..3d8aa097f7a2f 100644 --- a/recipes/wineditline/all/test_package/CMakeLists.txt +++ b/recipes/wineditline/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(wineditline REQUIRED CONFIG) add_executable(test_package test_package.c) diff --git a/recipes/wineditline/all/test_package/conanfile.py b/recipes/wineditline/all/test_package/conanfile.py index ec80e0c5cc134..ef5d7042163ec 100644 --- a/recipes/wineditline/all/test_package/conanfile.py +++ b/recipes/wineditline/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", "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/wineditline/all/test_package/test_package.c b/recipes/wineditline/all/test_package/test_package.c index b51e6feba3274..452b5269fcee7 100644 --- a/recipes/wineditline/all/test_package/test_package.c +++ b/recipes/wineditline/all/test_package/test_package.c @@ -1,12 +1,7 @@ #include #include -int main(int argc, char const* argv[]) -{ - (void)argc; - (void)argv; - - free_history_entry(NULL); - - return 0; +int main() { + free_history_entry(NULL); + return 0; } diff --git a/recipes/wineditline/all/test_v1_package/CMakeLists.txt b/recipes/wineditline/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/wineditline/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/wineditline/all/test_v1_package/conanfile.py b/recipes/wineditline/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..ec80e0c5cc134 --- /dev/null +++ b/recipes/wineditline/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/wiringpi/all/CMakeLists.txt b/recipes/wiringpi/all/CMakeLists.txt index fdd0b1aff610c..80de9a56905b7 100644 --- a/recipes/wiringpi/all/CMakeLists.txt +++ b/recipes/wiringpi/all/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.8.11) -project(wiringPi C) +project(wiringPi LANGUAGES C) file(GLOB SRC_FILES ${WIRINGPI_SRC_DIR}/wiringPi/*.c) @@ -20,6 +20,10 @@ if(WIRINGPI_WITH_DEV_LIB) ${WIRINGPI_SRC_DIR}/wiringPi) endif() +if(WIRINGPI_LINUX_HEADERS_DIR) + target_include_directories(${PROJECT_NAME} PUBLIC ${WIRINGPI_LINUX_HEADERS_DIR}) +endif() + install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib diff --git a/recipes/wiringpi/all/conandata.yml b/recipes/wiringpi/all/conandata.yml index 676b9c65bf9fe..9b3f6dc4c04db 100644 --- a/recipes/wiringpi/all/conandata.yml +++ b/recipes/wiringpi/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "3.6": + url: "https://github.com/WiringPi/WiringPi/archive/refs/tags/3.6.tar.gz" + sha256: "bec180a14ccd2d6b4eb5248d6553593511e7881348f56f8c98515a6d5d5444ee" + "3.4": + url: "https://github.com/WiringPi/WiringPi/archive/refs/tags/3.4.tar.gz" + sha256: "a81219e9ea0ce08295d2fc0457c69c4df0c6d2e846cb5817ba3247f673480d55" + "3.2": + url: "https://github.com/WiringPi/WiringPi/archive/refs/tags/3.2.tar.gz" + sha256: "45aeaf52d86631edb7a5c82a4f6d0050ef10c8b4de6c566cd8017fc52a17b68e" "2.61-1": url: "https://github.com/WiringPi/WiringPi/archive/refs/tags/2.61-1.tar.gz" sha256: "b5dc6c6c2ba1349acf602fafd7b58aa81e3fc3216a33b983386264cca0033e12" diff --git a/recipes/wiringpi/all/conanfile.py b/recipes/wiringpi/all/conanfile.py index b1ff871a8a06d..882e90a790561 100644 --- a/recipes/wiringpi/all/conanfile.py +++ b/recipes/wiringpi/all/conanfile.py @@ -3,26 +3,32 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import get, copy +from conan.tools.scm import Version required_conan_version = ">=1.53.0" class WiringpiConan(ConanFile): name = "wiringpi" - license = "LGPL-3.0" description = "GPIO Interface library for the Raspberry Pi" - homepage = "http://wiringpi.com" - topics = ("wiringpi", "gpio", "raspberrypi") + license = "LGPL-3.0" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], - "fPIC": [True, False], - "wpi_extensions": [True, False], - "with_devlib": [True, False]} - default_options = {"shared": False, - "fPIC": True, - "wpi_extensions": False, - "with_devlib": True} - + homepage = "https://github.com/WiringPi/WiringPi" + topics = ("wiringpi", "gpio", "raspberrypi") + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + "wpi_extensions": [True, False], + "with_devlib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "wpi_extensions": False, + "with_devlib": True, + } + def export_sources(self): copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) @@ -32,21 +38,36 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) >= "3.2": + self.requires("linux-headers-generic/6.5.9", transitive_headers=True) + def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration(f"{self.ref} only works for Linux") - - def layout(self): - cmake_layout(self, src_folder="src") + if Version(self.version) >= 3.0: + if self.settings.compiler == "gcc" and \ + Version(self.settings.compiler.version) < 8: + raise ConanInvalidConfiguration(f"{self.ref} requires gcc >= 8") + # wiringPi.c:1755:9: error: case label does not reduce to an integer constant + if self.settings.compiler == "gcc" and \ + Version(self.settings.compiler.version).major == 11 and \ + self.settings.build_type == "Debug": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc 11 in Debug build") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - + def generate(self): tc = CMakeToolchain(self) tc.variables["WIRINGPI_SRC_DIR"] = self.source_folder.replace("\\", "/") tc.variables["WIRINGPI_WITH_WPI_EXTENSIONS"] = self.options.wpi_extensions tc.variables["WIRINGPI_WITH_DEV_LIB"] = self.options.with_devlib + if Version(self.version) >= "3.2": + tc.variables["WIRINGPI_LINUX_HEADERS_DIR"] = self.dependencies["linux-headers-generic"].cpp_info.includedirs[0] tc.generate() def build(self): diff --git a/recipes/wiringpi/all/test_package/CMakeLists.txt b/recipes/wiringpi/all/test_package/CMakeLists.txt index 619241be63343..3dfbe8a866f08 100644 --- a/recipes/wiringpi/all/test_package/CMakeLists.txt +++ b/recipes/wiringpi/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) find_package(wiringpi REQUIRED CONFIG) add_executable(test_package test_package.c) -target_link_libraries(test_package wiringpi::wiringpi) +target_link_libraries(test_package PRIVATE wiringpi::wiringpi) diff --git a/recipes/wiringpi/config.yml b/recipes/wiringpi/config.yml index b0d56a22c2e0d..64b1ec70829ae 100644 --- a/recipes/wiringpi/config.yml +++ b/recipes/wiringpi/config.yml @@ -1,4 +1,10 @@ versions: + "3.6": + folder: "all" + "3.4": + folder: "all" + "3.2": + folder: "all" "2.61-1": folder: "all" "cci.20210727": diff --git a/recipes/wolfssl/all/conandata.yml b/recipes/wolfssl/all/conandata.yml index 0a393b28e8b4a..df40064b3c0f9 100644 --- a/recipes/wolfssl/all/conandata.yml +++ b/recipes/wolfssl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.7.0": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.7.0-stable.tar.gz" + sha256: "2de93e8af588ee856fe67a6d7fce23fc1b226b74d710b0e3946bc8061f6aa18f" "5.6.6": url: "https://github.com/wolfSSL/wolfssl/archive/v5.6.6-stable.tar.gz" sha256: "3d2ca672d41c2c2fa667885a80d6fa03c3e91f0f4f72f87aef2bc947e8c87237" diff --git a/recipes/wolfssl/all/conanfile.py b/recipes/wolfssl/all/conanfile.py index 696d7e8d4ff17..af1ac29b52447 100644 --- a/recipes/wolfssl/all/conanfile.py +++ b/recipes/wolfssl/all/conanfile.py @@ -40,6 +40,8 @@ class WolfSSLConan(ConanFile): "sni": [True, False], "testcert": [True, False], "with_curl": [True, False], + "with_quic": [True, False], + "with_experimental": [True, False], } default_options = { "shared": False, @@ -57,6 +59,8 @@ class WolfSSLConan(ConanFile): "sni": False, "testcert": False, "with_curl": False, + "with_quic": False, + "with_experimental": False, } @property @@ -68,6 +72,10 @@ def config_options(self): del self.options.fPIC if Version(self.version) < "5.2.0": del self.options.with_curl + if Version(self.version) < "5.5.0": + del self.options.with_quic + if Version(self.version) < "5.7.0": + del self.options.with_experimental def configure(self): if self.options.shared: @@ -108,7 +116,7 @@ def generate(self): "--enable-sslv3={}".format(yes_no(self.options.sslv3)), "--enable-alpn={}".format(yes_no(self.options.alpn)), "--enable-des3={}".format(yes_no(self.options.des3)), - "--enable-tls13={}".format(yes_no(self.options.tls13)), + "--enable-tls13={}".format(yes_no(self.options.tls13 or self.options.get_safe("with_quic"))), "--enable-certgen={}".format(yes_no(self.options.certgen)), "--enable-dsa={}".format(yes_no(self.options.dsa)), "--enable-ripemd={}".format(yes_no(self.options.ripemd)), @@ -120,6 +128,10 @@ def generate(self): ]) if self.options.get_safe("with_curl"): tc.configure_args.append("--enable-curl") + if self.options.get_safe("with_quic"): + tc.configure_args.append("--enable-quic") + if self.options.get_safe("with_experimental"): + tc.configure_args.append("--enable-experimental") if is_msvc(self): tc.extra_ldflags.append("-ladvapi32") if check_min_vs(self, "180", raise_invalid=False): diff --git a/recipes/wolfssl/config.yml b/recipes/wolfssl/config.yml index e099f310174af..336a121cbb73d 100644 --- a/recipes/wolfssl/config.yml +++ b/recipes/wolfssl/config.yml @@ -1,4 +1,6 @@ versions: + "5.7.0": + folder: all "5.6.6": folder: all "5.6.4": diff --git a/recipes/xbyak/all/conandata.yml b/recipes/xbyak/all/conandata.yml index ecd59f56a583c..ef1003499edb9 100644 --- a/recipes/xbyak/all/conandata.yml +++ b/recipes/xbyak/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "7.07": + url: "https://github.com/herumi/xbyak/archive/v7.07.tar.gz" + sha256: "7bd603fb8de9e605b86c1996a20111df66707c916a2ac0397424080cc0ad7bde" "7.06": url: "https://github.com/herumi/xbyak/archive/v7.06.tar.gz" sha256: "686c710a67c7fb8e99d8e326cf22aea310a29db27a9db8ba19a9fee44f8ec097" diff --git a/recipes/xbyak/config.yml b/recipes/xbyak/config.yml index d6d3f30f6e896..6b9a060b1e92a 100644 --- a/recipes/xbyak/config.yml +++ b/recipes/xbyak/config.yml @@ -1,4 +1,6 @@ versions: + "7.07": + folder: all "7.06": folder: all "7.05": diff --git a/recipes/xege/all/conandata.yml b/recipes/xege/all/conandata.yml index 2f7535221dfb9..fecd7fb356766 100644 --- a/recipes/xege/all/conandata.yml +++ b/recipes/xege/all/conandata.yml @@ -1,4 +1,4 @@ sources: "20.08": - url: "https://github.com/wysaid/xege/archive/refs/tags/20.08.tar.gz" + url: "https://github.com/wysaid/xege/archive/refs/tags/v20.08.tar.gz" sha256: "33bc63366d093902b5bc68d3d613ebd90e449bc22800b40f2dd98e2b5c44b88a" diff --git a/recipes/xkbcommon/all/conanfile.py b/recipes/xkbcommon/all/conanfile.py index 6c59c78b63932..cedd8883aca46 100644 --- a/recipes/xkbcommon/all/conanfile.py +++ b/recipes/xkbcommon/all/conanfile.py @@ -66,7 +66,7 @@ def requirements(self): if self.options.with_x11: self.requires("xorg/system") if self.options.get_safe("xkbregistry"): - self.requires("libxml2/2.12.3") + self.requires("libxml2/[>=2.12.5 <3]") if self.options.get_safe("with_wayland"): self.requires("wayland/1.22.0") @@ -113,10 +113,8 @@ def generate(self): else: # Manually generate pkgconfig file of wayland-protocols since # PkgConfigDeps.build_context_activated can't work with legacy 1 profile - # We must use legacy conan v1 deps_cpp_info because self.dependencies doesn't - # contain build requirements when using 1 profile. - wp_prefix = self.deps_cpp_info["wayland-protocols"].rootpath - wp_version = self.deps_cpp_info["wayland-protocols"].version + wp_prefix = self.dependencies.build["wayland-protocols"].package_folder + wp_version = self.dependencies.build["wayland-protocols"].ref.version wp_pkg_content = textwrap.dedent(f"""\ prefix={wp_prefix} datarootdir=${{prefix}}/res diff --git a/recipes/xlsxio/all/conanfile.py b/recipes/xlsxio/all/conanfile.py index 7724a07d64464..ed6652c07a361 100644 --- a/recipes/xlsxio/all/conanfile.py +++ b/recipes/xlsxio/all/conanfile.py @@ -62,7 +62,7 @@ def requirements(self): self.requires("minizip-ng/4.0.1") else: self.requires("minizip/1.2.13") - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") def validate(self): if Version(self.version) >= "0.2.34": diff --git a/recipes/xmlsec/all/conandata.yml b/recipes/xmlsec/all/conandata.yml index 17da2946f298e..d050eee6edc63 100644 --- a/recipes/xmlsec/all/conandata.yml +++ b/recipes/xmlsec/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.4": + url: "https://github.com/lsh123/xmlsec/releases/download/1.3.4/xmlsec1-1.3.4.tar.gz" + sha256: "45ad9078d41ae76844ad2f8651600ffeec0fdd128ead988a8d69e907c57aee75" "1.3.3": url: "https://github.com/lsh123/xmlsec/releases/download/1.3.3/xmlsec1-1.3.3.tar.gz" sha256: "ab5b9a9ffd6960f46f7466d9d91f174ec37e8c31989237ba6b9eacdd816464f2" diff --git a/recipes/xmlsec/all/conanfile.py b/recipes/xmlsec/all/conanfile.py index cafb303fe93b8..e22e7d46a9e13 100644 --- a/recipes/xmlsec/all/conanfile.py +++ b/recipes/xmlsec/all/conanfile.py @@ -60,7 +60,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libxml2/2.12.4", transitive_headers=True) + self.requires("libxml2/[>=2.12.5 <3]", transitive_headers=True) if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]", transitive_headers=True) if self.options.with_xslt: diff --git a/recipes/xmlsec/config.yml b/recipes/xmlsec/config.yml index cbe3ff0b5cda4..ee5db77e3b9e5 100644 --- a/recipes/xmlsec/config.yml +++ b/recipes/xmlsec/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.4": + folder: all "1.3.3": folder: all "1.3.2": diff --git a/recipes/xnnpack/all/conanfile.py b/recipes/xnnpack/all/conanfile.py index 579c065b64636..81bd0455ccc87 100644 --- a/recipes/xnnpack/all/conanfile.py +++ b/recipes/xnnpack/all/conanfile.py @@ -64,7 +64,7 @@ def requirements(self): def validate(self): check_min_vs(self, 192) - compiler = self.info.settings.compiler + compiler = self.settings.compiler compiler_version = Version(compiler.version) if self.version < "cci.20230715": if (compiler == "gcc" and compiler_version < "6") or \ @@ -75,6 +75,10 @@ def validate(self): if (compiler == "gcc" and compiler_version < "11") or \ (compiler == "clang" and compiler_version < "8"): raise ConanInvalidConfiguration(f"{self.ref} doesn't support {compiler} {compiler.version}") + if self.options.assembly and compiler == "clang" and self.settings.arch == "armv6": + # clang assembly validator fails on XNNPACK's math.h for armv6: + # https://github.com/google/XNNPACK/issues/4348#issuecomment-1445437613 + raise ConanInvalidConfiguration(f"{self.ref} assembly option is incompatible with clang+armv6") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -120,6 +124,12 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}", "LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}") + if self.settings.compiler == "clang" and self.settings.arch == "armv7": + # https://github.com/google/XNNPACK/issues/4348 + # XNNPACK targets armv6, but clang fails to compile to due to a bug in the assembler (see linked issue). + # The user is targetting armv7, so adjust XNNPACK's -march accordingly to avoid the bug. + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "-march=armv6 -mfpu=vfp", "-march=armv7-a -mfpu=neon") def build(self): self._patch_sources() diff --git a/recipes/xsimd/all/conandata.yml b/recipes/xsimd/all/conandata.yml index f65775fd15ca5..04062faa8cea0 100644 --- a/recipes/xsimd/all/conandata.yml +++ b/recipes/xsimd/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "13.0.0": + url: "https://github.com/xtensor-stack/xsimd/archive/13.0.0.tar.gz" + sha256: "8bdbbad0c3e7afa38d88d0d484d70a1671a1d8aefff03f4223ab2eb6a41110a3" + "12.1.1": + url: "https://github.com/xtensor-stack/xsimd/archive/12.1.1.tar.gz" + sha256: "73f94a051278ef3da4533b691d31244d12074d5d71107473a9fd8d7be15f0110" "12.1.0": url: "https://github.com/xtensor-stack/xsimd/archive/12.1.0.tar.gz" sha256: "86b86e0aeba7a85575f6e079728f0c2b65307dddb7210487f2b7cb261ac8a4a2" diff --git a/recipes/xsimd/all/test_package/test_package.cpp b/recipes/xsimd/all/test_package/test_package.cpp index be0d55dea1818..ed1e514c89b74 100644 --- a/recipes/xsimd/all/test_package/test_package.cpp +++ b/recipes/xsimd/all/test_package/test_package.cpp @@ -1,27 +1,17 @@ #include "xsimd/xsimd.hpp" #include -namespace xs = xsimd; - -#if XSIMD_VERSION_MAJOR >= 9 && (XSIMD_WITH_NEON64 || XSIMD_WITH_NEON) -using number_type = float; -#else -using number_type = double; -#endif - int main(int argc, char *argv[]) { + namespace xs = xsimd; #if XSIMD_VERSION_MAJOR < 8 - xs::batch a(1.5, 2.5, 3.5, 4.5); - xs::batch b(2.5, 3.5, 4.5, 5.5); -#elif XSIMD_VERSION_MAJOR < 9 - xs::batch a({1.5, 2.5, 3.5, 4.5}); - xs::batch b({2.5, 3.5, 4.5, 5.5}); + xs::batch a(1., 1.); + xs::batch b(2., 2.); #else - xs::batch a{1.5, 2.5, 3.5, 4.5}; - xs::batch b{2.5, 3.5, 4.5, 5.5}; + auto a = xs::broadcast(1.); + auto b = xs::broadcast(2.); #endif - auto mean = (a + b) / 2; - std::cout << mean << std::endl; + auto mean = (a + b) / 2.; + std::cout << "Mean: " << mean << std::endl; return 0; } diff --git a/recipes/xsimd/config.yml b/recipes/xsimd/config.yml index 65384140b0d83..1f8cc881d52a7 100644 --- a/recipes/xsimd/config.yml +++ b/recipes/xsimd/config.yml @@ -1,4 +1,8 @@ versions: + "13.0.0": + folder: all + "12.1.1": + folder: all "12.1.0": folder: all "12.0.0": diff --git a/recipes/xtr/all/conandata.yml b/recipes/xtr/all/conandata.yml index 1e78ef99a9e55..2ce24b56ad5da 100644 --- a/recipes/xtr/all/conandata.yml +++ b/recipes/xtr/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.1": + url: "https://github.com/choll/xtr/archive/refs/tags/2.1.1.tar.gz" + sha256: "dbd8d1fbb5308329fe21bbe704206e2e69a5d49696959d43a2504ea1bec00140" "2.1.0": url: "https://github.com/choll/xtr/archive/refs/tags/2.1.0.tar.gz" sha256: "5abe2e53d91a893d63998968450d9bbfc23c45f552c81e2b7d17694699ab17c4" diff --git a/recipes/xtr/config.yml b/recipes/xtr/config.yml index 4f7c23f02e7c5..06db99424bd4b 100644 --- a/recipes/xtr/config.yml +++ b/recipes/xtr/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.1": + folder: all "2.1.0": folder: all "2.0.1": diff --git a/recipes/xz_utils/all/conandata.yml b/recipes/xz_utils/all/conandata.yml index 09ca27188fcd2..3274a9b4cdc21 100644 --- a/recipes/xz_utils/all/conandata.yml +++ b/recipes/xz_utils/all/conandata.yml @@ -1,24 +1,38 @@ sources: "5.4.5": - url: "https://tukaani.org/xz/xz-5.4.5.tar.xz" + url: + - "https://tukaani.org/xz/xz-5.4.5.tar.xz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/da9dec6c12cf2ecf269c31ab65b5de18e8e52b96f35d5bcd08c12b43e6878803" sha256: "da9dec6c12cf2ecf269c31ab65b5de18e8e52b96f35d5bcd08c12b43e6878803" "5.4.4": - url: "https://tukaani.org/xz/xz-5.4.4.tar.gz" + url: + - "https://tukaani.org/xz/xz-5.4.4.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/aae39544e254cfd27e942d35a048d592959bd7a79f9a624afb0498bb5613bdf8" sha256: "aae39544e254cfd27e942d35a048d592959bd7a79f9a624afb0498bb5613bdf8" "5.4.2": - url: "https://tukaani.org/xz/xz-5.4.2.tar.gz" + url: + - "https://tukaani.org/xz/xz-5.4.2.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/87947679abcf77cc509d8d1b474218fd16b72281e2797360e909deaee1ac9d05" sha256: "87947679abcf77cc509d8d1b474218fd16b72281e2797360e909deaee1ac9d05" "5.4.0": - url: "https://tukaani.org/xz/xz-5.4.0.tar.gz" + url: + - "https://tukaani.org/xz/xz-5.4.0.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/7471ef5991f690268a8f2be019acec2e0564b7b233ca40035f339fe9a07f830b" sha256: "7471ef5991f690268a8f2be019acec2e0564b7b233ca40035f339fe9a07f830b" "5.2.10": - url: "https://tukaani.org/xz/xz-5.2.10.tar.gz" + url: + - "https://tukaani.org/xz/xz-5.2.10.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/eb7a3b2623c9d0135da70ca12808a214be9c019132baaa61c9e1d198d1d9ded3" sha256: "eb7a3b2623c9d0135da70ca12808a214be9c019132baaa61c9e1d198d1d9ded3" "5.2.5": - url: "https://tukaani.org/xz/xz-5.2.5.tar.gz" + url: + - "https://tukaani.org/xz/xz-5.2.5.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10" sha256: "f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10" "5.2.4": - url: "https://tukaani.org/xz/xz-5.2.4.tar.gz" + url: + - "https://tukaani.org/xz/xz-5.2.4.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145" sha256: "b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145" patches: "5.2.4": diff --git a/recipes/xz_utils/cmake/conandata.yml b/recipes/xz_utils/cmake/conandata.yml deleted file mode 100644 index 8825601a50d2d..0000000000000 --- a/recipes/xz_utils/cmake/conandata.yml +++ /dev/null @@ -1,7 +0,0 @@ -sources: - "5.6.1": - url: "https://github.com/tukaani-project/xz/releases/download/v5.6.1/xz-5.6.1.tar.xz" - sha256: "f334777310ca3ae9ba07206d78ed286a655aa3f44eec27854f740c26b2cd2ed0" - "5.6.0": - url: "https://github.com/tukaani-project/xz/releases/download/v5.6.0/xz-5.6.0.tar.xz" - sha256: "cdafe1632f139c82937cc1ed824f7a60b7b0a0619dfbbd681dcac02b1ac28f5b" diff --git a/recipes/xz_utils/cmake/conanfile.py b/recipes/xz_utils/cmake/conanfile.py deleted file mode 100644 index 29d660487cdf7..0000000000000 --- a/recipes/xz_utils/cmake/conanfile.py +++ /dev/null @@ -1,120 +0,0 @@ -from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.errors import ConanInvalidConfiguration -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rmdir, save -from conan.tools.scm import Version -import os -import textwrap - -required_conan_version = ">=1.54.0" - - -class XZUtilsConan(ConanFile): - name = "xz_utils" - description = ( - "XZ Utils is free general-purpose data compression software with a high " - "compression ratio. XZ Utils were written for POSIX-like systems, but also " - "work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils." - ) - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://tukaani.org/xz" - topics = ("lzma", "xz", "compression") - license = "Unlicense", "LGPL-2.1-or-later", "GPL-2.0-or-later", "GPL-3.0-or-later" - package_type = "library" - settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - } - default_options = { - "shared": False, - "fPIC": True, - } - - def export_sources(self): - export_conandata_patches(self) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - self.settings.rm_safe("compiler.cppstd") - self.settings.rm_safe("compiler.libcxx") - - def validate(self): - # This is only from 5.6.0 onwards, they are just in a different recipe so no need to check version. - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": - raise ConanInvalidConfiguration(f"{self.ref} does not work on GCC<7 due to errors with inline assembly") - - def layout(self): - cmake_layout(self, src_folder="src") - - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) - - def generate(self): - tc = CMakeToolchain(self) - tc.variables["BUILD_TESTING"] = False - tc.generate() - - def build(self): - apply_conandata_patches(self) - cmake = CMake(self) - cmake.configure() - cmake.build() - - def package(self): - copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - - self._create_cmake_module_variables( - os.path.join(self.package_folder, self._module_file_rel_path), - ) - cmake = CMake(self) - cmake.install() - - rmdir(self, os.path.join(self.package_folder, "share")) - rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - rmdir(self, os.path.join(self.package_folder, "lib", "cmake", "liblzma")) - if self.settings.os == "Windows": - rename(self, os.path.join(self.package_folder, "lib", "liblzma.lib"), os.path.join(self.package_folder, "lib", "lzma.lib")) - - def _create_cmake_module_variables(self, module_file): - # TODO: also add LIBLZMA_HAS_AUTO_DECODER, LIBLZMA_HAS_EASY_ENCODER & LIBLZMA_HAS_LZMA_PRESET - content = textwrap.dedent(f"""\ - set(LIBLZMA_FOUND TRUE) - if(DEFINED LibLZMA_INCLUDE_DIRS) - set(LIBLZMA_INCLUDE_DIRS ${{LibLZMA_INCLUDE_DIRS}}) - endif() - if(DEFINED LibLZMA_LIBRARIES) - set(LIBLZMA_LIBRARIES ${{LibLZMA_LIBRARIES}}) - endif() - set(LIBLZMA_VERSION_MAJOR {Version(self.version).major}) - set(LIBLZMA_VERSION_MINOR {Version(self.version).minor}) - set(LIBLZMA_VERSION_PATCH {Version(self.version).patch}) - set(LIBLZMA_VERSION_STRING "{self.version}") - """) - save(self, module_file, content) - - @property - def _module_file_rel_path(self): - return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") - - def package_info(self): - self.cpp_info.set_property("cmake_find_mode", "both") - self.cpp_info.set_property("cmake_file_name", "LibLZMA") - self.cpp_info.set_property("cmake_target_name", "LibLZMA::LibLZMA") - self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) - self.cpp_info.set_property("pkg_config_name", "liblzma") - self.cpp_info.libs = ["lzma"] - if not self.options.shared: - self.cpp_info.defines.append("LZMA_API_STATIC") - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") - - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed - self.cpp_info.names["cmake_find_package"] = "LibLZMA" - self.cpp_info.names["cmake_find_package_multi"] = "LibLZMA" - self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] diff --git a/recipes/xz_utils/cmake/test_package/CMakeLists.txt b/recipes/xz_utils/cmake/test_package/CMakeLists.txt deleted file mode 100644 index cd4e960a3ff01..0000000000000 --- a/recipes/xz_utils/cmake/test_package/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -find_package(LibLZMA REQUIRED) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE LibLZMA::LibLZMA) - -# Test whether variables from https://cmake.org/cmake/help/latest/module/FindLibLZMA.html -# are properly defined in conan generators -set(_custom_vars - LIBLZMA_FOUND - LIBLZMA_INCLUDE_DIRS - LIBLZMA_LIBRARIES - LIBLZMA_VERSION_MAJOR - LIBLZMA_VERSION_MINOR - LIBLZMA_VERSION_PATCH - LIBLZMA_VERSION_STRING -) -foreach(_custom_var ${_custom_vars}) - if(DEFINED ${_custom_var}) - message(STATUS "${_custom_var}: ${${_custom_var}}") - else() - message(FATAL_ERROR "${_custom_var} not defined") - endif() -endforeach() diff --git a/recipes/xz_utils/cmake/test_package/test_package.c b/recipes/xz_utils/cmake/test_package/test_package.c deleted file mode 100644 index a1f55ac414846..0000000000000 --- a/recipes/xz_utils/cmake/test_package/test_package.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include -#include - -int main() { - printf("LZMA version %s\n", lzma_version_string()); - return EXIT_SUCCESS; -} diff --git a/recipes/xz_utils/cmake/test_v1_package/CMakeLists.txt b/recipes/xz_utils/cmake/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/xz_utils/cmake/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/xz_utils/cmake/test_v1_package/conanfile.py b/recipes/xz_utils/cmake/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/xz_utils/cmake/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/xz_utils/config.yml b/recipes/xz_utils/config.yml index 7cd5f51b3c3c5..d950dab72f7d0 100644 --- a/recipes/xz_utils/config.yml +++ b/recipes/xz_utils/config.yml @@ -1,8 +1,4 @@ versions: - "5.6.1": - folder: cmake - "5.6.0": - folder: cmake "5.4.5": folder: all "5.4.4": diff --git a/recipes/ydcpp-tcpcat/all/conandata.yml b/recipes/ydcpp-tcpcat/all/conandata.yml new file mode 100644 index 0000000000000..93679778e120e --- /dev/null +++ b/recipes/ydcpp-tcpcat/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.4": + url: "https://github.com/ydcpp/tcpcat/archive/refs/tags/1.0.4.tar.gz" + sha256: "3413e74eab0a1bf7927b747e393b1931e8a516ee769642ce89c558a93e00e38b" diff --git a/recipes/ydcpp-tcpcat/all/conanfile.py b/recipes/ydcpp-tcpcat/all/conanfile.py new file mode 100644 index 0000000000000..ff79b54fa821b --- /dev/null +++ b/recipes/ydcpp-tcpcat/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout +from conan.tools.microsoft import is_msvc +from conan.tools.files import copy, get +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +import os + + +class TcpcatConan(ConanFile): + name = "ydcpp-tcpcat" + + # Optional metadata + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ydcpp/tcpcat" + description = "Simple C++ TCP Server and Client library." + topics = ("network", "tcp", "tcp-server", "tcp-client") + + # Binary configuration + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + 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": "7", + "Visual Studio": "16", + "msvc": "192", + "clang": "7", + "apple-clang": "12" + } + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + # Upstream meant to support Windows Shared builds, but they don't currently export any symbols + # Disable for now until fixed. As this is an upstream issue they want fixed, we don't set + # package_type = "static-library" in the configure() method so that users have a clear message error for now + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} does not currently support Windows shared builds due to an upstream issue") + + 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): + self.requires("asio/1.30.2", transitive_headers = True) + + 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.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")) + copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["ydcpp-tcpcat"] + self.cpp_info.set_property("cmake_target_name", "ydcpp-tcpcat") + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs.append("m") diff --git a/recipes/ydcpp-tcpcat/all/test_package/CMakeLists.txt b/recipes/ydcpp-tcpcat/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0be8339e35258 --- /dev/null +++ b/recipes/ydcpp-tcpcat/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +add_executable(test_package test_package.cpp) + +find_package(ydcpp-tcpcat CONFIG REQUIRED) +target_link_libraries(test_package ydcpp-tcpcat) +target_compile_features(test_package PRIVATE cxx_std_17) diff --git a/recipes/ydcpp-tcpcat/all/test_package/conanfile.py b/recipes/ydcpp-tcpcat/all/test_package/conanfile.py new file mode 100644 index 0000000000000..806fd5ae2a792 --- /dev/null +++ b/recipes/ydcpp-tcpcat/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class tcpcatTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/ydcpp-tcpcat/all/test_package/test_package.cpp b/recipes/ydcpp-tcpcat/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..aa337b33b0be6 --- /dev/null +++ b/recipes/ydcpp-tcpcat/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include +#include + +int main() +{ + tcpcat::TcpSession session(nullptr, nullptr, 0); + std::cout << "session id: " << session.GetId() << std::endl; + return 0; +} diff --git a/recipes/ydcpp-tcpcat/config.yml b/recipes/ydcpp-tcpcat/config.yml new file mode 100644 index 0000000000000..c20e44b006f1a --- /dev/null +++ b/recipes/ydcpp-tcpcat/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.4": + folder: all diff --git a/recipes/yoga/all/conandata.yml b/recipes/yoga/all/conandata.yml index 4491f60c4cea8..beedad9ab39c3 100644 --- a/recipes/yoga/all/conandata.yml +++ b/recipes/yoga/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.1.0": + url: "https://github.com/facebook/yoga/archive/refs/tags/v3.1.0.tar.gz" + sha256: "06ff9e6df9b2388a0c6ef8db55ba9bc2ae75e716e967cd12cf18785f6379159e" + "3.0.4": + url: "https://github.com/facebook/yoga/archive/refs/tags/v3.0.4.tar.gz" + sha256: "ef3ce5106eed03ab2e40dcfe5b868936a647c5f02b7ffd89ffaa5882dca3ef7f" "3.0.2": url: "https://github.com/facebook/yoga/archive/refs/tags/v3.0.2.tar.gz" sha256: "73a81c51d9ceb5b95cd3abcafeb4c840041801d59f5048dacce91fbaab0cc6f9" @@ -9,6 +15,14 @@ sources: url: "https://github.com/facebook/yoga/archive/refs/tags/v2.0.0.tar.gz" sha256: "29eaf05191dd857f76b6db97c77cce66db3c0067c88bd5e052909386ea66b8c5" patches: + "3.1.0": + - patch_file: "patches/0001-delete-tests.patch" + patch_description: "Delete test targets from cmake" + patch_type: "conan" + "3.0.4": + - patch_file: "patches/0001-delete-tests.patch" + patch_description: "Delete test targets from cmake" + patch_type: "conan" "3.0.2": - patch_file: "patches/0001-delete-tests.patch" patch_description: "Delete test targets from cmake" diff --git a/recipes/yoga/config.yml b/recipes/yoga/config.yml index c6a903df77248..542519cbca0f4 100644 --- a/recipes/yoga/config.yml +++ b/recipes/yoga/config.yml @@ -1,4 +1,8 @@ versions: + "3.1.0": + folder: all + "3.0.4": + folder: all "3.0.2": folder: all "2.0.1": diff --git a/recipes/yomm2/all/conandata.yml b/recipes/yomm2/all/conandata.yml new file mode 100644 index 0000000000000..6a145498b3d66 --- /dev/null +++ b/recipes/yomm2/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.5.2": + url: "https://github.com/jll63/yomm2/archive/refs/tags/v1.5.2.tar.gz" + sha256: "12f3f735b4870606199b889a242ebfed84cf0cd392b04a1c32db11291de684be" + "1.5.1": + url: "https://github.com/jll63/yomm2/archive/refs/tags/v1.5.1.tar.gz" + sha256: "323abba27a356555cc3ead3e3e950746ab43f90d97ad21950f2ba3afaf565ecc" diff --git a/recipes/yomm2/all/conanfile.py b/recipes/yomm2/all/conanfile.py new file mode 100644 index 0000000000000..f02471f2e1d50 --- /dev/null +++ b/recipes/yomm2/all/conanfile.py @@ -0,0 +1,121 @@ +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, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.files import get, rm, rmdir, copy, replace_in_file +from conan.tools.scm import Version + +required_conan_version = ">=1.54.0" + + +class yomm2Recipe(ConanFile): + name = "yomm2" + package_type = "header-library" + # Optional metadata + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jll63/yomm2" + description = "Fast, orthogonal, open multi-methods. Solve the Expression Problem in C++17" + topics = ("multi-methods", "multiple-dispatch", "open-methods", "shared-library", + "header-only", "polymorphism", "expression-problem", "c++17") + # Binary configuration + settings = "os", "compiler", "build_type", "arch" + options = { + "header_only": [True, False], + } + default_options = { + "header_only": True + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "5", + "apple-clang": "13", + "msvc": "192" + } + + def configure(self): + if not bool(self.options.header_only): + self.package_type = "shared-library" + + 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 == "apple-clang" and not bool(self.options.header_only): + raise ConanInvalidConfiguration( + f"{self.ref} dynamic library builds are not supported on MacOS." + ) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.20 <4]") + + def requirements(self): + # Upstream requires Boost 1.74 + # Using more modern Boost version to avoid issues like the one commented here: + # - https://github.com/conan-io/conan/issues/15977#issuecomment-2098003085 + self.requires("boost/1.85.0", transitive_headers=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): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.variables["YOMM2_ENABLE_EXAMPLES"] = "OFF" + tc.variables["YOMM2_ENABLE_TESTS"] = "OFF" + tc.variables["YOMM2_SHARED"] = not bool(self.options.header_only) + tc.generate() + + def _patch_sources(self): + if Version(self.version) <= "1.5.1": + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "add_subdirectory(docs.in)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package_id(self): + # if yomm2 is built as static, it behaves as a header-only one + if self.info.options.header_only: + self.info.clear() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if self.options.header_only: + rmdir(self, os.path.join(self.package_folder, "lib")) + else: + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "YOMM2") + self.cpp_info.set_property("cmake_target_name", "YOMM2::yomm2") + if self.options.header_only: + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + else: # shared-library + self.cpp_info.libs = ["yomm2"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/yomm2/all/test_package/CMakeLists.txt b/recipes/yomm2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2686aaf2077a9 --- /dev/null +++ b/recipes/yomm2/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(YOMM2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE YOMM2::yomm2 ${CMAKE_THREAD_LIBS_INIT}) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/yomm2/all/test_package/conanfile.py b/recipes/yomm2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..189c09687bde3 --- /dev/null +++ b/recipes/yomm2/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class yomm2TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/yomm2/all/test_package/test_package.cpp b/recipes/yomm2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ea5d7313d5408 --- /dev/null +++ b/recipes/yomm2/all/test_package/test_package.cpp @@ -0,0 +1,53 @@ +// Copyright (c) 2018-2024 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include + +#include + +class Animal { + public: + virtual ~Animal() { + } +}; + +class Dog : public Animal {}; +class Cat : public Animal {}; + +register_classes(Animal, Dog, Cat); + +declare_method( + void, meet, (virtual_, virtual_, std::ostream&)); + +define_method(void, meet, (Animal&, Animal&, std::ostream& os)) { + os << "ignore"; +} + +// Add definitions for specific pairs of animals. +define_method(void, meet, (Dog& dog1, Dog& dog2, std::ostream& os)) { + os << "wag tail"; +} + +define_method(void, meet, (Dog& dog, Cat& cat, std::ostream& os)) { + os << "chase"; +} + +define_method(void, meet, (Cat& cat, Dog& dog, std::ostream& os)) { + os << "run"; +} + +int main() { + #ifndef NDEBUG + yorel::yomm2::default_policy::trace_enabled = true; + #endif + + yorel::yomm2::update(); + Animal&& snoopy = Dog(); + Animal&& felix = Cat(); + std::ostringstream os; + meet(snoopy, felix, os); // chase + + return os.str() == "chase" ? 0 : 1; +} diff --git a/recipes/yomm2/config.yml b/recipes/yomm2/config.yml new file mode 100644 index 0000000000000..e13089a05a884 --- /dev/null +++ b/recipes/yomm2/config.yml @@ -0,0 +1,5 @@ +versions: + "1.5.2": + folder: all + "1.5.1": + folder: all diff --git a/recipes/yyjson/all/conandata.yml b/recipes/yyjson/all/conandata.yml index ad21b483cb840..bd4149d822688 100644 --- a/recipes/yyjson/all/conandata.yml +++ b/recipes/yyjson/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.10.0": + url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.10.0.tar.gz" + sha256: "0d901cb2c45c5586e3f3a4245e58c2252d6b24bf4b402723f6179523d389b165" + "0.9.0": + url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.9.0.tar.gz" + sha256: "59902bea55585d870fd7681eabe6091fbfd1a8776d1950f859d2dbbd510c74bd" "0.8.0": url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.8.0.tar.gz" sha256: "b2e39ac4c65f9050820c6779e6f7dd3c0d3fed9c6667f91caec0badbedce00f3" diff --git a/recipes/yyjson/all/conanfile.py b/recipes/yyjson/all/conanfile.py index 3574d26b2c7d5..735dd7c15a5b0 100644 --- a/recipes/yyjson/all/conanfile.py +++ b/recipes/yyjson/all/conanfile.py @@ -61,6 +61,7 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "yyjson") @@ -68,3 +69,6 @@ def package_info(self): self.cpp_info.libs = ["yyjson"] if self.settings.os == "Windows" and self.options.shared: self.cpp_info.defines.append("YYJSON_IMPORTS") + + if Version(self.version) >= "0.9.0": + self.cpp_info.set_property("pkg_config_name", "yyjson") diff --git a/recipes/yyjson/config.yml b/recipes/yyjson/config.yml index f84f2efec202b..b53dac867c374 100644 --- a/recipes/yyjson/config.yml +++ b/recipes/yyjson/config.yml @@ -1,4 +1,8 @@ versions: + "0.10.0": + folder: all + "0.9.0": + folder: all "0.8.0": folder: all "0.7.0": diff --git a/recipes/z3/all/conandata.yml b/recipes/z3/all/conandata.yml index f57877f85f54a..22ef6c0cbb592 100644 --- a/recipes/z3/all/conandata.yml +++ b/recipes/z3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.13.0": + url: "https://github.com/Z3Prover/z3/archive/z3-4.13.0.tar.gz" + sha256: "01bcc61c8362e37bb89fd2430f7e3385e86df7915019bd2ce45de9d9bd934502" "4.12.4": url: "https://github.com/Z3Prover/z3/archive/z3-4.12.4.tar.gz" sha256: "25e9b18d04ee22f1d872dfe0daaf4c39034744525214e34fedd206e25140e96e" diff --git a/recipes/z3/config.yml b/recipes/z3/config.yml index 3fad1114f7caf..3b0214f4790b4 100644 --- a/recipes/z3/config.yml +++ b/recipes/z3/config.yml @@ -1,4 +1,6 @@ versions: + "4.13.0": + folder: "all" "4.12.4": folder: "all" "4.12.2": diff --git a/recipes/zeus_expected/all/conandata.yml b/recipes/zeus_expected/all/conandata.yml new file mode 100644 index 0000000000000..2bad1674f5012 --- /dev/null +++ b/recipes/zeus_expected/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "1.1.1": + url: "https://github.com/zeus-cpp/expected/archive/refs/tags/v1.1.1.tar.gz" + sha256: "47b411677ffb2fa0d43b308797542509ae2bdb101426cf0d4777e3c162b1d726" + "1.1.0": + url: "https://github.com/zeus-cpp/expected/archive/refs/tags/v1.1.0.tar.gz" + sha256: "a963eba43f227498da2cbb924265344209696320c75ee63a92073936bb49f7e5" + +patches: + "1.1.0": + - patch_file: "patches/0001-fix-compiler-errors-with-msvc-v142.patch" + patch_source: "https://github.com/zeus-cpp/expected/pull/7/commits/82ed513aa65a3c2c7b8f8af7c63e0b8b57637dfb" + patch_description: "Fix for MSVC v142" + patch_type: "bugfix" diff --git a/recipes/zeus_expected/all/conanfile.py b/recipes/zeus_expected/all/conanfile.py new file mode 100644 index 0000000000000..1067fa8157091 --- /dev/null +++ b/recipes/zeus_expected/all/conanfile.py @@ -0,0 +1,84 @@ +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.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +from conan.tools.files import apply_conandata_patches, export_conandata_patches +import os + +required_conan_version = ">=1.54.0" + + +class ZeusExpectedConan(ConanFile): + name = "zeus_expected" + + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/zeus-cpp/expected" + description = "Backporting std::expected to C++17." + topics = ("cpp17", "expected") + license = "MIT" + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + no_copy_source = True + + def export_sources(self): + export_conandata_patches(self) + + @property + def _min_cppstd(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "gcc": "7", + "clang": "5", + "Visual Studio": "15.7", + "apple-clang": "10", + } + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if min_version and Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration( + f"{self.name} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def layout(self): + basic_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) + + def package(self): + copy( + self, + "LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + ) + copy( + self, + "*", + src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include"), + ) + + def package_info(self): + self.cpp_info.set_property("cmake_target_name", "zeus::expected") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + def package_id(self): + self.info.clear() diff --git a/recipes/zeus_expected/all/patches/0001-fix-compiler-errors-with-msvc-v142.patch b/recipes/zeus_expected/all/patches/0001-fix-compiler-errors-with-msvc-v142.patch new file mode 100644 index 0000000000000..82856fb33c345 --- /dev/null +++ b/recipes/zeus_expected/all/patches/0001-fix-compiler-errors-with-msvc-v142.patch @@ -0,0 +1,88 @@ +From 82ed513aa65a3c2c7b8f8af7c63e0b8b57637dfb Mon Sep 17 00:00:00 2001 +From: X1aomu +Date: Fri, 19 Apr 2024 14:15:14 +0800 +Subject: [PATCH] fix: compiler errors with msvc v142 + +--- + include/zeus/expected.hpp | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/include/zeus/expected.hpp b/include/zeus/expected.hpp +index 6492953..790f870 100644 +--- a/include/zeus/expected.hpp ++++ b/include/zeus/expected.hpp +@@ -2441,7 +2441,7 @@ public: + constexpr auto and_then(F &&f) & + { + using U = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The error type must be the same after calling the F"); + + if (has_value()) +@@ -2453,7 +2453,7 @@ public: + constexpr auto and_then(F &&f) const & + { + using U = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The error type must be the same after calling the F"); + + if (has_value()) +@@ -2465,7 +2465,7 @@ public: + constexpr auto and_then(F &&f) && + { + using U = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The error type must be the same after calling the F"); + + if (has_value()) +@@ -2477,7 +2477,7 @@ public: + constexpr auto and_then(F &&f) const && + { + using U = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The error type must be the same after calling the F"); + + if (has_value()) +@@ -2490,7 +2490,7 @@ public: + constexpr auto or_else(F &&f) & + { + using G = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The value type must be the same after calling the F"); + + if (has_value()) +@@ -2502,7 +2502,7 @@ public: + constexpr auto or_else(F &&f) const & + { + using G = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The value type must be the same after calling the F"); + + if (has_value()) +@@ -2514,7 +2514,7 @@ public: + constexpr auto or_else(F &&f) && + { + using G = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The value type must be the same after calling the F"); + + if (has_value()) +@@ -2526,7 +2526,7 @@ public: + constexpr auto or_else(F &&f) const && + { + using G = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The value type must be the same after calling the F"); + + if (has_value()) +-- +2.44.0.windows.1 + diff --git a/recipes/zeus_expected/all/test_package/CMakeLists.txt b/recipes/zeus_expected/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5afcbf812c8a3 --- /dev/null +++ b/recipes/zeus_expected/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(zeus_expected REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zeus::expected) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/zeus_expected/all/test_package/conanfile.py b/recipes/zeus_expected/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/zeus_expected/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 = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/zeus_expected/all/test_package/test_package.cpp b/recipes/zeus_expected/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1577435ab0a55 --- /dev/null +++ b/recipes/zeus_expected/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include + +zeus::expected func(int argc) +{ + if (argc > 1) + { + return {}; + } + else + { + return zeus::unexpected(1); + } +} + +int main(int argc, char** argv) +{ + return func(argc) + .and_then([] { return zeus::expected {}; }) + .transform_error([](int) { return 0; }) + .error_or(1); +} diff --git a/recipes/zeus_expected/config.yml b/recipes/zeus_expected/config.yml new file mode 100644 index 0000000000000..f9d1ffa27feeb --- /dev/null +++ b/recipes/zeus_expected/config.yml @@ -0,0 +1,5 @@ +versions: + "1.1.1": + folder: all + "1.1.0": + folder: all diff --git a/recipes/zint/all/conanfile.py b/recipes/zint/all/conanfile.py index f9c54ff2b86cf..c582bdfe4e8e1 100644 --- a/recipes/zint/all/conanfile.py +++ b/recipes/zint/all/conanfile.py @@ -49,7 +49,7 @@ def layout(self): def requirements(self): if self.options.with_libpng: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") self.requires("zlib/[>=1.2.11 <2]") if self.options.with_qt: self.requires("qt/5.15.10") diff --git a/recipes/zlib-ng/all/conandata.yml b/recipes/zlib-ng/all/conandata.yml index c46c2b8a3621f..3d65b1bcb2280 100644 --- a/recipes/zlib-ng/all/conandata.yml +++ b/recipes/zlib-ng/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.2.1": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.2.1.tar.gz" + sha256: "ec6a76169d4214e2e8b737e0850ba4acb806c69eeace6240ed4481b9f5c57cdf" + "2.1.7": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.7.tar.gz" + sha256: "59e68f67cbb16999842daeb517cdd86fc25b177b4affd335cd72b76ddc2a46d8" "2.1.6": url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.6.tar.gz" sha256: "a5d504c0d52e2e2721e7e7d86988dec2e290d723ced2307145dedd06aeb6fef2" diff --git a/recipes/zlib-ng/all/conanfile.py b/recipes/zlib-ng/all/conanfile.py index e0d0177aaa348..bee52f1ca8321 100644 --- a/recipes/zlib-ng/all/conanfile.py +++ b/recipes/zlib-ng/all/conanfile.py @@ -28,6 +28,7 @@ class ZlibNgConan(ConanFile): "with_new_strategies": [True, False], "with_native_instructions": [True, False], "with_reduced_mem": [True, False], + "with_runtime_cpu_detection": [True, False], } default_options = { "shared": False, @@ -38,6 +39,7 @@ class ZlibNgConan(ConanFile): "with_new_strategies": True, "with_native_instructions": False, "with_reduced_mem": False, + "with_runtime_cpu_detection": True, } def config_options(self): @@ -45,6 +47,8 @@ def config_options(self): del self.options.fPIC if Version(self.version) < "2.1.0": del self.options.with_reduced_mem + if Version(self.version) < "2.2.1": + del self.options.with_runtime_cpu_detection def configure(self): if self.options.shared: @@ -76,6 +80,8 @@ def generate(self): tc.variables["WITH_NATIVE_INSTRUCTIONS"] = self.options.with_native_instructions if Version(self.version) >= "2.1.0": tc.variables["WITH_REDUCED_MEM"] = self.options.with_reduced_mem + if Version(self.version) >= "2.2.1": + tc.variables["WITH_RUNTIME_CPU_DETECTION"] = self.options.with_runtime_cpu_detection tc.generate() def build(self): @@ -89,6 +95,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")) # upstream CMakeLists intentionally hardcodes install_name with full # install path (to match autootools behavior), instead of @rpath fix_apple_shared_install_name(self) diff --git a/recipes/zlib-ng/config.yml b/recipes/zlib-ng/config.yml index 2b7d8b2941104..ff1fc8adbb40a 100644 --- a/recipes/zlib-ng/config.yml +++ b/recipes/zlib-ng/config.yml @@ -1,4 +1,8 @@ versions: + "2.2.1": + folder: all + "2.1.7": + folder: all "2.1.6": folder: all "2.1.5": diff --git a/recipes/zlib/all/patches/1.3/0002-gzguts-xcode12-compile-fix.patch b/recipes/zlib/all/patches/1.3/0002-gzguts-xcode12-compile-fix.patch deleted file mode 100644 index d299f4962fa59..0000000000000 --- a/recipes/zlib/all/patches/1.3/0002-gzguts-xcode12-compile-fix.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/gzguts.h b/gzguts.h -index f937504..c4654b5 100644 ---- a/gzguts.h -+++ b/gzguts.h -@@ -25,6 +25,10 @@ - # include - #endif - -+#ifdef __APPLE__ -+#include -+#endif -+ - #ifndef _POSIX_SOURCE - # define _POSIX_SOURCE - #endif diff --git a/recipes/zoe/all/conandata.yml b/recipes/zoe/all/conandata.yml index 568b6a5cdb8e4..2f140c9ad3d15 100644 --- a/recipes/zoe/all/conandata.yml +++ b/recipes/zoe/all/conandata.yml @@ -1,9 +1,15 @@ sources: + "3.1": + url: "https://github.com/winsoft666/zoe/archive/refs/tags/v3.1.tar.gz" + sha256: "4b5a0c0cac5fb61846875699cb7e013c84bc33d852041824bde7af80d793f15d" "3.0": url: "https://github.com/winsoft666/zoe/archive/refs/tags/v3.0.tar.gz" sha256: "718c6de993bea2a4b1866070a8685e77cfa7929bbd9e22abb29e54c67a687a5e" - patches: + "3.1": + - patch_file: "patches/3.1-0002-support-macosx.patch" + patch_description: "support macosx" + patch_type: "portability" "3.0": - patch_file: "patches/3.0-0001-follow-cxx-standards.patch" patch_description: "include threads header" diff --git a/recipes/zoe/all/conanfile.py b/recipes/zoe/all/conanfile.py index 4e403d637b5d2..3206756ac4936 100644 --- a/recipes/zoe/all/conanfile.py +++ b/recipes/zoe/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc_static_runtime -from conan.tools.files import get, copy, apply_conandata_patches, export_conandata_patches +from conan.tools.files import get, copy, apply_conandata_patches, export_conandata_patches, rmdir from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.scm import Version @@ -78,6 +78,7 @@ 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, "share")) def package_info(self): libname = "zoe" if self.options.shared else "zoe-static" diff --git a/recipes/zoe/all/patches/3.1-0002-support-macosx.patch b/recipes/zoe/all/patches/3.1-0002-support-macosx.patch new file mode 100644 index 0000000000000..deb4b7f1cb9e7 --- /dev/null +++ b/recipes/zoe/all/patches/3.1-0002-support-macosx.patch @@ -0,0 +1,40 @@ +diff --git a/src/file_util.cpp b/src/file_util.cpp +index 386bfc8..70086be 100644 +--- a/src/file_util.cpp ++++ b/src/file_util.cpp +@@ -47,6 +47,9 @@ int64_t FileUtil::GetFileSize(FILE* f) { + #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) + _fseeki64(f, 0L, SEEK_END); + int64_t fsize = _ftelli64(f); ++#elif defined(__APPLE__) ++ fseeko(f, 0L, SEEK_END); ++ int64_t fsize = ftello(f); + #else + fseeko64(f, 0L, SEEK_END); + int64_t fsize = ftello64(f); +@@ -182,6 +185,8 @@ int FileUtil::Seek(FILE* f, int64_t offset, int origin) { + if (f) { + #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) + return _fseeki64(f, offset, origin); ++#elif defined(__APPLE__) ++ return fseeko(f, offset, origin); + #else + return fseeko64(f, offset, origin); + #endif +@@ -266,6 +271,16 @@ bool FileUtil::CreateFixedSizeFile(const utf8string& path, int64_t fixed_size) { + } + + return prealloc; ++#elif defined(__APPLE__) ++ int fd = open(path.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); ++ fstore_t store = {F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, fixed_size}; ++ if (fcntl(fd, F_PREALLOCATE, &store) == -1) { ++ store.fst_flags = F_ALLOCATEALL; ++ if (fcntl(fd, F_PREALLOCATE, &store) == -1) { ++ return false; ++ } ++ } ++ return ftruncate(fd, fixed_size) == 0; + #else + int fd = open(path.c_str(), O_RDWR | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); diff --git a/recipes/zoe/config.yml b/recipes/zoe/config.yml index fdd08f532337f..53d82d0ad2363 100644 --- a/recipes/zoe/config.yml +++ b/recipes/zoe/config.yml @@ -1,3 +1,5 @@ versions: + "3.1": + folder: all "3.0": folder: all diff --git a/recipes/zookeeper-client-c/all/conandata.yml b/recipes/zookeeper-client-c/all/conandata.yml index 0487be945d8c9..30c4962751575 100644 --- a/recipes/zookeeper-client-c/all/conandata.yml +++ b/recipes/zookeeper-client-c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.9.1": + url: "https://archive.apache.org/dist/zookeeper/zookeeper-3.9.1/apache-zookeeper-3.9.1.tar.gz" + sha256: "918f0fcf4ca8c53c2cccb97237ea72d2ccba978233ca85eff08f8ba077a8dadf" "3.9.0": url: "https://archive.apache.org/dist/zookeeper/zookeeper-3.9.0/apache-zookeeper-3.9.0.tar.gz" sha256: "c7af07e7411c798398bb8cd50f47780d8e014831666c41df6ec6540c143c0da2" @@ -6,6 +9,10 @@ sources: url: "https://archive.apache.org/dist/zookeeper/zookeeper-3.8.1/apache-zookeeper-3.8.1.tar.gz" sha256: "ccc16850c8ab2553583583234d11c813061b5ea5f3b8ff1d740cde6c1fd1e219" patches: + "3.9.1": + - patch_file: "patches/3.8.1-0001-add-install.patch" + patch_description: "add installer, disable cli program" + patch_type: "conan" "3.9.0": - patch_file: "patches/3.8.1-0001-add-install.patch" patch_description: "add installer, disable cli program" diff --git a/recipes/zookeeper-client-c/all/conanfile.py b/recipes/zookeeper-client-c/all/conanfile.py index ec48f11ba450f..020e3c8246146 100644 --- a/recipes/zookeeper-client-c/all/conanfile.py +++ b/recipes/zookeeper-client-c/all/conanfile.py @@ -44,12 +44,12 @@ def layout(self): def requirements(self): if self.options.with_cyrus_sasl: - self.requires("cyrus-sasl/2.1.27") + self.requires("cyrus-sasl/2.1.28") if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") def build_requirements(self): - self.tool_requires("maven/3.9.2") + self.tool_requires("maven/3.9.4") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -69,7 +69,9 @@ 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")) + # Override maven.repo.local to avoid writing to ~/.m2 + m2_repository = os.path.join(self.build_folder, "m2", "repository") + self.run(f'mvn compile -Dmaven.repo.local="{m2_repository}"', 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")) diff --git a/recipes/zookeeper-client-c/config.yml b/recipes/zookeeper-client-c/config.yml index 31b8685d6b74a..2bc00633d1dbc 100644 --- a/recipes/zookeeper-client-c/config.yml +++ b/recipes/zookeeper-client-c/config.yml @@ -1,4 +1,6 @@ versions: + "3.9.1": + folder: all "3.9.0": folder: all "3.8.1": diff --git a/recipes/zserio/all/conandata.yml b/recipes/zserio/all/conandata.yml index 9a65ed8b0e67c..252e1a38c700d 100644 --- a/recipes/zserio/all/conandata.yml +++ b/recipes/zserio/all/conandata.yml @@ -1,4 +1,14 @@ sources: + "2.14.0": + runtime: + url: "https://github.com/ndsev/zserio/releases/download/v2.14.0/zserio-2.14.0-runtime-libs.zip" + sha256: "6002bfe179333435c84d3be2cfb612c008bd52837512aecea8a888e4a3139564" + compiler: + url: "https://github.com/ndsev/zserio/releases/download/v2.14.0/zserio-2.14.0-bin.zip" + sha256: "c1d4668371ad3543cb24f86b218640da7f720f31afe3f8af2d427114d7c7ae5c" + license: + url: "https://raw.githubusercontent.com/ndsev/zserio/v2.14.0/LICENSE" + sha256: "8fd7b040fc223bb07551dfed490df0d55d6af25e331e58bc7c7599163ed1bb5a" "2.13.0": runtime: url: "https://github.com/ndsev/zserio/releases/download/v2.13.0/zserio-2.13.0-runtime-libs.zip" diff --git a/recipes/zserio/all/conanfile.py b/recipes/zserio/all/conanfile.py index 2ab5a23336294..6a69b2c814401 100644 --- a/recipes/zserio/all/conanfile.py +++ b/recipes/zserio/all/conanfile.py @@ -5,6 +5,7 @@ from conan.tools.files import copy, download, get from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version required_conan_version = ">=1.54.0" @@ -25,12 +26,24 @@ class ZserioConanFile(ConanFile): "fPIC": True } + @property + def _compilers_minimum_version(self): + # https://github.com/ndsev/zserio/tree/master/compiler/extensions/cpp#supported-compilers + return { + "apple-clang": "11", + "clang": "11", + "gcc": "5", + "msvc": "191", + "Visual Studio": "15", + } + @property def _min_cppstd(self): return 11 def export_sources(self): - copy(self, "zserio_compiler.cmake", self.recipe_folder, self.export_sources_folder) + if Version(self.version) < "2.14.0": + copy(self, "zserio_compiler.cmake", self.recipe_folder, self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -50,6 +63,13 @@ def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) + minimum_compiler_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_compiler_version and Version(self.settings.compiler.version) < minimum_compiler_version: + raise ConanInvalidConfiguration( + f"Compiler version '{self.settings.compiler.version}' not supported, " + f"minumum is '{minimum_compiler_version}'!" + ) + def source(self): sources = self.conan_data["sources"][self.version] get(self, **sources["runtime"], strip_root=True) @@ -57,6 +77,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + if not self.settings.get_safe("compiler.cppstd"): + tc.variables["CMAKE_CXX_STANDARD"] = str(self._min_cppstd) tc.generate() def build(self): @@ -65,6 +87,8 @@ def build(self): cmake.build() sources = self.conan_data["sources"][self.version] get(self, **sources["compiler"], pattern="zserio.jar") + if Version(self.version) >= "2.14.0": + get(self, **sources["compiler"], pattern="cmake/zserio_compiler.cmake") @property def _cmake_module_path(self): @@ -80,8 +104,13 @@ def package(self): copy(self, "*.a", self.build_folder, lib_dir, keep_path=False) copy(self, "zserio.jar", self.build_folder, os.path.join(self.package_folder, "bin")) - copy(self, "zserio_compiler.cmake", self.export_sources_folder, - os.path.join(self.package_folder, self._cmake_module_path)) + if Version(self.version) >= "2.14.0": + # from 2.14.0 the cmake script is available directly in zserio repository + copy(self, "zserio_compiler.cmake", os.path.join(self.build_folder, "cmake"), + os.path.join(self.package_folder, self._cmake_module_path)) + else: + copy(self, "zserio_compiler.cmake", self.export_sources_folder, + os.path.join(self.package_folder, self._cmake_module_path)) def package_info(self): self.cpp_info.libs = ["ZserioCppRuntime"] diff --git a/recipes/zserio/config.yml b/recipes/zserio/config.yml index 319f45f887837..24ddb8ef2b935 100644 --- a/recipes/zserio/config.yml +++ b/recipes/zserio/config.yml @@ -1,3 +1,5 @@ versions: + "2.14.0": + folder: all "2.13.0": folder: all diff --git a/recipes/zstd/all/conandata.yml b/recipes/zstd/all/conandata.yml index 0deaf672d11b8..03a332ccef7aa 100644 --- a/recipes/zstd/all/conandata.yml +++ b/recipes/zstd/all/conandata.yml @@ -1,44 +1,22 @@ sources: + "1.5.6": + url: "https://github.com/facebook/zstd/releases/download/v1.5.6/zstd-1.5.6.tar.gz" + sha256: "8c29e06cf42aacc1eafc4077ae2ec6c6fcb96a626157e0593d5e82a34fd403c1" "1.5.5": url: "https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz" sha256: "9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4" - "1.5.4": - url: "https://github.com/facebook/zstd/releases/download/v1.5.4/zstd-1.5.4.tar.gz" - sha256: "0f470992aedad543126d06efab344dc5f3e171893810455787d38347343a4424" "1.5.2": url: "https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz" sha256: "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0" - "1.5.1": - url: "https://github.com/facebook/zstd/releases/download/v1.5.1/zstd-1.5.1.tar.gz" - sha256: "e28b2f2ed5710ea0d3a1ecac3f6a947a016b972b9dd30242369010e5f53d7002" "1.5.0": url: "https://github.com/facebook/zstd/releases/download/v1.5.0/zstd-1.5.0.tar.gz" sha256: "5194fbfa781fcf45b98c5e849651aa7b3b0a008c6b72d4a0db760f3002291e94" - "1.4.9": - url: "https://github.com/facebook/zstd/releases/download/v1.4.9/zstd-1.4.9.tar.gz" - sha256: "29ac74e19ea28659017361976240c4b5c5c24db3b89338731a6feb97c038d293" - "1.4.8": - url: "https://github.com/facebook/zstd/releases/download/v1.4.8/zstd-1.4.8.tar.gz" - sha256: "32478297ca1500211008d596276f5367c54198495cf677e9439f4791a4c69f24" - "1.4.7": - url: "https://github.com/facebook/zstd/releases/download/v1.4.7/zstd-1.4.7.tar.gz" - sha256: "192cbb1274a9672cbcceaf47b5c4e9e59691ca60a357f1d4a8b2dfa2c365d757" - "1.4.5": - url: "https://github.com/facebook/zstd/releases/download/v1.4.5/zstd-1.4.5.tar.gz" - sha256: "98e91c7c6bf162bf90e4e70fdbc41a8188b9fa8de5ad840c401198014406ce9e" - "1.4.4": - url: "https://github.com/facebook/zstd/releases/download/v1.4.4/zstd-1.4.4.tar.gz" - sha256: "59ef70ebb757ffe74a7b3fe9c305e2ba3350021a918d168a046c6300aeea9315" - "1.4.3": - url: "https://github.com/facebook/zstd/releases/download/v1.4.3/zstd-1.4.3.tar.gz" - sha256: "e88ec8d420ff228610b77fba4fbf22b9f8b9d3f223a40ef59c9c075fcdad5767" - "1.3.8": - url: "https://github.com/facebook/zstd/releases/download/v1.3.8/zstd-1.3.8.tar.gz" - sha256: "293fa004dfacfbe90b42660c474920ff27093e3fb6c99f7b76e6083b21d6d48e" - "1.3.5": - url: "https://github.com/facebook/zstd/archive/refs/tags/v1.3.5.tar.gz" - sha256: "d6e1559e4cdb7c4226767d4ddc990bff5f9aab77085ff0d0490c828b025e2eea" patches: + "1.5.6": + - patch_file: "patches/1.5.6-public-scope-windows-shared.patch" + patch_description: "Include zstd.h folder when building shared library on Windows" + patch_type: "bugfix" + patch_source: "https://github.com/facebook/zstd/pull/4009" "1.5.5": - patch_file: "patches/1.5.2-cmake-remove-asm-except-x86_64.patch" patch_description: "use assembler codes only on x86_64" @@ -47,14 +25,6 @@ patches: patch_description: "Add qnx to platform" patch_type: "portability" patch_source: "https://github.com/facebook/zstd/pull/3745" - "1.5.4": - - patch_file: "patches/1.5.2-cmake-remove-asm-except-x86_64.patch" - patch_description: "use assembler codes only on x86_64" - patch_type: "portability" - - patch_file: "patches/1.5.4-decrease-min-cmake-version.patch" - patch_description: "Don't require CMake 3.18 or later" - patch_type: "portability" - patch_source: "https://github.com/facebook/zstd/pull/3510" "1.5.2": - patch_file: "patches/1.5.2-cmake-remove-asm-except-x86_64.patch" patch_description: "use assembler codes only on x86_64" @@ -63,24 +33,8 @@ patches: patch_description: "fix strange performance and scalability issues" patch_type: "bugfix" patch_source: "https://github.com/facebook/zstd/pull/3167" - "1.5.1": - - patch_file: "patches/1.5.1-cmake-remove-asm-except-x86_64.patch" - patch_description: "use assembler codes only on x86_64" - patch_type: "portability" - - patch_file: "patches/1.5.0-remove-explicit-standard-setting.patch" - patch_description: "fix strange performance and scalability issues" - patch_type: "bugfix" - patch_source: "https://github.com/facebook/zstd/pull/3167" "1.5.0": - patch_file: "patches/1.5.0-remove-explicit-standard-setting.patch" patch_description: "fix strange performance and scalability issues" patch_type: "bugfix" patch_source: "https://github.com/facebook/zstd/pull/3167" - "1.4.5": - - patch_file: "patches/1.4.5-cmake-install-dll.patch" - patch_description: "fix runtime installation path" - patch_type: "conan" - "1.3.5": - - patch_file: "patches/1.3.5-cmake-project.patch" - patch_description: "fix `project()` position" - patch_type: "portability" diff --git a/recipes/zstd/all/conanfile.py b/recipes/zstd/all/conanfile.py index 5920d50771523..397fedfdf0451 100644 --- a/recipes/zstd/all/conanfile.py +++ b/recipes/zstd/all/conanfile.py @@ -1,8 +1,6 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir, rm -from conan.tools.scm import Version -from conan.tools.microsoft import is_msvc import glob import os @@ -56,21 +54,13 @@ def generate(self): tc.variables["ZSTD_BUILD_STATIC"] = not self.options.shared or self.options.build_programs tc.variables["ZSTD_BUILD_SHARED"] = self.options.shared tc.variables["ZSTD_MULTITHREAD_SUPPORT"] = self.options.threading - - if not is_msvc(self): - tc.variables["CMAKE_C_FLAGS"] = "-Wno-maybe-uninitialized" - - if Version(self.version) < "1.4.3": - # Generate a relocatable shared lib on Macos - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" tc.generate() def _patch_sources(self): apply_conandata_patches(self) # Don't force PIC - if Version(self.version) >= "1.4.5": - replace_in_file(self, os.path.join(self.source_folder, "build", "cmake", "lib", "CMakeLists.txt"), - "POSITION_INDEPENDENT_CODE On", "") + replace_in_file(self, os.path.join(self.source_folder, "build", "cmake", "lib", "CMakeLists.txt"), + "POSITION_INDEPENDENT_CODE On", "") def build(self): self._patch_sources() diff --git a/recipes/zstd/all/patches/1.3.5-cmake-project.patch b/recipes/zstd/all/patches/1.3.5-cmake-project.patch deleted file mode 100644 index c8c9479c8ede1..0000000000000 --- a/recipes/zstd/all/patches/1.3.5-cmake-project.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/build/cmake/CMakeLists.txt -+++ b/build/cmake/CMakeLists.txt -@@ -7,8 +7,8 @@ - # in the COPYING file in the root directory of this source tree). - # ################################################################ - --PROJECT(zstd) - CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9) -+PROJECT(zstd) - SET(ZSTD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") - LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") - INCLUDE(GNUInstallDirs) diff --git a/recipes/zstd/all/patches/1.4.5-cmake-install-dll.patch b/recipes/zstd/all/patches/1.4.5-cmake-install-dll.patch deleted file mode 100644 index 9433dfdbea9cb..0000000000000 --- a/recipes/zstd/all/patches/1.4.5-cmake-install-dll.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- build/cmake/lib/CMakeLists.txt 2020-05-22 05:04:00.000000000 +0000 -+++ build/cmake/lib/CMakeLists.txt 2020-05-22 19:14:38.249960211 +0000 -@@ -161,6 +161,7 @@ - install(TARGETS ${library_targets} - EXPORT zstdExports - INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" -+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ) diff --git a/recipes/zstd/all/patches/1.5.1-cmake-remove-asm-except-x86_64.patch b/recipes/zstd/all/patches/1.5.1-cmake-remove-asm-except-x86_64.patch deleted file mode 100644 index 34bb693b4e039..0000000000000 --- a/recipes/zstd/all/patches/1.5.1-cmake-remove-asm-except-x86_64.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt -index 7ba4693..d6e1046 100644 ---- a/build/cmake/lib/CMakeLists.txt -+++ b/build/cmake/lib/CMakeLists.txt -@@ -22,7 +22,11 @@ include_directories(${LIBRARY_DIR} ${LIBRARY_DIR}/common) - - file(GLOB CommonSources ${LIBRARY_DIR}/common/*.c) - file(GLOB CompressSources ${LIBRARY_DIR}/compress/*.c) --file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c ${LIBRARY_DIR}/decompress/*.S) -+if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") -+ file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c ${LIBRARY_DIR}/decompress/*.S) -+else() -+ file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c) -+endif() - file(GLOB DictBuilderSources ${LIBRARY_DIR}/dictBuilder/*.c) - - set(Sources diff --git a/recipes/zstd/all/patches/1.5.4-decrease-min-cmake-version.patch b/recipes/zstd/all/patches/1.5.4-decrease-min-cmake-version.patch deleted file mode 100644 index d846e0df710df..0000000000000 --- a/recipes/zstd/all/patches/1.5.4-decrease-min-cmake-version.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake -+++ b/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake -@@ -1,6 +1,15 @@ - include(CheckCXXCompilerFlag) - include(CheckCCompilerFlag) --include(CheckLinkerFlag) -+# VERSION_GREATER_EQUAL requires CMake 3.7 or later. -+# https://cmake.org/cmake/help/latest/command/if.html#version-greater-equal -+if (CMAKE_VERSION VERSION_LESS 3.18) -+ set(ZSTD_HAVE_CHECK_LINKER_FLAG false) -+else () -+ set(ZSTD_HAVE_CHECK_LINKER_FLAG true) -+endif () -+if (ZSTD_HAVE_CHECK_LINKER_FLAG) -+ include(CheckLinkerFlag) -+endif() - - function(EnableCompilerFlag _flag _C _CXX _LD) - string(REGEX REPLACE "\\+" "PLUS" varname "${_flag}") -@@ -20,7 +29,15 @@ function(EnableCompilerFlag _flag _C _CXX _LD) - endif () - endif () - if (_LD) -- CHECK_LINKER_FLAG(C ${_flag} LD_FLAG_${varname}) -+ # We never add a linker flag with CMake < 3.18. We will -+ # implement CHECK_LINKER_FLAG() like feature for CMake < 3.18 -+ # or require CMake >= 3.18 when we need to add a required -+ # linker flag in future. -+ if (ZSTD_HAVE_CHECK_LINKER_FLAG) -+ CHECK_LINKER_FLAG(C ${_flag} LD_FLAG_${varname}) -+ else () -+ set(LD_FLAG_${varname} false) -+ endif () - if (LD_FLAG_${varname}) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${_flag}" PARENT_SCOPE) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${_flag}" PARENT_SCOPE) diff --git a/recipes/zstd/all/patches/1.5.6-public-scope-windows-shared.patch b/recipes/zstd/all/patches/1.5.6-public-scope-windows-shared.patch new file mode 100644 index 0000000000000..9862de8aaa890 --- /dev/null +++ b/recipes/zstd/all/patches/1.5.6-public-scope-windows-shared.patch @@ -0,0 +1,13 @@ +diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt +index 5d514cc..1791897 100644 +--- a/build/cmake/lib/CMakeLists.txt ++++ b/build/cmake/lib/CMakeLists.txt +@@ -123,7 +123,7 @@ set(PUBLIC_INCLUDE_DIRS ${LIBRARY_DIR}) + set(library_targets) + if (ZSTD_BUILD_SHARED) + add_library(libzstd_shared SHARED ${Sources} ${Headers} ${PlatformDependResources}) +- target_include_directories(libzstd_shared INTERFACE $) ++ target_include_directories(libzstd_shared PUBLIC $) + list(APPEND library_targets libzstd_shared) + if (ZSTD_MULTITHREAD_SUPPORT) + set_property(TARGET libzstd_shared APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD") diff --git a/recipes/zstd/all/test_package/conanfile.py b/recipes/zstd/all/test_package/conanfile.py index 5c69b0e8faebe..541303d07640d 100644 --- a/recipes/zstd/all/test_package/conanfile.py +++ b/recipes/zstd/all/test_package/conanfile.py @@ -25,7 +25,4 @@ def test(self): return bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - png_file = os.path.join(self.source_folder, "logo.png") - self.run(f"{bin_path} {png_file}", env="conanrun") - - self.run(f"zstd --version", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/zstd/all/test_package/logo.png b/recipes/zstd/all/test_package/logo.png deleted file mode 100644 index ef3d175cdec07..0000000000000 Binary files a/recipes/zstd/all/test_package/logo.png and /dev/null differ diff --git a/recipes/zstd/all/test_package/test_package.c b/recipes/zstd/all/test_package/test_package.c index 6ef7323d43a0d..29bca24047b95 100644 --- a/recipes/zstd/all/test_package/test_package.c +++ b/recipes/zstd/all/test_package/test_package.c @@ -1,126 +1,12 @@ -/* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under both the BSD-style license (found in the - * LICENSE file in the root directory of this source tree) and the GPLv2 (found - * in the COPYING file in the root directory of this source tree). - * You may select, at your option, one of the above-listed licenses. - */ - - -#include // malloc, free, exit -#include // fprintf, perror, feof, fopen, etc. -#include // strlen, memset, strcat -#include // presumes zstd library is installed - - -static void* malloc_orDie(size_t size) -{ - void* const buff = malloc(size); - if (buff) return buff; - /* error */ - perror("malloc:"); - exit(1); -} - -static FILE* fopen_orDie(const char *filename, const char *instruction) -{ - FILE* const inFile = fopen(filename, instruction); - if (inFile) return inFile; - /* error */ - perror(filename); - exit(3); -} - -static size_t fread_orDie(void* buffer, size_t sizeToRead, FILE* file) -{ - size_t const readSize = fread(buffer, 1, sizeToRead, file); - if (readSize == sizeToRead) return readSize; /* good */ - if (feof(file)) return readSize; /* good, reached end of file */ - /* error */ - perror("fread"); - exit(4); -} - -static size_t fwrite_orDie(const void* buffer, size_t sizeToWrite, FILE* file) -{ - size_t const writtenSize = fwrite(buffer, 1, sizeToWrite, file); - if (writtenSize == sizeToWrite) return sizeToWrite; /* good */ - /* error */ - perror("fwrite"); - exit(5); -} - -static size_t fclose_orDie(FILE* file) -{ - if (!fclose(file)) return 0; - /* error */ - perror("fclose"); - exit(6); -} - - -static void compressFile_orDie(const char* fname, const char* outName, int cLevel) -{ - FILE* const fin = fopen_orDie(fname, "rb"); - FILE* const fout = fopen_orDie(outName, "wb"); - size_t const buffInSize = ZSTD_CStreamInSize(); /* can always read one full block */ - void* const buffIn = malloc_orDie(buffInSize); - size_t const buffOutSize = ZSTD_CStreamOutSize(); /* can always flush a full block */ - void* const buffOut = malloc_orDie(buffOutSize); - - ZSTD_CStream* const cstream = ZSTD_createCStream(); - if (cstream==NULL) { fprintf(stderr, "ZSTD_createCStream() error \n"); exit(10); } - size_t const initResult = ZSTD_initCStream(cstream, cLevel); - if (ZSTD_isError(initResult)) { fprintf(stderr, "ZSTD_initCStream() error : %s \n", ZSTD_getErrorName(initResult)); exit(11); } - - size_t read, toRead = buffInSize; - while( (read = fread_orDie(buffIn, toRead, fin)) ) { - ZSTD_inBuffer input = { buffIn, read, 0 }; - while (input.pos < input.size) { - ZSTD_outBuffer output = { buffOut, buffOutSize, 0 }; - toRead = ZSTD_compressStream(cstream, &output , &input); /* toRead is guaranteed to be <= ZSTD_CStreamInSize() */ - if (ZSTD_isError(toRead)) { fprintf(stderr, "ZSTD_compressStream() error : %s \n", ZSTD_getErrorName(toRead)); exit(12); } - if (toRead > buffInSize) toRead = buffInSize; /* Safely handle case when `buffInSize` is manually changed to a value < ZSTD_CStreamInSize()*/ - fwrite_orDie(buffOut, output.pos, fout); - } - } - - ZSTD_outBuffer output = { buffOut, buffOutSize, 0 }; - size_t const remainingToFlush = ZSTD_endStream(cstream, &output); /* close frame */ - if (remainingToFlush) { fprintf(stderr, "not fully flushed"); exit(13); } - fwrite_orDie(buffOut, output.pos, fout); - - ZSTD_freeCStream(cstream); - fclose_orDie(fout); - fclose_orDie(fin); - free(buffIn); - free(buffOut); -} - - -static const char* createOutFilename_orDie(const char* filename) -{ - size_t const inL = strlen(filename); - size_t const outL = inL + 5; - void* outSpace = malloc_orDie(outL); - memset(outSpace, 0, outL); - strcat(outSpace, filename); - strcat(outSpace, ".zst"); - return (const char*)outSpace; -} - -int main(int argc, const char** argv) -{ - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return 1; - } - const char* const inFilename = argv[1]; - - const char* const outFilename = createOutFilename_orDie("logo.png"); - compressFile_orDie(inFilename, outFilename, 1); +#include +#include +#include +#include + +int main() { + const char* originalData = "Sample text"; + size_t compressedSize = ZSTD_compressBound(strlen(originalData) + 1); + printf("%zu\n", compressedSize); return 0; } diff --git a/recipes/zstd/all/test_v1_package/conanfile.py b/recipes/zstd/all/test_v1_package/conanfile.py index c6bf65d610aa1..38f4483872d47 100644 --- a/recipes/zstd/all/test_v1_package/conanfile.py +++ b/recipes/zstd/all/test_v1_package/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - png_file = os.path.join(self.source_folder, os.pardir, "test_package", "logo.png") - self.run(f"{bin_path} {png_file}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/zstd/config.yml b/recipes/zstd/config.yml index ddb81b147ddb6..3b1802f0177ee 100644 --- a/recipes/zstd/config.yml +++ b/recipes/zstd/config.yml @@ -1,27 +1,9 @@ versions: - "1.5.5": + "1.5.6": folder: all - "1.5.4": + "1.5.5": folder: all "1.5.2": folder: all - "1.5.1": - folder: all "1.5.0": folder: all - "1.4.9": - folder: all - "1.4.8": - folder: all - "1.4.7": - folder: all - "1.4.5": - folder: all - "1.4.4": - folder: all - "1.4.3": - folder: all - "1.3.8": - folder: all - "1.3.5": - folder: all